Revision 0d0dbfa6

View differences:

tests/nat-test/CONFIG
1
#specify GRAPES directory with 32 bit build. Executables are used from here
1 2
export GRAPESDIR=/hosthome/local/git/GRAPES/GRAPES
3

  
4
#specify path to a 32 bit build of libevent2
2 5
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/hosthome/local/git/GRAPES/libevent-2-build/32bit/lib
tests/nat-test/README
1
This directory contains a Netkit (www.netkit.org) laboratory
2
intended to test the NAT capabilities of the ML.
3
See
4
http://wiki.netkit.org/netkit-labs/netkit_introduction/netkit-introduction.pdf
5
for a quick introduction to netkit laboratories.
6

  
7
PREREQUISITES
8
-------------
9

  
10
Download and install Netkit from 
11
http://www.netkit.org
12

  
13
Don't forget to define the netkit environment variables, e.g.
14

  
15
export NETKIT_HOME=$HOME/netkit
16
export MANPATH=:$NETKIT_HOME/man
17
export PATH=$NETKIT_HOME/bin:$PATH
18

  
19

  
20
HOW TO RUN
21
----------
22

  
23
./labrestart.sh
tests/nat-test/lab.conf
2 2
LAB_VERSION=0.1
3 3
LAB_AUTHOR="Csaba Kiraly"
4 4

  
5
peer0[0]="public"
6
nat1[0]="public"
7
nat1[1]="private1"
8
peer1a[0]="private1"
9
peer1b[0]="private1"
5
#STUN server requires 2 IP addresses
6
stunserver[0]=public
7
stunserver[1]=public
10 8

  
11
# Enable the following if you need a gateway towards the host machine or 
12
# the real Internet.
13
# You might need to copy your /etc/resolv.conf into dns/etc/resolv.conf
14
# To have real dns resolution
15
#dns[eth1]=tap,10.0.129.1,10.0.129.3
16
# To have routing towards the rela Internet
17
#probe[eth1]=tap,10.0.129.1,10.0.129.2
9
#a peer with public IP
10
peer0[0]=public
11

  
12
#peers behind a NAT
13
nat1[0]=public
14
nat1[1]=private1
15
peer1a[0]=private1
16
peer1b[0]=private1
17
peer1c[0]=private1
tests/nat-test/lab.dep
1
nat*: stunserver*
2
peer*: nat*
tests/nat-test/labrestart.sh
1
#! /bin/bash
2
# restart some virtual machines of a lab
3
# if no parameters are given the whole lab is restarted
4
# if VM names are given, only those are restarted
5
lcrash -q $@ && lclean $@ && lstart $@ -f
tests/nat-test/labstop.sh
1
#! /bin/bash
2
# stop and cleanup some virtual machines of a lab
3
# if no parameters are given the whole lab stoped
4
# if VM names are given, only those are stopped
5
lcrash -q $@ && lclean $@
tests/nat-test/peer.startup
1
#configure the network interfaces
2
ifconfig eth0 $HOSTNAME up
3
route add default gw nat1priv
tests/nat-test/peer0.startup
1 1
#configure the network interfaces
2 2
ifconfig eth0 $HOSTNAME up
3

  
4
. /hostlab/CONFIG
5

  
6
#start receiver
7
$GRAPESDIR/som/Tests/chunk_delivery_test -r -x stunserver1a
tests/nat-test/peer1a.startup
1 1
#configure the network interfaces
2 2
ifconfig eth0 $HOSTNAME up
3
route add default gw nat1priv
3
route add default gw nat1priv
4

  
5
. /hostlab/CONFIG
6

  
7
#start receiver
8
$GRAPESDIR/som/Tests/chunk_delivery_test -r -x stunserver1a
tests/nat-test/peer1b.startup
1 1
#configure the network interfaces
2 2
ifconfig eth0 $HOSTNAME up
3
route add default gw nat1priv
3
route add default gw nat1priv
4

  
5
. /hostlab/CONFIG
6

  
7
#start sender
8
$GRAPESDIR/som/Tests/chunk_delivery_test -s -x stunserver1a -i peer0
tests/nat-test/peer1c.startup
1
#configure the network interfaces
2
ifconfig eth0 $HOSTNAME up
3
route add default gw nat1priv
4

  
5
. /hostlab/CONFIG
6

  
7
#start sender
8
$GRAPESDIR/som/Tests/chunk_delivery_test -s -x stunserver1a -i peer1a
tests/nat-test/peer1c/README
1
a peer behind a NAT.
2
Another peer is behind the same NAT.
tests/nat-test/shared/etc/hosts
2 2

  
3 3
192.168.1.101	peer1b
4 4

  
5
192.168.1.102	peer1c
6

  
5 7
192.168.1.1	nat1priv
6 8
55.55.55.101	nat1pub
7 9

  
8 10
55.55.55.100	peer0
11

  
12
55.55.55.253	stunserver1a
13
55.55.55.254	stunserver1b
tests/nat-test/stunserver.startup
1
#configure the network interfaces
2
ifconfig eth0 stunserver1a up
3
ifconfig eth1 stunserver1b up
4

  
5
. /hostlab/CONFIG
6

  
7
#start receiver
8
$GRAPESDIR/ml/stun_server/stund/server -v -h stunserver1a -a stunserver1b &
tests/nat-test/stunserver/README
1
a STUN server

Also available in: Unified diff