firewall-enabled ipv6/net2net-ip6-in-ip4-ikev2 scenario
This commit is contained in:
@@ -26,27 +26,16 @@ start() {
|
|||||||
/sbin/ip6tables -P FORWARD DROP
|
/sbin/ip6tables -P FORWARD DROP
|
||||||
|
|
||||||
# allow esp
|
# allow esp
|
||||||
ip6tables -A INPUT -i eth0 -p 50 -j ACCEPT
|
iptables -A INPUT -i eth0 -p 50 -j ACCEPT
|
||||||
ip6tables -A OUTPUT -o eth0 -p 50 -j ACCEPT
|
iptables -A OUTPUT -o eth0 -p 50 -j ACCEPT
|
||||||
|
|
||||||
# allow IKE
|
# allow IKE
|
||||||
ip6tables -A INPUT -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
|
iptables -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 OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
|
||||||
|
|
||||||
# allow MobIKE
|
# allow MobIKE
|
||||||
ip6tables -A INPUT -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
|
iptables -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
|
iptables -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
|
|
||||||
|
|
||||||
# allow crl fetch from winnetou
|
# allow crl fetch from winnetou
|
||||||
iptables -A INPUT -i eth0 -p tcp --sport 80 -s PH_IP_WINNETOU -j ACCEPT
|
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 INPUT -p tcp --dport 22 -j ACCEPT
|
||||||
iptables -A OUTPUT -p tcp --sport 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
|
# log dropped packets
|
||||||
ip6tables -A INPUT -j LOG --log-prefix " IN: "
|
ip6tables -A INPUT -j LOG --log-prefix " IN: "
|
||||||
ip6tables -A OUTPUT -j LOG --log-prefix " OUT: "
|
ip6tables -A OUTPUT -j LOG --log-prefix " OUT: "
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ conn net-net
|
|||||||
leftsubnet=fec1::0/16
|
leftsubnet=fec1::0/16
|
||||||
leftcert=moonCert.pem
|
leftcert=moonCert.pem
|
||||||
[email protected]
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
right=PH_IP_SUN
|
right=PH_IP_SUN
|
||||||
rightsubnet=fec2::0/16
|
rightsubnet=fec2::0/16
|
||||||
[email protected]
|
[email protected]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# /etc/strongswan.conf - strongSwan configuration file
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
charon {
|
charon {
|
||||||
load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random x509 hmac xcbc stroke kernel-netlink
|
load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random x509 hmac xcbc stroke kernel-netlink updown
|
||||||
install_routes = no
|
install_routes = no
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,27 +26,16 @@ start() {
|
|||||||
/sbin/ip6tables -P FORWARD DROP
|
/sbin/ip6tables -P FORWARD DROP
|
||||||
|
|
||||||
# allow esp
|
# allow esp
|
||||||
ip6tables -A INPUT -i eth0 -p 50 -j ACCEPT
|
iptables -A INPUT -i eth0 -p 50 -j ACCEPT
|
||||||
ip6tables -A OUTPUT -o eth0 -p 50 -j ACCEPT
|
iptables -A OUTPUT -o eth0 -p 50 -j ACCEPT
|
||||||
|
|
||||||
# allow IKE
|
# allow IKE
|
||||||
ip6tables -A INPUT -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
|
iptables -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 OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
|
||||||
|
|
||||||
# allow MobIKE
|
# allow MobIKE
|
||||||
ip6tables -A INPUT -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
|
iptables -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
|
iptables -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
|
|
||||||
|
|
||||||
# allow crl fetch from winnetou
|
# allow crl fetch from winnetou
|
||||||
iptables -A INPUT -i eth0 -p tcp --sport 80 -s PH_IP_WINNETOU -j ACCEPT
|
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 INPUT -p tcp --dport 22 -j ACCEPT
|
||||||
iptables -A OUTPUT -p tcp --sport 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
|
# log dropped packets
|
||||||
ip6tables -A INPUT -j LOG --log-prefix " IN: "
|
ip6tables -A INPUT -j LOG --log-prefix " IN: "
|
||||||
ip6tables -A OUTPUT -j LOG --log-prefix " OUT: "
|
ip6tables -A OUTPUT -j LOG --log-prefix " OUT: "
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ conn net-net
|
|||||||
leftsubnet=fec2::0/16
|
leftsubnet=fec2::0/16
|
||||||
leftcert=sunCert.pem
|
leftcert=sunCert.pem
|
||||||
[email protected]
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
right=PH_IP_MOON
|
right=PH_IP_MOON
|
||||||
rightsubnet=fec1::0/16
|
rightsubnet=fec1::0/16
|
||||||
[email protected]
|
[email protected]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# /etc/strongswan.conf - strongSwan configuration file
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
charon {
|
charon {
|
||||||
load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random x509 hmac xcbc stroke kernel-netlink
|
load = curl aes des sha1 sha2 md5 pem pkcs1 gmp random x509 hmac xcbc stroke kernel-netlink updown
|
||||||
install_routes=no
|
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"
|
moon::"ip route del fec2:\:/16 via fec0:\:2"
|
||||||
sun::"ip route del fec1:\:/16 via fec0:\:1"
|
sun::"ip route del fec1:\:/16 via fec0:\:1"
|
||||||
bob::"ip route del fec1:\:/16 via fec2:\: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
|
moon::/etc/init.d/iptables start 2> /dev/null
|
||||||
sun::echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
|
sun::/etc/init.d/iptables start 2> /dev/null
|
||||||
alice::"ip route add fec2:\:/16 via fec1:\:1"
|
alice::"ip route add fec2:\:/16 via fec1:\:1"
|
||||||
moon::"ip route add fec2:\:/16 via fec0:\:2"
|
moon::"ip route add fec2:\:/16 via fec0:\:2"
|
||||||
sun::"ip route add fec1:\:/16 via fec0:\:1"
|
sun::"ip route add fec1:\:/16 via fec0:\:1"
|
||||||
@@ -8,3 +8,4 @@ moon::ipsec start
|
|||||||
sun::ipsec start
|
sun::ipsec start
|
||||||
moon::sleep 2
|
moon::sleep 2
|
||||||
moon::ipsec up net-net
|
moon::ipsec up net-net
|
||||||
|
moon::sleep 1
|
||||||
|
|||||||
Reference in New Issue
Block a user