[netfilter-cvslog] r3438 - trunk/nfsim-testsuite/01iptables

rusty at netfilter.org rusty at netfilter.org
Sat Dec 18 14:18:46 CET 2004


Author: rusty at netfilter.org
Date: 2004-12-18 14:18:45 +0100 (Sat, 18 Dec 2004)
New Revision: 3438

Added:
   trunk/nfsim-testsuite/01iptables/35ipt_mac.sim
Log:
Samuel Jean:
Like the subject suggests, here's the ipt_mac testcase.
This is your third christmas gift. Please, don't try to find out how much
I paid for... 8)~



Added: trunk/nfsim-testsuite/01iptables/35ipt_mac.sim
===================================================================
--- trunk/nfsim-testsuite/01iptables/35ipt_mac.sim	2004-12-18 13:16:42 UTC (rev 3437)
+++ trunk/nfsim-testsuite/01iptables/35ipt_mac.sim	2004-12-18 13:18:45 UTC (rev 3438)
@@ -0,0 +1,26 @@
+# Straight rule
+iptables -I INPUT -m mac --mac-source 00:50:BA:56:CB:3A -j DROP
+
+	# source MAC matches
+expect gen_ip hook:NF_IP_LOCAL_IN iptable_filter NF_DROP {IPv4 192.168.0.2 192.168.0.1 0 6 1 2 SYN}
+gen_ip IF=eth0 MAC=00:50:BA:56:CB:3A 192.168.0.2 192.168.0.1 0 6 1 2 SYN
+
+	# source MAC doesn't
+expect gen_ip hook:NF_IP_LOCAL_IN iptable_filter NF_ACCEPT {IPv4 192.168.0.2 192.168.0.1 0 6 1 2 SYN}
+gen_ip IF=eth0 MAC=00:A0:C9:5A:94:EF 192.168.0.2 192.168.0.1 0 6 1 2 SYN
+
+iptables -D INPUT -m mac --mac-source 00:50:BA:56:CB:3A -j DROP
+
+# Inverted rule
+iptables -I INPUT -m mac ! --mac-source 00:50:BA:56:CB:3A -j DROP
+
+	# source MAC matches
+expect gen_ip hook:NF_IP_LOCAL_IN iptable_filter NF_ACCEPT {IPv4 192.168.0.2 192.168.0.1 0 6 1 2 SYN}
+gen_ip IF=eth0 MAC=00:50:BA:56:CB:3A 192.168.0.2 192.168.0.1 0 6 1 2 SYN
+
+	# source MAC doesn't
+expect gen_ip hook:NF_IP_LOCAL_IN iptable_filter NF_DROP {IPv4 192.168.0.2 192.168.0.1 0 6 1 2 SYN}
+gen_ip IF=eth0 MAC=00:A0:C9:5A:94:EF 192.168.0.2 192.168.0.1 0 6 1 2 SYN
+
+iptables -D INPUT -m mac ! --mac-source 00:50:BA:56:CB:3A -j DROP
+




More information about the netfilter-cvslog mailing list