Comment 3 for bug 827807

Revision history for this message
Eric Dodemont (dodeeric) wrote :

Example:

- Floating IP = 192.168.1.240
- Fixed IP = 10.0.3.8 (i-00000006)

---

root@node1:~# euca-describe-addresses
ADDRESS 192.168.1.240 i-00000006 (project-toc)

root@node1:~# iptables -nL -t nat | grep 192.168.1.240
DNAT all -- 0.0.0.0/0 192.168.1.240 to:10.0.3.8
DNAT all -- 0.0.0.0/0 192.168.1.240 to:10.0.3.8
SNAT all -- 10.0.3.8 0.0.0.0/0 to:192.168.1.240

root@node1:~# iptables-save -t nat > /root/nat.rules

---

root@node1:~# stop nova-network
nova-network stop/waiting

root@node1:~# iptables -nL -t nat | grep 240
DNAT all -- 0.0.0.0/0 192.168.1.240 to:10.0.3.8
DNAT all -- 0.0.0.0/0 192.168.1.240 to:10.0.3.8
SNAT all -- 10.0.3.8 0.0.0.0/0 to:192.168.1.240

root@node1:~# start nova-network
nova-network start/running, process 5314

root@node1:~# iptables -nL -t nat | grep 192.168.1.240
==> Floating IP NAT rules no more there!

root@node1:~# ip addr | grep 192.168.1.240
net 192.168.1.240/32 scope global eth0 ==> Floating IP still configured on the interface

root@node1:~# euca-describe-addresses
ADDRESS 192.168.1.240 i-00000006 (project-toc) ==> Floating IP still associated in the DB

---

root@node1:~# iptables-restore < /root/nat.rules

root@node1:~# iptables -nL -t nat | grep 192.168.1.240
DNAT all -- 0.0.0.0/0 192.168.1.240 to:10.0.3.8
DNAT all -- 0.0.0.0/0 192.168.1.240 to:10.0.3.8
SNAT all -- 10.0.3.8 0.0.0.0/0 to:192.168.1.240