...
 
Commits (12)
......@@ -8,3 +8,8 @@ netns-bin/netns_run
netlab/bird6/bird*
netlab/bird4/bird*
netlab-int/cf-ospf/__pycache__
netlab-int/tests/__pycache__
netlab-int/.NOTES.md
......@@ -266,14 +266,14 @@ EOF
cat <<EOF >> rc/rc-loc-at$T
cd /tmp/bird
\$AUTOCONF
#./configure
./configure --enable-debug
./configure --sysconfdir=/etc --with-runtimedir=/run
#./configure --enable-debug
#sed -e 's/-g -O2/-g3 -O0/' -i obj/Rules
\$MAKE
\$MAKE install
PATH=\$PATH:/usr/local/sbin
ulimit -c unlimited
bird -d -c /etc/bird.conf &
bird
EOF
done
......
......@@ -120,6 +120,28 @@ protocol ospf {
}
EOF
cf dL-4 -- cat <<EOF
protocol bgp {
local 192.168.225.162 as 65123;
neighbor 192.168.192.1 as 65534;
import all;
export none;
table bt;
igp table master;
}
EOF
cf dL-6 -- cat <<EOF
protocol bgp {
local 2001:1488:a001::225:162 as 65123;
neighbor 2001:1488:a001::1 as 65534;
import all;
export none;
table bt;
igp table master;
}
EOF
for T in {dL,dR}; do
cf $T-4 -- cat <<EOF
template bgp bc {
......@@ -133,7 +155,6 @@ template bgp bc {
EOF
cf $T-6 -- cat <<EOF
table bt;
template bgp bc {
local ${IPA[$T-6]} as 65123;
import all;
......@@ -152,22 +173,12 @@ for M in ${MACH[@]}; do
cf $D-4 -- cat <<EOF
protocol bgp from bc {
neighbor ${IPA[$M-4]} as 65123;
import all;
export all;
table bt;
igp table master;
next hop self;
}
EOF
cf $D-6 -- cat <<EOF
protocol bgp from bc {
neighbor ${IPA[$M-6]} as 65123;
import all;
export all;
table bt;
igp table master;
next hop self;
}
EOF
......@@ -225,25 +236,25 @@ EOF
cat <<'EOF' >> rc/rc-loc-at$T
cd /tmp/bird4
$AUTOCONF
./configure --with-suffix=4
./configure --sysconfdir=/etc --with-runtimedir=/run --with-suffix=4
#./configure --enable-debug
#sed -e 's/-g -O2/-g3 -O0/' -i obj/Rules
$MAKE
$MAKE install
PATH=$PATH:/usr/local/sbin
ulimit -c unlimited
bird4 -c /etc/bird4.conf
bird4
cd /tmp/bird6
$AUTOCONF
./configure --enable-ipv6 --with-suffix=6
./configure --sysconfdir=/etc --with-runtimedir=/run --enable-ipv6 --with-suffix=6
#./configure --enable-debug
#sed -e 's/-g -O2/-g3 -O0/' -i obj/Rules
$MAKE
$MAKE install
PATH=$PATH:/usr/local/sbin
ulimit -c unlimited
bird6 -c /etc/bird6.conf
bird6
EOF
done
......
NETLAB_NODES="m1 m2 m3 m4"
netlab_init
if_dummy m1 ve0 192.168.1 2001:db8:01:1
if_dummy m2 ve0 192.168.2 2001:db8:02:1
if_dummy m3 ve0 192.168.3 2001:db8:03:1
if_dummy m4 ve0 192.168.4 2001:db8:04:1
if_veth m1 ve1 m2 ve2 192.168.11 2001:db8:11:1
if_veth m2 ve1 m3 ve2 192.168.12 2001:db8:12:1
if_veth m3 ve1 m4 ve2 192.168.13 2001:db8:13:1
if_veth m4 ve1 m1 ve2 192.168.14 2001:db8:14:1
netlab_start
NETLAB_NODES="m1 m2 m3 m4"
netlab_init
if_dummy m1 ve0 192.168.1 2001:db8:01:1
if_dummy m2 ve0 192.168.2 2001:db8:02:1
if_dummy m3 ve0 192.168.3 2001:db8:03:1
if_dummy m4 ve0 192.168.4 2001:db8:04:1
if_veth m1 ve1 m2 ve2 192.168.11
if_veth m2 ve1 m3 ve2 192.168.12
if_veth m3 ve1 m4 ve2 192.168.13
if_veth m4 ve1 m1 ve2 192.168.14
netlab_start
NETLAB_NODES="m1 m2 m3 m4"
netlab_init
vrf m1 vrf1 100
vrf m1 vrf2 200
vrf m1 vrf3 300
vrf m2 vrf0 100
vrf m3 vrf0 100
vrf m4 vrf0 100
if_dummy m1/vrf1 vd1 10.1.1 2001:db8:1:1
if_dummy m1/vrf2 vd2 10.1.1 2001:db8:1:1
if_dummy m1/vrf3 vd3 10.1.1 2001:db8:1:1
if_dummy m2/vrf0 ve0 10.5.1.2/24 2001:db8:5:1::2/64
if_dummy m3/vrf0 ve0 10.5.1.3/24 2001:db8:5:1::3/64
if_dummy m4/vrf0 ve0 10.5.1.4/24 2001:db8:5:1::4/64
if_veth m1/vrf1 ve1 m2/vrf0 ve1 10.0.1 2001:db8:0:1
if_veth m1/vrf2 ve2 m3/vrf0 ve1 10.0.2 2001:db8:0:2
if_veth m1/vrf3 ve3 m4/vrf0 ve1 10.0.3 2001:db8:0:3
netlab_start
BIRD binaries should be copied here:
bird
birdc
if [ -f $COMMON/bird ]
then
ln -s $COMMON/bird bird
ln -s $COMMON/birdc birdc
ln -s $CONFIG/bird_$1.conf bird.conf
fi
sysctl net.ipv4.ip_forward=1
sysctl net.ipv4.tcp_l3mdev_accept=1
sysctl net.ipv6.conf.all.forwarding=1
if [ -f /proc/sys/net/mpls/platform_labels ]
then
sysctl net.mpls.platform_labels=1024
fi
ulimit -c unlimited
./bird -l
#./bird -c bird.conf -s bird.ctl
if [ -S bird.ctl ]
then ./birdc -l down
fi
NETLAB_NODES="m1 m2 m3 m4"
netlab_init
if_dummy $m1 ve0 10.1.1 2001:db8:1:1
if_dummy $m2 ve0 10.2.1 2001:db8:2:1
if_dummy $m3 ve0 10.3.1 2001:db8:3:1
if_dummy $m4 ve0 10.4.1 2001:db8:4:1
if_veth $m1 ve1 $m2 ve2 10.0.1 2001:db8:0:1
if_veth $m2 ve1 $m3 ve2 10.0.2 2001:db8:0:2
if_veth $m3 ve1 $m4 ve2 10.0.3 2001:db8:0:3
if_veth $m4 ve1 $m1 ve2 10.0.4 2001:db8:0:4
# sleep 2
netlab_start
NETLAB_NODES="m1 m2 m3 m4"
netlab_init
if_dummy $m1 ve0 10.1.1 2001:db8:1:1
if_dummy $m2 ve0 10.2.1 2001:db8:2:1
if_dummy $m3 ve0 10.3.1 2001:db8:3:1
if_dummy $m4 ve0 10.4.1 2001:db8:4:1
if_veth $m1 ve1 $m2 ve2 10.0.1
if_veth $m2 ve1 $m3 ve2 10.0.2
if_veth $m3 ve1 $m4 ve2 10.0.3
if_veth $m4 ve1 $m1 ve2 10.0.4
# sleep 2
netlab_start
NETLAB_NODES="m1 m2 m3 m4"
netlab_init
if_dummy $m1 ve0 10.1.1 2001:db8:1:1
if_dummy $m2 ve0 10.2.1 2001:db8:2:1
if_dummy $m3 ve0 10.3.1 2001:db8:3:1
if_dummy $m4 ve0 10.4.1 2001:db8:4:1
if_veth $m1 ve1 $m2 ve2 10.0.1
if_veth $m2 ve1 $m3 ve2 10.0.2
if_veth $m3 ve1 $m4 ve2 10.0.3
if_veth $m4 ve1 $m1 ve2 10.0.4
# sleep 2
netlab_start
NETLAB_NODES="m1 m2 m3 m4 m5"
netlab_init
vrf $m1 vrf1 100
vrf $m1 vrf2 200
if_dummy $m1/vrf1 vd1 10.1.1 2001:db8:1:1
if_dummy $m1/vrf2 vd2 10.1.1 2001:db8:1:1
if_dummy $m2 ve0 10.2.1.1/24 2001:db8:2:1::1/64
if_dummy $m3 ve0 10.3.1.1/24 2001:db8:3:1::1/64
if_dummy $m4 ve0 10.2.1.2/24 2001:db8:2:1::2/64
if_dummy $m5 ve0 10.3.1.2/24 2001:db8:3:1::2/64
if_veth $m1/vrf1 ve1 $m2 ve2 10.0.1 2001:db8:0:1
if_veth $m2 ve1 $m3 ve2 10.0.2 2001:db8:0:2
if_veth $m3 ve1 $m1/vrf1 ve2 10.0.3 2001:db8:0:3
if_veth $m1/vrf2 ve3 $m4 ve2 10.0.1 2001:db8:0:1
if_veth $m4 ve1 $m5 ve2 10.0.2 2001:db8:0:2
if_veth $m5 ve1 $m1/vrf2 ve4 10.0.3 2001:db8:0:3
# sleep 2
netlab_start
BIRD binaries should be copied here, with 4/6 suffix:
bird4
bird6
birdc4
birdc6
if [ -f $COMMON/bird4 ]
then
ln -s $COMMON/bird4 bird4
ln -s $COMMON/birdc4 birdc4
ln -s $CONFIG/bird4_$1.conf bird4.conf
fi
if [ -f $COMMON/bird6 ]
then
ln -s $COMMON/bird6 bird6
ln -s $COMMON/birdc6 birdc6
ln -s $CONFIG/bird6_$1.conf bird6.conf
fi
sysctl net.ipv4.ip_forward=1
sysctl net.ipv4.tcp_l3mdev_accept=1
sysctl net.ipv6.conf.all.forwarding=1
ulimit -c unlimited
./bird4 -l -c bird4.conf
./bird6 -l
# valgrind --log-file=valgrind4.log --leak-check=full --tool=memcheck --time-stamp=yes --leak-resolution=high --num-callers=40 ./bird4 -l -d -c bird4.conf &
# valgrind --log-file=valgrind6.log --leak-check=full --tool=memcheck --time-stamp=yes --leak-resolution=high --num-callers=40 ./bird6 -l -d -d &
# valgrind --track-origins=yes --log-file=valgrind4.log --leak-check=full --tool=memcheck --time-stamp=yes --leak-resolution=high --num-callers=40 ./bird4 -l -d -c bird4.conf &
# valgrind --track-origins=yes --log-file=valgrind6.log --leak-check=full --tool=memcheck --time-stamp=yes --leak-resolution=high --num-callers=40 ./bird6 -l -d &
if [ -S bird4.ctl -o -S bird.ctl ]
then ./birdc4 -l down
fi
if [ -S bird6.ctl ]
then ./birdc6 -l down
fi
......@@ -7,14 +7,17 @@ export CONFIG="../config"
function netlab_init_node()
{
N=$1
ip netns add $N
echo Preparing $N
mkdir $N
touch $N/netns
netns_new sleep 30d &
PID=$!
eval $N=$PID
echo $PID > $N.pid
sleep .1
ip netns exec $N ip -4 rule add l3mdev priority 1000
ip netns exec $N ip -6 rule add l3mdev priority 1000
netns_run $PID ip -4 rule add l3mdev priority 1000
netns_run $PID ip -6 rule add l3mdev priority 1000
}
......@@ -31,16 +34,18 @@ function netlab_init()
function netlab_start_node()
{
N=$1
echo Starting $N
PID=${!N}
echo Starting $N
mkdir $N
cd $N
if [ -f $CONFIG/$N.start ]
then ip netns exec $N bash $CONFIG/$N.start $N
then netns_run $PID bash $CONFIG/$N.start $N
fi
if [ -f $COMMON/common.start ]
then ip netns exec $N bash $COMMON/common.start $N
then netns_run $PID bash $COMMON/common.start $N
fi
cd ..
......@@ -50,23 +55,26 @@ function netlab_start_node()
function netlab_stop_node()
{
N=$1
PID=$2
echo Stopping $N
cd $N
if [ -f $COMMON/common.stop ]
then ip netns exec $N bash $COMMON/common.stop $N
then netns_run $PID bash $COMMON/common.stop $N
fi
if [ -f $CONFIG/$N.stop ]
then ip netns exec $N bash $CONFIG/$N.stop $N
then netns_run $PID bash $CONFIG/$N.stop $N
fi
cd ..
rm -rf $N
echo
}
kill $PID
rm $N.pid
}
function netlab_start()
{
......@@ -77,36 +85,34 @@ function netlab_start()
function netlab_stop()
{
for N in */netns
do
netlab_stop_node ${N%/netns}
ip netns del ${N%/netns}
for N in *.pid
do netlab_stop_node ${N%.pid} $(cat $N)
done
}
function if_dummy()
{
NS=${1%%/*}
IF=$2
ip link add name $IF netns $NS type dummy
if [[ $1 == */* ]]; then ip netns exec $NS ip link set $IF vrf ${1##*/} ; fi
if [[ $1 == */* ]]; then netns_run $NS ip link set $IF vrf ${1##*/} ; fi
ip netns exec $NS ip link set $IF up
netns_run $NS ip link set $IF up
if [[ $3 == */* ]]
then ip netns exec $NS ip addr add $3 dev $IF
else ip netns exec $NS ip addr add "${3}.1/24" dev $IF
then netns_run $NS ip addr add $3 dev $IF
else netns_run $NS ip addr add "${3}.1/24" dev $IF
fi
if [[ $4 == */* ]]
then ip netns exec $NS ip addr add $4 dev $IF
else ip netns exec $NS ip addr add "${4}::1/64" dev $IF
then netns_run $NS ip addr add $4 dev $IF
else netns_run $NS ip addr add "${4}::1/64" dev $IF
fi
}
function if_veth()
{
NS1=${1%%/*}
......@@ -115,18 +121,18 @@ function if_veth()
IF2=$4
ip link add name $IF1 netns $NS1 type veth peer name $IF2 netns $NS2
if [[ $1 == */* ]]; then ip netns exec $NS1 ip link set $IF1 vrf ${1##*/} ; fi
if [[ $3 == */* ]]; then ip netns exec $NS2 ip link set $IF2 vrf ${3##*/} ; fi
if [[ $1 == */* ]]; then netns_run $NS1 ip link set $IF1 vrf ${1##*/} ; fi
if [[ $3 == */* ]]; then netns_run $NS2 ip link set $IF2 vrf ${3##*/} ; fi
ip netns exec $NS1 ip link set $IF1 up
ip netns exec $NS2 ip link set $IF2 up
ip netns exec $NS1 ip addr add ${5}.1/24 dev $IF1
ip netns exec $NS2 ip addr add ${5}.2/24 dev $IF2
netns_run $NS1 ip link set $IF1 up
netns_run $NS2 ip link set $IF2 up
netns_run $NS1 ip addr add ${5}.1/24 dev $IF1
netns_run $NS2 ip addr add ${5}.2/24 dev $IF2
if [ -n "$6" ]
then
ip netns exec $NS1 ip addr add ${6}::1/64 dev $IF1
ip netns exec $NS2 ip addr add ${6}::2/64 dev $IF2
netns_run $NS1 ip addr add ${6}::1/64 dev $IF1
netns_run $NS2 ip addr add ${6}::2/64 dev $IF2
fi
}
......@@ -136,5 +142,5 @@ function vrf()
IF=$2
ip link add name $IF netns $NS type vrf table $3
ip netns exec $NS ip link set $IF up
netns_run $NS ip link set $IF up
}
......@@ -3,16 +3,14 @@ NETLAB_NODES="m1 m2 m3 m4"
netlab_init
if_dummy $m1 ve0 10.1.1 2001:db8:1:1
if_dummy $m2 ve0 10.2.1 2001:db8:2:1
if_dummy $m3 ve0 10.3.1 2001:db8:3:1
if_dummy $m4 ve0 10.4.1 2001:db8:4:1
if_dummy m1 ve0 192.168.1 2001:db8:01:1
if_dummy m2 ve0 192.168.2 2001:db8:02:1
if_dummy m3 ve0 192.168.3 2001:db8:03:1
if_dummy m4 ve0 192.168.4 2001:db8:04:1
if_veth $m1 ve1 $m2 ve2 10.0.1 2001:db8:0:1
if_veth $m2 ve1 $m3 ve2 10.0.2 2001:db8:0:2
if_veth $m3 ve1 $m4 ve2 10.0.3 2001:db8:0:3
if_veth $m4 ve1 $m1 ve2 10.0.4 2001:db8:0:4
# sleep 2
if_veth m1 ve1 m2 ve2 192.168.11 2001:db8:11:1
if_veth m2 ve1 m3 ve2 192.168.12 2001:db8:12:1
if_veth m3 ve1 m4 ve2 192.168.13 2001:db8:13:1
if_veth m4 ve1 m1 ve2 192.168.14 2001:db8:14:1
netlab_start
......@@ -3,16 +3,14 @@ NETLAB_NODES="m1 m2 m3 m4"
netlab_init
if_dummy $m1 ve0 10.1.1 2001:db8:1:1
if_dummy $m2 ve0 10.2.1 2001:db8:2:1
if_dummy $m3 ve0 10.3.1 2001:db8:3:1
if_dummy $m4 ve0 10.4.1 2001:db8:4:1
if_dummy m1 ve0 192.168.1 2001:db8:01:1
if_dummy m2 ve0 192.168.2 2001:db8:02:1
if_dummy m3 ve0 192.168.3 2001:db8:03:1
if_dummy m4 ve0 192.168.4 2001:db8:04:1
if_veth $m1 ve1 $m2 ve2 10.0.1
if_veth $m2 ve1 $m3 ve2 10.0.2
if_veth $m3 ve1 $m4 ve2 10.0.3
if_veth $m4 ve1 $m1 ve2 10.0.4
# sleep 2
if_veth m1 ve1 m2 ve2 192.168.11
if_veth m2 ve1 m3 ve2 192.168.12
if_veth m3 ve1 m4 ve2 192.168.13
if_veth m4 ve1 m1 ve2 192.168.14
netlab_start
log "bird.log" all;
# debug protocols all;
router id 192.168.1.1;
ipv4 table master4;
ipv6 table master6;
protocol device {
scan time 10;
}
protocol kernel kernel4 {
scan time 20;
# metric 64;
# disabled;
ipv4 {
# export all;
export where source = RTS_OSPF;
};
}
protocol kernel kernel6 {
scan time 20;
# metric 64;
# disabled;
ipv6 {
# export all;
export where source = RTS_OSPF;
};
}
protocol static static4 {
ipv4;
route 10.10.0.0/24 via 192.168.1.2;
route 10.10.1.0/24 via 192.168.1.2 { bgp_large_community.add((10,20,30)); bgp_large_community.add((10,(20*3),10)); };
}
protocol static static6 {
ipv6;
route 2001:db8:10:10::/64 via 2001:db8:1:1::10;
route 2001:db8:10:11::/64 via 2001:db8:1:1::10;
# route 2001:db8:1:1::/64 via fe80::ec9b:67ff:fe60:fd5d % ve1;
}
protocol ospf v3 ospf4 {
ecmp;
ipv4 {
import all;
export where source = RTS_STATIC;
};
area 0 {
interface "ve0" { stub; };
interface "ve1" { hello 5; wait 10; };
};
}
protocol ospf v3 ospf6 {
ecmp;
ipv6 {
import all;
export where source = RTS_STATIC;
};
area 0 {
interface "ve0" { stub; };
interface "ve1" { hello 5; wait 10; };
};
}
log "bird.log" all;
# debug protocols all;
router id 192.168.2.1;
ipv4 table master4;
ipv6 table master6;
protocol device {
scan time 10;
}
protocol kernel kernel4 {
scan time 20;
# disabled;
ipv4 {
# export all;
export where source = RTS_OSPF;
};
}
protocol kernel kernel6 {
scan time 20;
# disabled;
ipv6 {
# export all;
export where source = RTS_OSPF;
};
}
protocol static static4 {
ipv4;
route 10.50.0.0/24 via 192.168.2.2;
route 10.50.1.0/24 via 192.168.2.2;
route 10.20.0.0/24 via 192.168.2.2;
# route 10.20.1.0/24 via 192.168.2.2 mpls 200;
}
protocol static static6 {
ipv6;
route 2001:db8:50:1::/64 via 2001:db8:2:1::10;
route 2001:db8:50:2::/64 via 2001:db8:2:1::10;
route 2001:db8:20:10::/64 via 2001:db8:2:1::10;
# route 2001:db8:20:10::/64 via 192.168.2.2 mpls 200/200;
# route 2001:db8:20:11::/64 via 2001:db8:2:1::10 mpls 200/200;
}
protocol ospf v3 ospf4 {
# ecmp;
ipv4 {
import all;
export where source = RTS_STATIC;
};
area 0 {
stubnet 192.168.120.0/24 { cost 100; };
stubnet 192.168.220.0/32 { cost 100; };
interface "ve0" { stub; };
interface "ve1" { hello 5; wait 10; };
};
}
protocol ospf v3 ospf6 {
# ecmp;
ipv6 {
import all;
export where source = RTS_STATIC;
};
area 0 {
interface "ve0" { stub; };
interface "ve1" { hello 5; wait 10; };
};
}
log "bird.log" all;
# debug protocols all;
router id 192.168.3.1;
ipv4 table master4;
ipv6 table master6;
protocol device {
scan time 10;
}
protocol kernel kernel4 {
scan time 20;
# disabled;
ipv4 {
# export all;
export where source = RTS_OSPF;
};
}
protocol kernel kernel6 {
scan time 20;
# disabled;
ipv6 {
# export all;
export where source = RTS_OSPF;
};
}
protocol static static4 {
ipv4;
route 10.30.0.0/24 via 192.168.3.2;
# route 10.30.1.0/24 via 192.168.3.2 mpls 300;
}
protocol static static6 {
ipv6;
route 2001:db8:30:10::/64 via 2001:db8:3:1::10;
# route 2001:db8:30:11::/64 via 2001:db8:3:1::10 mpls 300/300;
}
protocol ospf v3 ospf4 {
# ecmp;
ipv4 {
import all;
export where source = RTS_STATIC;
};
area 0 {
stubnet 192.168.120.0/24 { cost 400; };
stubnet 192.168.220.0/32 { cost 10; };
interface "ve0" { stub; };
interface "ve1" { hello 5; wait 10; };
};
}
protocol ospf v3 ospf6 {
# ecmp;
ipv6 {
import all;
export where source = RTS_STATIC;
};
area 0 {
interface "ve0" { stub; };
interface "ve1" { hello 5; wait 10; };
};
}
log "bird.log" all;
# debug protocols all;
router id 192.168.4.1;
ipv4 table master4;
ipv6 table master6;
protocol device {
scan time 10;
}
protocol kernel kernel4 {
scan time 20;
# disabled;
ipv4 {
# export all;
export where source = RTS_OSPF;
};
}
protocol kernel kernel6 {
scan time 20;
# disabled;
ipv6 {
# export all;
export where source = RTS_OSPF;
};
}
protocol static static4 {
ipv4;
route 10.50.0.0/24 via 192.168.4.2 { bgp_local_pref = 500; };
route 10.50.1.0/24 via 192.168.4.2 { bgp_local_pref = 500; };
route 10.40.0.0/24 via 192.168.4.2 { bgp_local_pref = 500; };
route 10.40.1.0/24 via 192.168.4.2 mpls 400 { bgp_local_pref = 500; };
}
protocol static static4x {
ipv4;
disabled;
# route 192.168.2.0/24 via 192.168.4.2 mpls 20;
# route 192.168.3.0/24 via 192.168.4.2 mpls 30;
}
protocol static static6 {
ipv6;
route 2001:db8:50:1::/64 via 2001:db8:4:1::10;
route 2001:db8:50:2::/64 via 2001:db8:4:1::10;
route 2001:db8:40:10::/64 via 2001:db8:4:1::10;
# route 2001:db8:40:11::/64 via 2001:db8:4:1::10 mpls 400/400;
}
protocol ospf v3 ospf4 {
# ecmp;
ipv4 {
import all;
export where source = RTS_STATIC;
};
area 0 {
stubnet 192.168.120.0/24 { cost 10; };
stubnet 192.168.220.0/32 { cost 400; };
interface "ve0" { stub; };
interface "ve1" { hello 5; wait 10; };
};
}
protocol ospf v3 ospf6 {
# ecmp;
ipv6 {
import all;
export where source = RTS_STATIC;
};
area 0 {
interface "ve0" { stub; };
interface "ve1" { hello 5; wait 10; };
};
}
......@@ -8,9 +8,11 @@ if_dummy m2 ve0 192.168.2 2001:db8:02:1
if_dummy m3 ve0 192.168.3 2001:db8:03:1
if_dummy m4 ve0 192.168.4 2001:db8:04:1
if_veth m1 ve1 m2 ve2 192.168.11
if_veth m2 ve1 m3 ve2 192.168.12
if_veth m3 ve1 m4 ve2 192.168.13
if_veth m4 ve1 m1 ve2 192.168.14
if_net net1
if_link m1 ve1 net1 192.168.11.1
if_link m2 ve1 net1 192.168.11.2
if_link m3 ve1 net1 192.168.11.3
if_link m4 ve1 net1 192.168.11.4
netlab_start
192.168.1.0/24 dev ve0 proto kernel scope link src 192.168.1.1
192.168.1.0/24 dev ve0 proto bird scope link metric 32
192.168.2.0/24 via 192.168.11.2 dev ve1 proto bird metric 32
192.168.3.0/24 via 192.168.11.3 dev ve1 proto bird metric 32
192.168.4.0/24 via 192.168.11.4 dev ve1 proto bird metric 32
192.168.11.0/24 dev ve1 proto kernel scope link src 192.168.11.1
192.168.11.0/24 dev ve1 proto bird scope link metric 32
192.168.120.0/24 via 192.168.11.4 dev ve1 proto bird metric 32
192.168.220.0 via 192.168.11.3 dev ve1 proto bird metric 32
192.168.1.0/24 via 192.168.11.1 dev ve1 proto bird metric 32
192.168.2.0/24 dev ve0 proto kernel scope link src 192.168.2.1
192.168.2.0/24 dev ve0 proto bird scope link metric 32
192.168.3.0/24 via 192.168.11.3 dev ve1 proto bird metric 32
192.168.4.0/24 via 192.168.11.4 dev ve1 proto bird metric 32
192.168.11.0/24 dev ve1 proto kernel scope link src 192.168.11.2
192.168.11.0/24 dev ve1 proto bird scope link metric 32
192.168.120.0/24 via 192.168.11.4 dev ve1 proto bird metric 32
192.168.220.0 via 192.168.11.3 dev ve1 proto bird metric 32
192.168.1.0/24 via 192.168.11.1 dev ve1 proto bird metric 32
192.168.2.0/24 via 192.168.11.2 dev ve1 proto bird metric 32
192.168.3.0/24 dev ve0 proto kernel scope link src 192.168.3.1
192.168.3.0/24 dev ve0 proto bird scope link metric 32
192.168.4.0/24 via 192.168.11.4 dev ve1 proto bird metric 32
192.168.11.0/24 dev ve1 proto kernel scope link src 192.168.11.3
192.168.11.0/24 dev ve1 proto bird scope link metric 32
192.168.120.0/24 via 192.168.11.4 dev ve1 proto bird metric 32
192.168.1.0/24 via 192.168.11.1 dev ve1 proto bird metric 32
192.168.2.0/24 via 192.168.11.2 dev ve1 proto bird metric 32
192.168.3.0/24 via 192.168.11.3 dev ve1 proto bird metric 32
192.168.4.0/24 dev ve0 proto kernel scope link src 192.168.4.1
192.168.4.0/24 dev ve0 proto bird scope link metric 32
192.168.11.0/24 dev ve1 proto kernel scope link src 192.168.11.4
192.168.11.0/24 dev ve1 proto bird scope link metric 32
192.168.220.0 via 192.168.11.3 dev ve1 proto bird metric 32
import tests.kernel as tk
def test_wait():
"""Wait for convergence"""
tk.wait(40)
def test_krt_routes():
"""Test kernel routes"""
tk.test_krt_routes('krt')
......@@ -3,16 +3,14 @@ NETLAB_NODES="m1 m2 m3 m4"
netlab_init
if_dummy $m1 ve0 10.1.1 2001:db8:1:1
if_dummy $m2 ve0 10.2.1 2001:db8:2:1
if_dummy $m3 ve0 10.3.1 2001:db8:3:1
if_dummy $m4 ve0 10.4.1 2001:db8:4:1
if_dummy m1 ve0 192.168.1 2001:db8:01:1
if_dummy m2 ve0 192.168.2 2001:db8:02:1
if_dummy m3 ve0 192.168.3 2001:db8:03:1
if_dummy m4 ve0 192.168.4 2001:db8:04:1
if_veth $m1 ve1 $m2 ve2 10.0.1
if_veth $m2 ve1 $m3 ve2 10.0.2
if_veth $m3 ve1 $m4 ve2 10.0.3
if_veth $m4 ve1 $m1 ve2 10.0.4
# sleep 2
if_veth m1 ve1 m2 ve2 192.168.11
if_veth m2 ve1 m3 ve2 192.168.12
if_veth m3 ve1 m4 ve2 192.168.13
if_veth m4 ve1 m1 ve2 192.168.14
netlab_start
192.168.1.0/24 dev ve0 proto kernel scope link src 192.168.1.1
192.168.1.0/24 dev ve0 proto bird scope link metric 32
192.168.2.0/24 via 192.168.11.2 dev ve1 proto bird metric 32
192.168.3.0/24 proto bird metric 32
nexthop via 192.168.11.2 dev ve1 weight 1
nexthop via 192.168.14.1 dev ve2 weight 1
192.168.4.0/24 via 192.168.14.1 dev ve2 proto bird metric 32
192.168.11.0/24 dev ve1 proto kernel scope link src 192.168.11.1
192.168.11.0/24 dev ve1 proto bird scope link metric 32
192.168.12.0/24 via 192.168.11.2 dev ve1 proto bird metric 32
192.168.13.0/24 via 192.168.14.1 dev ve2 proto bird metric 32
192.168.14.0/24 dev ve2 proto kernel scope link src 192.168.14.2
192.168.14.0/24 dev ve2 proto bird scope link metric 32
192.168.120.0/24 via 192.168.14.1 dev ve2 proto bird metric 32
192.168.220.0 proto bird metric 32
nexthop via 192.168.11.2 dev ve1 weight 1
nexthop via 192.168.14.1 dev ve2 weight 1
192.168.1.0/24 via 192.168.11.1 dev ve2 proto bird metric 32
192.168.2.0/24 dev ve0 proto kernel scope link src 192.168.2.1
192.168.2.0/24 dev ve0 proto bird scope link metric 32
192.168.3.0/24 via 192.168.12.2 dev ve1 proto bird metric 32
192.168.4.0/24 proto bird metric 32
nexthop via 192.168.11.1 dev ve2 weight 1
nexthop via 192.168.12.2 dev ve1 weight 1
192.168.11.0/24 dev ve2 proto kernel scope link src 192.168.11.2
192.168.11.0/24 dev ve2 proto bird scope link metric 32
192.168.12.0/24 dev ve1 proto kernel scope link src 192.168.12.1
192.168.12.0/24 dev ve1 proto bird scope link metric 32
192.168.13.0/24 via 192.168.12.2 dev ve1 proto bird metric 32
192.168.14.0/24 via 192.168.11.1 dev ve2 proto bird metric 32
192.168.120.0/24 proto bird metric 32
nexthop via 192.168.11.1 dev ve2 weight 1
nexthop via 192.168.12.2 dev ve1 weight 1
192.168.220.0 via 192.168.12.2 dev ve1 proto bird metric 32
192.168.1.0/24 proto bird metric 32
nexthop via 192.168.12.1 dev ve2 weight 1
nexthop via 192.168.13.2 dev ve1 weight 1
192.168.2.0/24 via 192.168.12.1 dev ve2 proto bird metric 32
192.168.3.0/24 dev ve0 proto kernel scope link src 192.168.3.1
192.168.3.0/24 dev ve0 proto bird scope link metric 32
192.168.4.0/24 via 192.168.13.2 dev ve1 proto bird metric 32
192.168.11.0/24 via 192.168.12.1 dev ve2 proto bird metric 32
192.168.12.0/24 dev ve2 proto kernel scope link src 192.168.12.2
192.168.12.0/24 dev ve2 proto bird scope link metric 32
192.168.13.0/24 dev ve1 proto kernel scope link src 192.168.13.1
192.168.13.0/24 dev ve1 proto bird scope link metric 32
192.168.14.0/24 via 192.168.13.2 dev ve1 proto bird metric 32
192.168.120.0/24 via 192.168.13.2 dev ve1 proto bird metric 32
192.168.1.0/24 via 192.168.14.2 dev ve1 proto bird metric 32
192.168.2.0/24 proto bird metric 32
nexthop via 192.168.13.1 dev ve2 weight 1
nexthop via 192.168.14.2 dev ve1 weight 1
192.168.3.0/24 via 192.168.13.1 dev ve2 proto bird metric 32
192.168.4.0/24 dev ve0 proto kernel scope link src 192.168.4.1
192.168.4.0/24 dev ve0 proto bird scope link metric 32
192.168.11.0/24 via 192.168.14.2 dev ve1 proto bird metric 32
192.168.12.0/24 via 192.168.13.1 dev ve2 proto bird metric 32
192.168.13.0/24 dev ve2 proto kernel scope link src 192.168.13.2
192.168.13.0/24 dev ve2 proto bird scope link metric 32
192.168.14.0/24 dev ve1 proto kernel scope link src 192.168.14.1
192.168.14.0/24 dev ve1 proto bird scope link metric 32
192.168.220.0 via 192.168.13.1 dev ve2 proto bird metric 32
import tests.kernel as tk
def test_wait():
"""Wait for convergence"""
tk.wait(40)
def test_krt_routes():
"""Test kernel routes"""
tk.test_krt_routes('krt')
NETLAB_NODES="m1 m2 m3 m4 m5"
NETLAB_NODES="m1 m2 m3 m4"
netlab_init
vrf $m1 vrf1 100
vrf $m1 vrf2 200
vrf m1 vrf1 100
vrf m1 vrf2 200
vrf m1 vrf3 300
if_dummy $m1/vrf1 vd1 10.1.1 2001:db8:1:1
if_dummy $m1/vrf2 vd2 10.1.1 2001:db8:1:1
vrf m2 vrf0 100
vrf m3 vrf0 100
vrf m4 vrf0 100
if_dummy $m2 ve0 10.2.1.1/24 2001:db8:2:1::1/64
if_dummy $m3 ve0 10.3.1.1/24 2001:db8:3:1::1/64
if_dummy $m4 ve0 10.2.1.2/24 2001:db8:2:1::2/64
if_dummy $m5 ve0 10.3.1.2/24 2001:db8:3:1::2/64
if_dummy m1/vrf1 vd1 10.1.1 2001:db8:1:1
if_dummy m1/vrf2 vd2 10.1.1 2001:db8:1:1
if_dummy m1/vrf3 vd3 10.1.1 2001:db8:1:1
if_veth $m1/vrf1 ve1 $m2 ve2 10.0.1 2001:db8:0:1
if_veth $m2 ve1 $m3 ve2 10.0.2 2001:db8:0:2
if_veth $m3 ve1 $m1/vrf1 ve2 10.0.3 2001:db8:0:3
if_dummy m2/vrf0 ve0 10.5.1.2/24 2001:db8:5:1::2/64
if_dummy m3/vrf0 ve0 10.5.1.3/24 2001:db8:5:1::3/64
if_dummy m4/vrf0 ve0 10.5.1.4/24 2001:db8:5:1::4/64
if_veth $m1/vrf2 ve3 $m4 ve2 10.0.1 2001:db8:0:1
if_veth $m4 ve1 $m5 ve2 10.0.2 2001:db8:0:2
if_veth $m5 ve1 $m1/vrf2 ve4 10.0.3 2001:db8:0:3
# sleep 2
if_veth m1/vrf1 ve1 m2/vrf0 ve1 10.0.1 2001:db8:0:1
if_veth m1/vrf2 ve2 m3/vrf0 ve1 10.0.2 2001:db8:0:2
if_veth m1/vrf3 ve3 m4/vrf0 ve1 10.0.3 2001:db8:0:3
netlab_start
BIRD binaries should be copied here, with 4/6 suffix:
BIRD binaries should be copied here:
bird4
bird6
birdc4
birdc6
bird
birdc
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.