upgraded ipv6 scenarios to 5.0.0

This commit is contained in:
Andreas Steffen
2012-05-29 23:40:01 +02:00
parent 53915f14ae
commit 08951eb7a8
121 changed files with 737 additions and 282 deletions
@@ -1,5 +1,7 @@
moon::ipsec status::net-net.*STATE_QUICK_I2.*IPsec SA established::YES
sun::ipsec status::net.net.*STATE_QUICK_R2.*IPsec SA established::YES
moon:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES
sun:: ipsec status 2> /dev/null::net.net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES
moon:: ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES
sun:: ipsec status 2> /dev/null::net.net.*INSTALLED, TUNNEL::YES
alice::ping6 -c 1 -p deadbeef ip6-bob.strongswan.org::64 bytes from ip6-bob.strongswan.org: icmp_seq=1::YES
sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES
sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES
@@ -26,27 +26,16 @@ start() {
/sbin/ip6tables -P FORWARD DROP
# allow esp
ip6tables -A INPUT -i eth0 -p 50 -j ACCEPT
ip6tables -A OUTPUT -o eth0 -p 50 -j ACCEPT
iptables -A INPUT -i eth0 -p 50 -j ACCEPT
iptables -A OUTPUT -o eth0 -p 50 -j ACCEPT
# allow IKE
ip6tables -A INPUT -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
ip6tables -A OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
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
ip6tables -A INPUT -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
ip6tables -A OUTPUT -o eth0 -p udp --dport 4500 --sport 4500 -j ACCEPT
# allow last UDP fragment
ip6tables -A INPUT -i eth0 -p udp -m frag --fraglast -j ACCEPT
# allow ICMPv6 neighbor-solicitations
ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
ip6tables -A OUTPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
# allow ICMPv6 neighbor-advertisements
ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
ip6tables -A OUTPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
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
@@ -56,6 +45,14 @@ start() {
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
# allow ICMPv6 neighbor-solicitations
ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
ip6tables -A OUTPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
# allow ICMPv6 neighbor-advertisements
ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
ip6tables -A OUTPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
# log dropped packets
ip6tables -A INPUT -j LOG --log-prefix " IN: "
ip6tables -A OUTPUT -j LOG --log-prefix " OUT: "
@@ -1,10 +1,7 @@
# /etc/ipsec.conf - strongSwan IPsec configuration file
config setup
strictcrlpolicy=no
crlcheckinterval=180
plutodebug=control
charonstart=no
plutostart=no
conn %default
ikelifetime=60m
@@ -15,10 +12,10 @@ conn %default
conn net-net
left=PH_IP_MOON
leftnexthop=%direct
leftsubnet=fec1::0/16
leftcert=moonCert.pem
[email protected]
leftfirewall=yes
right=PH_IP_SUN
rightsubnet=fec2::0/16
[email protected]
@@ -1,5 +1,6 @@
# /etc/strongswan.conf - strongSwan configuration file
pluto {
load = curl aes des sha1 sha2 md5 pem pkcs1 x509 gmp random hmac kernel-netlink
charon {
load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 revocation hmac stroke kernel-netlink socket-default updown
install_routes = no
}
@@ -26,27 +26,16 @@ start() {
/sbin/ip6tables -P FORWARD DROP
# allow esp
ip6tables -A INPUT -i eth0 -p 50 -j ACCEPT
ip6tables -A OUTPUT -o eth0 -p 50 -j ACCEPT
iptables -A INPUT -i eth0 -p 50 -j ACCEPT
iptables -A OUTPUT -o eth0 -p 50 -j ACCEPT
# allow IKE
ip6tables -A INPUT -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
ip6tables -A OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
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
ip6tables -A INPUT -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
ip6tables -A OUTPUT -o eth0 -p udp --dport 4500 --sport 4500 -j ACCEPT
# allow last UDP fragment
ip6tables -A INPUT -i eth0 -p udp -m frag --fraglast -j ACCEPT
# allow ICMPv6 neighbor-solicitations
ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
ip6tables -A OUTPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
# allow ICMPv6 neighbor-advertisements
ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
ip6tables -A OUTPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
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
@@ -56,6 +45,18 @@ start() {
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
# allow ICMPv6 neighbor-solicitations
ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
ip6tables -A OUTPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
# allow ICMPv6 neighbor-advertisements
ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
ip6tables -A OUTPUT -p icmpv6 --icmpv6-type neighbor-advertisement -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
# log dropped packets
ip6tables -A INPUT -j LOG --log-prefix " IN: "
ip6tables -A OUTPUT -j LOG --log-prefix " OUT: "
@@ -1,10 +1,7 @@
# /etc/ipsec.conf - strongSwan IPsec configuration file
config setup
strictcrlpolicy=no
crlcheckinterval=180
plutodebug=control
charonstart=no
plutostart=no
conn %default
ikelifetime=60m
@@ -15,10 +12,10 @@ conn %default
conn net-net
left=PH_IP_SUN
leftnexthop=%direct
leftsubnet=fec2::0/16
leftcert=sunCert.pem
[email protected]
leftfirewall=yes
right=PH_IP_MOON
rightsubnet=fec1::0/16
[email protected]
@@ -1,5 +1,6 @@
# /etc/strongswan.conf - strongSwan configuration file
pluto {
load = curl aes des sha1 sha2 md5 pem pkcs1 x509 gmp random hmac kernel-netlink
charon {
load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 revocation hmac stroke kernel-netlink socket-default updown
install_routes=no
}
@@ -4,3 +4,5 @@ alice::"ip route del fec2:\:/16 via fec1:\:1"
moon::"ip route del fec2:\:/16 via fec0:\:2"
sun::"ip route del fec1:\:/16 via fec0:\:1"
bob::"ip route del fec1:\:/16 via fec2:\:1"
moon::/etc/init.d/iptables stop 2> /dev/null
sun::/etc/init.d/iptables stop 2> /dev/null
@@ -1,5 +1,5 @@
moon::echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
sun::echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
moon::/etc/init.d/iptables start 2> /dev/null
sun::/etc/init.d/iptables start 2> /dev/null
alice::"ip route add fec2:\:/16 via fec1:\:1"
moon::"ip route add fec2:\:/16 via fec0:\:2"
sun::"ip route add fec1:\:/16 via fec0:\:1"