[netfilter-cvslog] r3295 - trunk/nfsim-testsuite/03NAT

rusty at netfilter.org rusty at netfilter.org
Sun Nov 21 10:00:27 CET 2004


Author: rusty at netfilter.org
Date: 2004-11-21 10:00:27 +0100 (Sun, 21 Nov 2004)
New Revision: 3295

Modified:
   trunk/nfsim-testsuite/03NAT/17masq.sim
Log:
Fix test so it is actually valid.
Relies on pre-2.6.10-rc2 MASQUERADE behaviour (or with my recent patch)


Modified: trunk/nfsim-testsuite/03NAT/17masq.sim
===================================================================
--- trunk/nfsim-testsuite/03NAT/17masq.sim	2004-11-21 08:58:07 UTC (rev 3294)
+++ trunk/nfsim-testsuite/03NAT/17masq.sim	2004-11-21 09:00:27 UTC (rev 3295)
@@ -15,27 +15,40 @@
 
 iptables -t nat -A POSTROUTING -s 192.168.0.2 -d 192.168.1.0/24 -j MASQUERADE
 
-expect gen_ip send_ip:eth1 {IPv4 192.168.1.1 192.168.1.2 100 1 8 0 55 57}
+expect gen_ip send:eth1 {IPv4 192.168.1.1 192.168.1.2 100 1 8 0 55 57}
 gen_ip IF=eth0 192.168.0.2 192.168.1.2 100 1 8 0 55 57
 
 # Reply
-expect gen_ip send_ip:eth0 {IPv4 192.168.1.2 192.168.0.2 100 1 0 0 55 57}
+expect gen_ip send:eth0 {IPv4 192.168.1.2 192.168.0.2 100 1 0 0 55 57}
 gen_ip IF=eth1 192.168.1.2 192.168.1.1 100 1 0 0 55 57
 
-# Test deletion on interface down.
-expect gen_ip send_ip:eth1 {IPv4 192.168.1.1 192.168.1.2 100 1 8 0 56 58}
+# Test interface coming up on same IP: mapping should stay.
+expect gen_ip send:eth1 {IPv4 192.168.1.1 192.168.1.2 100 1 8 0 56 58}
 gen_ip 192.168.0.2 192.168.1.2 100 1 8 0 56 58
 
-# Down interface and up again.
 ifconfig eth1 down
-ifconfig eth1 192.168.0.1 24 192.168.0.255 up
+ifconfig eth1 192.168.1.1 24 192.168.1.255 up
 
-# Reply should not be mapped.
-expect gen_ip send_ip:lo {IPv4 192.168.1.2 192.168.1.1 100 1 0 0 56 58}
+expect gen_ip send:eth0 {IPv4 192.168.1.2 192.168.0.2 100 1 0 0 56 58}
 gen_ip IF=eth1 192.168.1.2 192.168.1.1 100 1 0 0 56 58
 
+# Test interface coming up at different IP: mapping should vanish.
+expect gen_ip send:eth1 {IPv4 192.168.1.1 192.168.1.2 100 1 8 0 60 62}
+gen_ip IF=eth0 192.168.0.2 192.168.1.2 100 1 8 0 60 62
+
+ifconfig eth1 down
+ifconfig eth1 192.168.1.2 24 192.168.1.255 up
+
+# Reply should not be mapped.
+expect gen_ip send:lo {IPv4 192.168.1.2 192.168.1.1 100 1 0 0 60 62}
+gen_ip IF=eth1 192.168.1.2 192.168.1.1 100 1 0 0 60 62
+
 iptables -t nat -D POSTROUTING -s 192.168.0.2 -d 192.168.1.0/24 -j MASQUERADE
 
+# Restore initial address
+ifconfig eth1 down
+ifconfig eth1 192.168.1.1 24 192.168.1.255 up
+
 # Check port range for masquerading.
 iptables -t nat -p tcp -A POSTROUTING -o tap1 -j MASQUERADE --to-port 61000-65095
 




More information about the netfilter-cvslog mailing list