mirror of
https://github.com/strongswan/strongswan.git
synced 2025-11-22 00:01:45 -05:00
converted all tnc iptables scenarios
This commit is contained in:
parent
4aa32cc3fe
commit
472a411aa8
@ -1,6 +1,6 @@
|
|||||||
moon::ipsec stop
|
moon::ipsec stop
|
||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
moon::cat /etc/tnc_config
|
moon::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
dave::cat /etc/tnc_config
|
dave::cat /etc/tnc_config
|
||||||
|
|||||||
@ -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
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -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
|
||||||
@ -3,7 +3,7 @@ carol::ipsec stop
|
|||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
alice::killall radiusd
|
alice::killall radiusd
|
||||||
alice::rm /etc/freeradius/sites-enabled/inner-tunnel-second
|
alice::rm /etc/freeradius/sites-enabled/inner-tunnel-second
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/apache2 stop 2> /dev/null
|
dave::/etc/init.d/apache2 stop 2> /dev/null
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/apache2 start 2> /dev/null
|
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::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::cat /etc/freeradius/sites-enabled/inner-tunnel-second
|
||||||
|
|||||||
@ -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
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -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
|
||||||
@ -3,6 +3,6 @@ carol::ipsec stop
|
|||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
alice::killall radiusd
|
alice::killall radiusd
|
||||||
alice::rm /etc/freeradius/sites-enabled/inner-tunnel-second
|
alice::rm /etc/freeradius/sites-enabled/inner-tunnel-second
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
alice::ln -s /etc/freeradius/sites-available/inner-tunnel-second /etc/freeradius/sites-enabled/inner-tunnel-second
|
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::cat /etc/freeradius/sites-enabled/inner-tunnel-second
|
||||||
alice::LEAK_DETECTIVE_DISABLE=1 LOG4CXX_CONFIGURATION=/etc/tnc/log4cxx.properties radiusd
|
alice::LEAK_DETECTIVE_DISABLE=1 LOG4CXX_CONFIGURATION=/etc/tnc/log4cxx.properties radiusd
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::ipsec stop
|
moon::ipsec stop
|
||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
moon::cat /etc/tnc_config
|
moon::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
dave::cat /etc/tnc_config
|
dave::cat /etc/tnc_config
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
moon::ipsec stop
|
moon::ipsec stop
|
||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/apache2 stop 2> /dev/null
|
dave::/etc/init.d/apache2 stop 2> /dev/null
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/apache2 start 2> /dev/null
|
dave::/etc/init.d/apache2 start 2> /dev/null
|
||||||
moon::cat /etc/tnc_config
|
moon::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::ipsec stop
|
moon::ipsec stop
|
||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
moon::cat /etc/tnc_config
|
moon::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
dave::cat /etc/tnc_config
|
dave::cat /etc/tnc_config
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::ipsec stop
|
moon::ipsec stop
|
||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
moon::cat /etc/tnc_config
|
moon::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
dave::cat /etc/tnc_config
|
dave::cat /etc/tnc_config
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
moon::ipsec stop
|
moon::ipsec stop
|
||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
carol::echo 1 > /proc/sys/net/ipv4/ip_forward
|
carol::echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
carol::echo 0 > /proc/sys/net/ipv4/ip_forward
|
carol::echo 0 > /proc/sys/net/ipv4/ip_forward
|
||||||
moon::cat /etc/tnc_config
|
moon::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
|
|||||||
@ -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
|
|
||||||
}
|
|
||||||
|
|
||||||
32
testing/tests/tnc/tnccs-20-pdp/hosts/moon/etc/iptables.rules
Normal file
32
testing/tests/tnc/tnccs-20-pdp/hosts/moon/etc/iptables.rules
Normal file
@ -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
|
||||||
@ -2,6 +2,6 @@ moon::ipsec stop
|
|||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
alice::ipsec stop
|
alice::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
alice::cat /etc/tnc_config
|
alice::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
dave::cat /etc/tnc_config
|
dave::cat /etc/tnc_config
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::ipsec stop
|
moon::ipsec stop
|
||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
moon::cat /etc/tnc_config
|
moon::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
dave::cat /etc/tnc_config
|
dave::cat /etc/tnc_config
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::ipsec stop
|
moon::ipsec stop
|
||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
moon::cat /etc/tnc_config
|
moon::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
dave::cat /etc/tnc_config
|
dave::cat /etc/tnc_config
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::ipsec stop
|
moon::ipsec stop
|
||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
moon::cat /etc/tnc_config
|
moon::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
dave::cat /etc/tnc_config
|
dave::cat /etc/tnc_config
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::ipsec stop
|
moon::ipsec stop
|
||||||
carol::ipsec stop
|
carol::ipsec stop
|
||||||
dave::ipsec stop
|
dave::ipsec stop
|
||||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
dave::/etc/init.d/iptables stop 2> /dev/null
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
moon::/etc/init.d/iptables start 2> /dev/null
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
carol::/etc/init.d/iptables start 2> /dev/null
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::/etc/init.d/iptables start 2> /dev/null
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
moon::cat /etc/tnc_config
|
moon::cat /etc/tnc_config
|
||||||
carol::cat /etc/tnc_config
|
carol::cat /etc/tnc_config
|
||||||
dave::cat /etc/tnc_config
|
dave::cat /etc/tnc_config
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user