added new scenarios

This commit is contained in:
Andreas Steffen
2006-10-23 14:49:43 +00:00
parent b9ac0fc6a3
commit 403dc74b9d
28 changed files with 384 additions and 0 deletions
@@ -0,0 +1,7 @@
The roadwarrior <b>alice</b> sitting behind the NAT router <b>moon</b> sets up a
tunnel to the subnet hiding behind the NAT router <b>sun</b>. All IKE and ESP traffic
directed to the router <b>sun</b> is forwarded to the VPN gateway <b>bob</b>
using destination NAT. UDP encapsulation is used to traverse the NAT routers.
<b>leftfirewall=yes</b> automatically inserts iptables-based firewall rules that
let pass the tunneled traffic. In order to test the double NAT-ed IPsec
tunnel <b>alice</b> pings the inner IP address of the router <b>sun</b>.
@@ -0,0 +1,5 @@
alice::ipsec statusall::nat-t.*INSTALLED::YES
bob::ipsec statusall::nat-t.*INSTALLED::YES
alice::ping -c 1 PH_IP_SUN1::64 bytes from PH_IP_SUN1: icmp_seq=1::YES
moon::tcpdump::IP moon.strongswan.org.* > sun.strongswan.org.ipsec-nat-t: UDP::YES
moon::tcpdump::IP sun.strongswan.org.ipsec-nat-t > moon.strongswan.org.*: UDP::YES
@@ -0,0 +1,22 @@
# /etc/ipsec.conf - strongSwan IPsec configuration file
config setup
strictcrlpolicy=no
plutostart=no
conn %default
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
keyexchange=ikev2
conn nat-t
left=%defaultroute
leftcert=aliceCert.pem
[email protected]
leftfirewall=yes
right=PH_IP_SUN
[email protected]
rightsubnet=10.2.0.0/16
auto=add
@@ -0,0 +1,22 @@
# /etc/ipsec.conf - strongSwan IPsec configuration file
config setup
strictcrlpolicy=no
plutostart=no
conn %default
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
keyexchange=ikev2
conn nat-t
left=%defaultroute
leftsubnet=10.2.0.0/16
leftcert=bobCert.pem
[email protected]
leftfirewall=yes
right=%any
rightsubnet=10.1.0.0/16
auto=add
@@ -0,0 +1,9 @@
alice::iptables -v -n -L
bob::iptables -v -n -L
bob::ipsec stop
alice::ipsec stop
alice::/etc/init.d/iptables stop 2> /dev/null
bob::/etc/init.d/iptables stop 2> /dev/null
moon::iptables -t nat -F
sun::iptables -t nat -F
sun::ip route del 10.1.0.0/16 via PH_IP_BOB
@@ -0,0 +1,15 @@
alice::/etc/init.d/iptables start 2> /dev/null
bob::/etc/init.d/iptables start 2> /dev/null
bob::echo 1 > /proc/sys/net/ipv4/ip_forward
moon::echo 1 > /proc/sys/net/ipv4/ip_forward
sun::echo 1 > /proc/sys/net/ipv4/ip_forward
moon::iptables -t nat -A POSTROUTING -o eth0 -s 10.1.0.0/16 -p udp -j SNAT --to-source PH_IP_MOON:1024-1100
moon::iptables -t nat -A POSTROUTING -o eth0 -s 10.1.0.0/16 -p tcp -j SNAT --to-source PH_IP_MOON:2000-2100
sun::iptables -t nat -A POSTROUTING -o eth0 -s 10.2.0.0/16 -p tcp -j SNAT --to-source PH_IP_SUN:2000-2100
sun::iptables -t nat -A PREROUTING -i eth0 -s PH_IP_MOON -p udp -j DNAT --to-destination PH_IP_BOB
sun::ip route add 10.1.0.0/16 via PH_IP_BOB
alice::ipsec start
bob::ipsec start
alice::sleep 2
alice::ipsec up nat-t
alice::sleep 1
@@ -0,0 +1,21 @@
#!/bin/bash
#
# This configuration file provides information on the
# UML instances used for this test
# All UML instances that are required for this test
#
UMLHOSTS="alice moon winnetou sun bob"
# Corresponding block diagram
#
DIAGRAM="a-m-w-s-b.png"
# UML instances on which tcpdump is to be started
#
TCPDUMPHOSTS="moon"
# UML instances on which IPsec is started
# Used for IPsec logging purposes
#
IPSECHOSTS="alice bob"