]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
converted all tnc iptables scenarios
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 11 Jan 2013 03:19:07 +0000 (04:19 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 17 Jan 2013 15:55:02 +0000 (16:55 +0100)
32 files changed:
testing/tests/tnc/tnccs-11-fhh/posttest.dat
testing/tests/tnc/tnccs-11-fhh/pretest.dat
testing/tests/tnc/tnccs-11-radius-block/hosts/moon/etc/init.d/iptables [deleted file]
testing/tests/tnc/tnccs-11-radius-block/hosts/moon/etc/iptables.rules [new file with mode: 0644]
testing/tests/tnc/tnccs-11-radius-block/posttest.dat
testing/tests/tnc/tnccs-11-radius-block/pretest.dat
testing/tests/tnc/tnccs-11-radius/hosts/moon/etc/init.d/iptables [deleted file]
testing/tests/tnc/tnccs-11-radius/hosts/moon/etc/iptables.rules [new file with mode: 0644]
testing/tests/tnc/tnccs-11-radius/posttest.dat
testing/tests/tnc/tnccs-11-radius/pretest.dat
testing/tests/tnc/tnccs-11/posttest.dat
testing/tests/tnc/tnccs-11/pretest.dat
testing/tests/tnc/tnccs-20-block/posttest.dat
testing/tests/tnc/tnccs-20-block/pretest.dat
testing/tests/tnc/tnccs-20-client-retry/posttest.dat
testing/tests/tnc/tnccs-20-client-retry/pretest.dat
testing/tests/tnc/tnccs-20-fhh/posttest.dat
testing/tests/tnc/tnccs-20-fhh/pretest.dat
testing/tests/tnc/tnccs-20-os/posttest.dat
testing/tests/tnc/tnccs-20-os/pretest.dat
testing/tests/tnc/tnccs-20-pdp/hosts/moon/etc/init.d/iptables [deleted file]
testing/tests/tnc/tnccs-20-pdp/hosts/moon/etc/iptables.rules [new file with mode: 0644]
testing/tests/tnc/tnccs-20-pdp/posttest.dat
testing/tests/tnc/tnccs-20-pdp/pretest.dat
testing/tests/tnc/tnccs-20-server-retry/posttest.dat
testing/tests/tnc/tnccs-20-server-retry/pretest.dat
testing/tests/tnc/tnccs-20-tls/posttest.dat
testing/tests/tnc/tnccs-20-tls/pretest.dat
testing/tests/tnc/tnccs-20/posttest.dat
testing/tests/tnc/tnccs-20/pretest.dat
testing/tests/tnc/tnccs-dynamic/posttest.dat
testing/tests/tnc/tnccs-dynamic/pretest.dat

index 7cebd7f25714c188fdaeb180dc8d53f5774848e3..1865a1c60eb1dcb5867d6c1d9bf6605f054c4757 100644 (file)
@@ -1,6 +1,6 @@
 moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
index c7a30ee7c366f5fdcf72a94afa9b53a5b3891af4..997c70a8eb78013af690167a4ef4b2ed0d44d12b 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 moon::cat /etc/tnc_config
 carol::cat /etc/tnc_config
 dave::cat /etc/tnc_config
diff --git a/testing/tests/tnc/tnccs-11-radius-block/hosts/moon/etc/init.d/iptables b/testing/tests/tnc/tnccs-11-radius-block/hosts/moon/etc/init.d/iptables
deleted file mode 100755 (executable)
index 56587b2..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-opts="start stop reload"
-
-depend() {
-       before net
-       need logger
-}
-
-start() {
-       ebegin "Starting firewall"
-
-       # enable IP forwarding
-       echo 1 > /proc/sys/net/ipv4/ip_forward
-       
-       # default policy is DROP
-       /sbin/iptables -P INPUT DROP
-       /sbin/iptables -P OUTPUT DROP
-       /sbin/iptables -P FORWARD DROP
-
-       # allow esp
-       iptables -A INPUT  -i eth0 -p 50 -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p 50 -j ACCEPT
-
-       # allow IKE
-       iptables -A INPUT  -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
-
-       # allow MobIKE
-       iptables -A INPUT  -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p udp --dport 4500 --sport 4500 -j ACCEPT
-
-       # allow crl fetch from winnetou
-       iptables -A INPUT  -i eth0 -p tcp --sport 80 -s PH_IP_WINNETOU -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p tcp --dport 80 -d PH_IP_WINNETOU -j ACCEPT
-
-       # allow RADIUS protocol with alice
-       iptables -A INPUT  -i eth1 -p udp --sport 1812 -s PH_IP_ALICE -j ACCEPT
-       iptables -A OUTPUT -o eth1 -p udp --dport 1812 -d PH_IP_ALICE -j ACCEPT
-
-       # allow ssh
-       iptables -A INPUT  -p tcp --dport 22 -j ACCEPT
-       iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
-
-       eend $?
-}
-
-stop() {
-       ebegin "Stopping firewall"
-               for a in `cat /proc/net/ip_tables_names`; do
-                       /sbin/iptables -F -t $a
-                       /sbin/iptables -X -t $a
-       
-                       if [ $a == nat ]; then
-                               /sbin/iptables -t nat -P PREROUTING ACCEPT
-                               /sbin/iptables -t nat -P POSTROUTING ACCEPT
-                               /sbin/iptables -t nat -P OUTPUT ACCEPT
-                       elif [ $a == mangle ]; then
-                               /sbin/iptables -t mangle -P PREROUTING ACCEPT
-                               /sbin/iptables -t mangle -P INPUT ACCEPT
-                               /sbin/iptables -t mangle -P FORWARD ACCEPT
-                               /sbin/iptables -t mangle -P OUTPUT ACCEPT
-                               /sbin/iptables -t mangle -P POSTROUTING ACCEPT
-                       elif [ $a == filter ]; then
-                               /sbin/iptables -t filter -P INPUT ACCEPT
-                               /sbin/iptables -t filter -P FORWARD ACCEPT
-                               /sbin/iptables -t filter -P OUTPUT ACCEPT
-                       fi
-               done
-       eend $?
-}
-
-reload() {
-       ebegin "Flushing firewall"
-               for a in `cat /proc/net/ip_tables_names`; do
-                       /sbin/iptables -F -t $a
-                       /sbin/iptables -X -t $a
-               done;
-        eend $?
-       start
-}
-
diff --git a/testing/tests/tnc/tnccs-11-radius-block/hosts/moon/etc/iptables.rules b/testing/tests/tnc/tnccs-11-radius-block/hosts/moon/etc/iptables.rules
new file mode 100644 (file)
index 0000000..1eb7553
--- /dev/null
@@ -0,0 +1,32 @@
+*filter
+
+# default policy is DROP
+-P INPUT DROP
+-P OUTPUT DROP
+-P FORWARD DROP
+
+# allow esp
+-A INPUT  -i eth0 -p 50 -j ACCEPT
+-A OUTPUT -o eth0 -p 50 -j ACCEPT
+
+# allow IKE
+-A INPUT  -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
+-A OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
+
+# allow MobIKE
+-A INPUT  -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
+-A OUTPUT -o eth0 -p udp --dport 4500 --sport 4500 -j ACCEPT
+
+# allow ssh
+-A INPUT  -p tcp --dport 22 -j ACCEPT
+-A OUTPUT -p tcp --sport 22 -j ACCEPT
+
+# allow crl fetch from winnetou
+-A INPUT  -i eth0 -p tcp --sport 80 -s PH_IP_WINNETOU -j ACCEPT
+-A OUTPUT -o eth0 -p tcp --dport 80 -d PH_IP_WINNETOU -j ACCEPT
+
+# allow RADIUS protocol with alice
+-A INPUT  -i eth1 -p udp --sport 1812 -s PH_IP_ALICE -j ACCEPT
+-A OUTPUT -o eth1 -p udp --dport 1812 -d PH_IP_ALICE -j ACCEPT
+
+COMMIT
index 17ae486930d23e026b8a0e750ba0decab7c215de..5e5a8514dbbf930220569a8b8274e438aa9b1fa9 100644 (file)
@@ -3,7 +3,7 @@ carol::ipsec stop
 dave::ipsec stop
 alice::killall radiusd
 alice::rm /etc/freeradius/sites-enabled/inner-tunnel-second
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
 dave::/etc/init.d/apache2 stop 2> /dev/null
index 46b49997183df4e924ccb3f78216d928b9ac9d5f..c8f2139a839d206449d96144942a2f5f672a5b04 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 dave::/etc/init.d/apache2 start 2> /dev/null
 alice::ln -s /etc/freeradius/sites-available/inner-tunnel-second /etc/freeradius/sites-enabled/inner-tunnel-second
 alice::cat /etc/freeradius/sites-enabled/inner-tunnel-second
diff --git a/testing/tests/tnc/tnccs-11-radius/hosts/moon/etc/init.d/iptables b/testing/tests/tnc/tnccs-11-radius/hosts/moon/etc/init.d/iptables
deleted file mode 100755 (executable)
index 56587b2..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-opts="start stop reload"
-
-depend() {
-       before net
-       need logger
-}
-
-start() {
-       ebegin "Starting firewall"
-
-       # enable IP forwarding
-       echo 1 > /proc/sys/net/ipv4/ip_forward
-       
-       # default policy is DROP
-       /sbin/iptables -P INPUT DROP
-       /sbin/iptables -P OUTPUT DROP
-       /sbin/iptables -P FORWARD DROP
-
-       # allow esp
-       iptables -A INPUT  -i eth0 -p 50 -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p 50 -j ACCEPT
-
-       # allow IKE
-       iptables -A INPUT  -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
-
-       # allow MobIKE
-       iptables -A INPUT  -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p udp --dport 4500 --sport 4500 -j ACCEPT
-
-       # allow crl fetch from winnetou
-       iptables -A INPUT  -i eth0 -p tcp --sport 80 -s PH_IP_WINNETOU -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p tcp --dport 80 -d PH_IP_WINNETOU -j ACCEPT
-
-       # allow RADIUS protocol with alice
-       iptables -A INPUT  -i eth1 -p udp --sport 1812 -s PH_IP_ALICE -j ACCEPT
-       iptables -A OUTPUT -o eth1 -p udp --dport 1812 -d PH_IP_ALICE -j ACCEPT
-
-       # allow ssh
-       iptables -A INPUT  -p tcp --dport 22 -j ACCEPT
-       iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
-
-       eend $?
-}
-
-stop() {
-       ebegin "Stopping firewall"
-               for a in `cat /proc/net/ip_tables_names`; do
-                       /sbin/iptables -F -t $a
-                       /sbin/iptables -X -t $a
-       
-                       if [ $a == nat ]; then
-                               /sbin/iptables -t nat -P PREROUTING ACCEPT
-                               /sbin/iptables -t nat -P POSTROUTING ACCEPT
-                               /sbin/iptables -t nat -P OUTPUT ACCEPT
-                       elif [ $a == mangle ]; then
-                               /sbin/iptables -t mangle -P PREROUTING ACCEPT
-                               /sbin/iptables -t mangle -P INPUT ACCEPT
-                               /sbin/iptables -t mangle -P FORWARD ACCEPT
-                               /sbin/iptables -t mangle -P OUTPUT ACCEPT
-                               /sbin/iptables -t mangle -P POSTROUTING ACCEPT
-                       elif [ $a == filter ]; then
-                               /sbin/iptables -t filter -P INPUT ACCEPT
-                               /sbin/iptables -t filter -P FORWARD ACCEPT
-                               /sbin/iptables -t filter -P OUTPUT ACCEPT
-                       fi
-               done
-       eend $?
-}
-
-reload() {
-       ebegin "Flushing firewall"
-               for a in `cat /proc/net/ip_tables_names`; do
-                       /sbin/iptables -F -t $a
-                       /sbin/iptables -X -t $a
-               done;
-        eend $?
-       start
-}
-
diff --git a/testing/tests/tnc/tnccs-11-radius/hosts/moon/etc/iptables.rules b/testing/tests/tnc/tnccs-11-radius/hosts/moon/etc/iptables.rules
new file mode 100644 (file)
index 0000000..1eb7553
--- /dev/null
@@ -0,0 +1,32 @@
+*filter
+
+# default policy is DROP
+-P INPUT DROP
+-P OUTPUT DROP
+-P FORWARD DROP
+
+# allow esp
+-A INPUT  -i eth0 -p 50 -j ACCEPT
+-A OUTPUT -o eth0 -p 50 -j ACCEPT
+
+# allow IKE
+-A INPUT  -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
+-A OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
+
+# allow MobIKE
+-A INPUT  -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
+-A OUTPUT -o eth0 -p udp --dport 4500 --sport 4500 -j ACCEPT
+
+# allow ssh
+-A INPUT  -p tcp --dport 22 -j ACCEPT
+-A OUTPUT -p tcp --sport 22 -j ACCEPT
+
+# allow crl fetch from winnetou
+-A INPUT  -i eth0 -p tcp --sport 80 -s PH_IP_WINNETOU -j ACCEPT
+-A OUTPUT -o eth0 -p tcp --dport 80 -d PH_IP_WINNETOU -j ACCEPT
+
+# allow RADIUS protocol with alice
+-A INPUT  -i eth1 -p udp --sport 1812 -s PH_IP_ALICE -j ACCEPT
+-A OUTPUT -o eth1 -p udp --dport 1812 -d PH_IP_ALICE -j ACCEPT
+
+COMMIT
index ffe82ea22ff65609afc9af5af8cde3244b662888..a64a9147c9a78db9099645f12b1e132398942e24 100644 (file)
@@ -3,6 +3,6 @@ carol::ipsec stop
 dave::ipsec stop
 alice::killall radiusd
 alice::rm /etc/freeradius/sites-enabled/inner-tunnel-second
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
index 50037f3e0af3a6e505f99c230b110e10a941777b..8f79c776ae1fdb24d7947954a532aa567861d8e3 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 alice::ln -s /etc/freeradius/sites-available/inner-tunnel-second /etc/freeradius/sites-enabled/inner-tunnel-second
 alice::cat /etc/freeradius/sites-enabled/inner-tunnel-second
 alice::LEAK_DETECTIVE_DISABLE=1 LOG4CXX_CONFIGURATION=/etc/tnc/log4cxx.properties radiusd
index 7cebd7f25714c188fdaeb180dc8d53f5774848e3..1865a1c60eb1dcb5867d6c1d9bf6605f054c4757 100644 (file)
@@ -1,6 +1,6 @@
 moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
index dd729cb0b7beb67082ea8623270bfea515145190..7bfcf0d078fed10004c0cb9dc780699d09e1b34b 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 moon::cat /etc/tnc_config
 carol::cat /etc/tnc_config
 dave::cat /etc/tnc_config
index 50bb7e1177712feae5e84066ec3e9e2634700d90..2258e03ff2261edfc9d7a791cddf4c6c27f7a801 100644 (file)
@@ -1,7 +1,7 @@
 moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
 dave::/etc/init.d/apache2 stop 2> /dev/null
index 7b0a42fcd97cfda6df6163491f19e5e1f0ef07f0..f5b3b2e8ca47116c3d0a076280d21f4379f56a5a 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 dave::/etc/init.d/apache2 start 2> /dev/null
 moon::cat /etc/tnc_config
 carol::cat /etc/tnc_config
index 7cebd7f25714c188fdaeb180dc8d53f5774848e3..1865a1c60eb1dcb5867d6c1d9bf6605f054c4757 100644 (file)
@@ -1,6 +1,6 @@
 moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
index 208f9daa9b7b15d44d64f9d5221739c91c668212..b2b243ba3088f763c06db0e8e87ba54f65d1b2f7 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 moon::cat /etc/tnc_config
 carol::cat /etc/tnc_config
 dave::cat /etc/tnc_config
index 7cebd7f25714c188fdaeb180dc8d53f5774848e3..1865a1c60eb1dcb5867d6c1d9bf6605f054c4757 100644 (file)
@@ -1,6 +1,6 @@
 moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
index 76ad91f98e6449ddc7426db6bed4aa8a642c227d..72c9b16651c554caeb06853294187e4a4a0d8240 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 moon::cat /etc/tnc_config
 carol::cat /etc/tnc_config
 dave::cat /etc/tnc_config
index c166c1706341f7942ff0c6f79e2ca1b1990ed49e..74b902c696c7d00fdcd5a2ba0e6c8f9d43f2f97a 100644 (file)
@@ -1,7 +1,7 @@
 moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
 carol::echo 1 > /proc/sys/net/ipv4/ip_forward
index 58634a86ffb33ec7d2309fb46bd56680d5b8ee3b..8169afab2f48a8f57f386703b1ab02157cb3afae 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 carol::echo 0 > /proc/sys/net/ipv4/ip_forward
 moon::cat /etc/tnc_config
 carol::cat /etc/tnc_config
diff --git a/testing/tests/tnc/tnccs-20-pdp/hosts/moon/etc/init.d/iptables b/testing/tests/tnc/tnccs-20-pdp/hosts/moon/etc/init.d/iptables
deleted file mode 100755 (executable)
index 56587b2..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-opts="start stop reload"
-
-depend() {
-       before net
-       need logger
-}
-
-start() {
-       ebegin "Starting firewall"
-
-       # enable IP forwarding
-       echo 1 > /proc/sys/net/ipv4/ip_forward
-       
-       # default policy is DROP
-       /sbin/iptables -P INPUT DROP
-       /sbin/iptables -P OUTPUT DROP
-       /sbin/iptables -P FORWARD DROP
-
-       # allow esp
-       iptables -A INPUT  -i eth0 -p 50 -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p 50 -j ACCEPT
-
-       # allow IKE
-       iptables -A INPUT  -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
-
-       # allow MobIKE
-       iptables -A INPUT  -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p udp --dport 4500 --sport 4500 -j ACCEPT
-
-       # allow crl fetch from winnetou
-       iptables -A INPUT  -i eth0 -p tcp --sport 80 -s PH_IP_WINNETOU -j ACCEPT
-       iptables -A OUTPUT -o eth0 -p tcp --dport 80 -d PH_IP_WINNETOU -j ACCEPT
-
-       # allow RADIUS protocol with alice
-       iptables -A INPUT  -i eth1 -p udp --sport 1812 -s PH_IP_ALICE -j ACCEPT
-       iptables -A OUTPUT -o eth1 -p udp --dport 1812 -d PH_IP_ALICE -j ACCEPT
-
-       # allow ssh
-       iptables -A INPUT  -p tcp --dport 22 -j ACCEPT
-       iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
-
-       eend $?
-}
-
-stop() {
-       ebegin "Stopping firewall"
-               for a in `cat /proc/net/ip_tables_names`; do
-                       /sbin/iptables -F -t $a
-                       /sbin/iptables -X -t $a
-       
-                       if [ $a == nat ]; then
-                               /sbin/iptables -t nat -P PREROUTING ACCEPT
-                               /sbin/iptables -t nat -P POSTROUTING ACCEPT
-                               /sbin/iptables -t nat -P OUTPUT ACCEPT
-                       elif [ $a == mangle ]; then
-                               /sbin/iptables -t mangle -P PREROUTING ACCEPT
-                               /sbin/iptables -t mangle -P INPUT ACCEPT
-                               /sbin/iptables -t mangle -P FORWARD ACCEPT
-                               /sbin/iptables -t mangle -P OUTPUT ACCEPT
-                               /sbin/iptables -t mangle -P POSTROUTING ACCEPT
-                       elif [ $a == filter ]; then
-                               /sbin/iptables -t filter -P INPUT ACCEPT
-                               /sbin/iptables -t filter -P FORWARD ACCEPT
-                               /sbin/iptables -t filter -P OUTPUT ACCEPT
-                       fi
-               done
-       eend $?
-}
-
-reload() {
-       ebegin "Flushing firewall"
-               for a in `cat /proc/net/ip_tables_names`; do
-                       /sbin/iptables -F -t $a
-                       /sbin/iptables -X -t $a
-               done;
-        eend $?
-       start
-}
-
diff --git a/testing/tests/tnc/tnccs-20-pdp/hosts/moon/etc/iptables.rules b/testing/tests/tnc/tnccs-20-pdp/hosts/moon/etc/iptables.rules
new file mode 100644 (file)
index 0000000..1eb7553
--- /dev/null
@@ -0,0 +1,32 @@
+*filter
+
+# default policy is DROP
+-P INPUT DROP
+-P OUTPUT DROP
+-P FORWARD DROP
+
+# allow esp
+-A INPUT  -i eth0 -p 50 -j ACCEPT
+-A OUTPUT -o eth0 -p 50 -j ACCEPT
+
+# allow IKE
+-A INPUT  -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
+-A OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
+
+# allow MobIKE
+-A INPUT  -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
+-A OUTPUT -o eth0 -p udp --dport 4500 --sport 4500 -j ACCEPT
+
+# allow ssh
+-A INPUT  -p tcp --dport 22 -j ACCEPT
+-A OUTPUT -p tcp --sport 22 -j ACCEPT
+
+# allow crl fetch from winnetou
+-A INPUT  -i eth0 -p tcp --sport 80 -s PH_IP_WINNETOU -j ACCEPT
+-A OUTPUT -o eth0 -p tcp --dport 80 -d PH_IP_WINNETOU -j ACCEPT
+
+# allow RADIUS protocol with alice
+-A INPUT  -i eth1 -p udp --sport 1812 -s PH_IP_ALICE -j ACCEPT
+-A OUTPUT -o eth1 -p udp --dport 1812 -d PH_IP_ALICE -j ACCEPT
+
+COMMIT
index 16218f38578263a0bc57c4c0e1a49551869e7ad4..e7eecd5f44972d49580a97dababf3e387edfe651 100644 (file)
@@ -2,6 +2,6 @@ moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
 alice::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
index 9b9d6b6998a1b10c332c8d41670ea681d89affab..32ed4d8547f61414ed4589df8e84188d3b1d33d5 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 alice::cat /etc/tnc_config
 carol::cat /etc/tnc_config
 dave::cat /etc/tnc_config
index 7cebd7f25714c188fdaeb180dc8d53f5774848e3..1865a1c60eb1dcb5867d6c1d9bf6605f054c4757 100644 (file)
@@ -1,6 +1,6 @@
 moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
index 208f9daa9b7b15d44d64f9d5221739c91c668212..b2b243ba3088f763c06db0e8e87ba54f65d1b2f7 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 moon::cat /etc/tnc_config
 carol::cat /etc/tnc_config
 dave::cat /etc/tnc_config
index 7cebd7f25714c188fdaeb180dc8d53f5774848e3..1865a1c60eb1dcb5867d6c1d9bf6605f054c4757 100644 (file)
@@ -1,6 +1,6 @@
 moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
index c332f131b8f3c5369a802549114c0a1d8a616d6b..cac1cfafc16efe14e091f0b7ce35fddb08d02079 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 moon::cat /etc/tnc_config
 carol::cat /etc/tnc_config
 dave::cat /etc/tnc_config
index 7cebd7f25714c188fdaeb180dc8d53f5774848e3..1865a1c60eb1dcb5867d6c1d9bf6605f054c4757 100644 (file)
@@ -1,6 +1,6 @@
 moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
index 208f9daa9b7b15d44d64f9d5221739c91c668212..b2b243ba3088f763c06db0e8e87ba54f65d1b2f7 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 moon::cat /etc/tnc_config
 carol::cat /etc/tnc_config
 dave::cat /etc/tnc_config
index 7cebd7f25714c188fdaeb180dc8d53f5774848e3..1865a1c60eb1dcb5867d6c1d9bf6605f054c4757 100644 (file)
@@ -1,6 +1,6 @@
 moon::ipsec stop
 carol::ipsec stop
 dave::ipsec stop
-moon::/etc/init.d/iptables stop 2> /dev/null
-carol::/etc/init.d/iptables stop 2> /dev/null
-dave::/etc/init.d/iptables stop 2> /dev/null
+moon::iptables-restore < /etc/iptables.flush
+carol::iptables-restore < /etc/iptables.flush
+dave::iptables-restore < /etc/iptables.flush
index a7a3bf412a73b00e30c1c63e4d6a871b616b1bd5..60775a11eccecf95609152ae8515d759145f6eab 100644 (file)
@@ -1,6 +1,6 @@
-moon::/etc/init.d/iptables start 2> /dev/null
-carol::/etc/init.d/iptables start 2> /dev/null
-dave::/etc/init.d/iptables start 2> /dev/null
+moon::iptables-restore < /etc/iptables.rules
+carol::iptables-restore < /etc/iptables.rules
+dave::iptables-restore < /etc/iptables.rules
 moon::cat /etc/tnc_config
 carol::cat /etc/tnc_config
 dave::cat /etc/tnc_config