three.sh (mrouted-4.3) | : | three.sh (mrouted-4.4) | ||
---|---|---|---|---|
#!/bin/sh | #!/bin/sh | |||
# Three routers in a row, end devices on each end. Every other | # Three routers in a row, end devices on each end. Every router and | |||
# device in a network namespace to circumvent one-address per | # end device in a network namespace to circumvent one-address per | |||
# subnet in Linux | # subnet in Linux | |||
# | # | |||
# NS1 NS2 NS3 NS4 NS5 | # NS1 NS2 NS3 NS4 NS5 | |||
# [ED1:eth0]--[eth1:R1:eth2]---[eth3:R2:eth4]---[eth5:R3:eth6]---[eth0:ED2] | # [ED1:eth0]--[eth1:R1:eth2]---[eth3:R2:eth4]---[eth5:R3:eth6]---[eth0:ED2] | |||
# 10.0.0.0/24 10.0.1.0/24 10.0.2.0/24 10.0.3.0/24 | # 10.0.0.0/24 10.0.1.0/24 10.0.2.0/24 10.0.3.0/24 | |||
# shellcheck source=/dev/null | # shellcheck source=/dev/null | |||
. "$(dirname "$0")/lib.sh" | . "$(dirname "$0")/lib.sh" | |||
# Requires OSPF (bird) to build the unicast rpf tree | # Requires OSPF (bird) to build the unicast rpf tree | |||
skipping to change at line 198 | skipping to change at line 198 | |||
print "Starting Bird OSPF ..." | print "Starting Bird OSPF ..." | |||
nsenter --net="$NS2" -- bird -c "/tmp/$NM/bird.conf" -d -s "/tmp/$NM/r1-bird.soc k" & | nsenter --net="$NS2" -- bird -c "/tmp/$NM/bird.conf" -d -s "/tmp/$NM/r1-bird.soc k" & | |||
echo $! >> "/tmp/$NM/PIDs" | echo $! >> "/tmp/$NM/PIDs" | |||
nsenter --net="$NS3" -- bird -c "/tmp/$NM/bird.conf" -d -s "/tmp/$NM/r2-bird.soc k" & | nsenter --net="$NS3" -- bird -c "/tmp/$NM/bird.conf" -d -s "/tmp/$NM/r2-bird.soc k" & | |||
echo $! >> "/tmp/$NM/PIDs" | echo $! >> "/tmp/$NM/PIDs" | |||
nsenter --net="$NS4" -- bird -c "/tmp/$NM/bird.conf" -d -s "/tmp/$NM/r3-bird.soc k" & | nsenter --net="$NS4" -- bird -c "/tmp/$NM/bird.conf" -d -s "/tmp/$NM/r3-bird.soc k" & | |||
echo $! >> "/tmp/$NM/PIDs" | echo $! >> "/tmp/$NM/PIDs" | |||
sleep 1 | sleep 1 | |||
print "Starting mrouted ..." | print "Starting mrouted ..." | |||
nsenter --net="$NS2" -- ../src/mrouted -i NS2 -n -p "/tmp/$NM/r1.pid" -l debug - u "/tmp/$NM/r1.sock" & | nsenter --net="$NS2" -- ../src/mrouted -i NS2 -n -p "/tmp/$NM/r1.pid" -l debug - d all -u "/tmp/$NM/r1.sock" & | |||
echo $! >> "/tmp/$NM/PIDs" | echo $! >> "/tmp/$NM/PIDs" | |||
nsenter --net="$NS3" -- ../src/mrouted -i NS3 -n -p "/tmp/$NM/r2.pid" -l debug - u "/tmp/$NM/r2.sock" & | nsenter --net="$NS3" -- ../src/mrouted -i NS3 -n -p "/tmp/$NM/r2.pid" -l debug - d all -u "/tmp/$NM/r2.sock" & | |||
echo $! >> "/tmp/$NM/PIDs" | echo $! >> "/tmp/$NM/PIDs" | |||
nsenter --net="$NS4" -- ../src/mrouted -i NS4 -n -p "/tmp/$NM/r3.pid" -l debug - u "/tmp/$NM/r3.sock" & | nsenter --net="$NS4" -- ../src/mrouted -i NS4 -n -p "/tmp/$NM/r3.pid" -l debug - d all -u "/tmp/$NM/r3.sock" & | |||
echo $! >> "/tmp/$NM/PIDs" | echo $! >> "/tmp/$NM/PIDs" | |||
sleep 1 | sleep 1 | |||
# Wait for routers to peer | # Wait for routers to peer | |||
print "Waiting for OSPF routers to peer (30 sec) ..." | print "Waiting for OSPF routers to peer (30 sec) ..." | |||
tenacious 30 nsenter --net="$NS1" -- ping -qc 1 -W 1 10.0.3.10 >/dev/null | tenacious 30 nsenter --net="$NS1" -- ping -qc 1 -W 1 10.0.3.10 >/dev/null | |||
dprint "DVMRP Status $NS2" | dprint "DVMRP Status $NS2" | |||
nsenter --net="$NS2" -- ../src/mroutectl -u "/tmp/$NM/r1.sock" show compat detai l | nsenter --net="$NS2" -- ../src/mroutectl -u "/tmp/$NM/r1.sock" show compat detai l | |||
dprint "DVMRP Status $NS3" | dprint "DVMRP Status $NS3" | |||
skipping to change at line 247 | skipping to change at line 247 | |||
# nsenter --net="$NS3" -- echo "show ospf neigh" | birdc -s "/tmp/$NM/r2-bird.so ck" | # nsenter --net="$NS3" -- echo "show ospf neigh" | birdc -s "/tmp/$NM/r2-bird.so ck" | |||
# nsenter --net="$NS3" -- ip route | # nsenter --net="$NS3" -- ip route | |||
# dprint "OSPF State & Routing Table $NS4:" | # dprint "OSPF State & Routing Table $NS4:" | |||
# nsenter --net="$NS4" -- echo "show ospf state" | birdc -s "/tmp/$NM/r3-bird.so ck" | # nsenter --net="$NS4" -- echo "show ospf state" | birdc -s "/tmp/$NM/r3-bird.so ck" | |||
# nsenter --net="$NS4" -- echo "show ospf int" | birdc -s "/tmp/$NM/r3-bird.so ck" | # nsenter --net="$NS4" -- echo "show ospf int" | birdc -s "/tmp/$NM/r3-bird.so ck" | |||
# nsenter --net="$NS4" -- echo "show ospf neigh" | birdc -s "/tmp/$NM/r3-bird.so ck" | # nsenter --net="$NS4" -- echo "show ospf neigh" | birdc -s "/tmp/$NM/r3-bird.so ck" | |||
# nsenter --net="$NS4" -- ip route | # nsenter --net="$NS4" -- ip route | |||
print "Starting emitter ..." | print "Starting emitter ..." | |||
nsenter --net="$NS5" -- ./mping -qr -d -i eth0 -t 5 -W 30 225.1.2.3 & | nsenter --net="$NS5" -- ./mping -qr -i eth0 -t 5 -W 30 225.1.2.3 & | |||
echo $! >> "/tmp/$NM/PIDs" | echo $! >> "/tmp/$NM/PIDs" | |||
sleep 1 | sleep 1 | |||
if ! nsenter --net="$NS1" -- ./mping -s -d -i eth0 -t 5 -c 10 -w 15 225.1.2.3; then | if ! nsenter --net="$NS1" -- ./mping -s -i eth0 -t 5 -c 10 -w 15 225.1.2.3; the n | |||
dprint "DVMRP Status $NS2" | dprint "DVMRP Status $NS2" | |||
nsenter --net="$NS2" -- ../src/mroutectl -u "/tmp/$NM/r1.sock" show compat d etail | nsenter --net="$NS2" -- ../src/mroutectl -u "/tmp/$NM/r1.sock" show compat d etail | |||
dprint "DVMRP Status $NS3" | dprint "DVMRP Status $NS3" | |||
nsenter --net="$NS3" -- ../src/mroutectl -u "/tmp/$NM/r2.sock" show compat d etail | nsenter --net="$NS3" -- ../src/mroutectl -u "/tmp/$NM/r2.sock" show compat d etail | |||
dprint "DVMRP Status $NS4" | dprint "DVMRP Status $NS4" | |||
nsenter --net="$NS4" -- ../src/mroutectl -u "/tmp/$NM/r3.sock" show compat d etail | nsenter --net="$NS4" -- ../src/mroutectl -u "/tmp/$NM/r3.sock" show compat d etail | |||
echo "Failed routing, expected at least 10 multicast ping replies" | echo "Failed routing, expected at least 10 multicast ping replies" | |||
FAIL | FAIL | |||
fi | fi | |||
End of changes. 6 change blocks. | ||||
7 lines changed or deleted | 7 lines changed or added |