Skip to content

Commit

Permalink
add prompt for test
Browse files Browse the repository at this point in the history
  • Loading branch information
YukariChiba committed Oct 10, 2024
1 parent 189d3ca commit bc53858
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions test-router.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,13 @@ read -p "Press any key to start test..."
sudo ip netns exec ${NETNS_PFX}-1 ping ${MPLS_IP_PFX}.6 -c 1
sudo ip netns exec ${NETNS_PFX}-6 ping ${MPLS_IP_PFX}.1 -c 1

sudo ip netns exec ${NETNS_PFX}-1 ping ${MPLS_IP6_PFX}::6 -c 1
sudo ip netns exec ${NETNS_PFX}-6 ping ${MPLS_IP6_PFX}::1 -c 1

sudo ip netns exec ${NETNS_PFX}-1 traceroute -e -I ${MPLS_IP_PFX}.6 -w 0.3 -q 1 -n
sudo ip netns exec ${NETNS_PFX}-6 traceroute -e -I ${MPLS_IP_PFX}.1 -w 0.3 -q 1 -n
sudo ip netns exec ${NETNS_PFX}-1 traceroute6 -e -I ${MPLS_IP6_PFX}::6 -w 0.3 -q 1 -n
sudo ip netns exec ${NETNS_PFX}-6 traceroute6 -e -I ${MPLS_IP6_PFX}::1 -w 0.3 -q 1 -n
sudo ip netns exec ${NETNS_PFX}-1 traceroute -e -I ${MPLS_IP6_PFX}::6 -w 0.3 -q 1 -n
sudo ip netns exec ${NETNS_PFX}-6 traceroute -e -I ${MPLS_IP6_PFX}::1 -w 0.3 -q 1 -n
read -p "Press any key to exit..."

clean_up
4 changes: 3 additions & 1 deletion test-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ sudo ip -M route add 300 as 301 via inet ${NS_WG_IP} dev ${NIC}-wg
sudo ip netns exec ${NETNS} ip -M route add 301 via inet ${HOST_WG_IP} dev ${NIC}-wg
sudo ip -M route add 400 dev lo

echo "Now you can ping 169.254.2.2 from host."

if [ -x "$(command -v tcpdump)" ]; then
sudo tcpdump -i ${NIC}-wg -nn -l
elif [ -x "$(command -v wireshark)" ]; then
Expand All @@ -79,4 +81,4 @@ sudo ip link del ${NIC}-wg
# 169.254.2.2 --> 169.254.2.1:
# send -(ip)-> NS -(200)-> HOST -(201)-> NS -(202) -> HOST -(ip)-> HOST(lo)
#
#
#
4 changes: 3 additions & 1 deletion test-tunnel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ sudo ip -M route add 200 as 201 via inet ${NS_WG_IP} dev ${NIC}-wg
sudo ip netns exec ${NETNS} ip -M route add 201 as 202 via inet ${HOST_WG_IP} dev ${NIC}-wg
sudo ip -M route add 202 dev lo

echo "Now you can ping 169.254.2.2 from host."

if [ -x "$(command -v tcpdump)" ]; then
sudo tcpdump -i ${NIC}-wg -nn -l
elif [ -x "$(command -v wireshark)" ]; then
Expand All @@ -82,4 +84,4 @@ sudo ip link del ${NIC}-wg
# 169.254.2.2 --> 169.254.2.1:
# send -(ip)-> NS -(200)-> HOST -(201)-> NS -(202) -> HOST -(ip)-> HOST(lo)
#
#
#

0 comments on commit bc53858

Please sign in to comment.