Lines Matching refs:ns1

31 setup_ns ns1 ns2 nsr1 nsr2
34 ip netns pids "$ns1" | xargs kill 2>/dev/null
48 ip link add veth0 netns "$nsr1" type veth peer name eth0 netns "$ns1"
64 # set different MTUs so we need to push packets coming from ns1 (large MTU)
98 ip -net "$ns1" link set eth0 mtu "$omtu"
127 for ns in "$ns1" "$ns2";do
138 ip -net "$ns1" addr add 10.0.1.99/24 dev eth0
140 ip -net "$ns1" route add default via 10.0.1.1
142 ip -net "$ns1" addr add dead:1::99/64 dev eth0 nodad
144 ip -net "$ns1" route add default via dead:1::1
204 if ! ip netns exec "$ns1" ping -c 1 -q 10.0.2.99 > /dev/null; then
205 echo "ERROR: $ns1 cannot reach ns2" 1>&2
210 echo "ERROR: $ns2 cannot reach $ns1" 1>&2
363 if ! check_transfer "$nsin" "$ns2out" "ns1 -> ns2"; then
368 if ! check_transfer "$nsin" "$ns1out" "ns1 <- ns2"; then
441 check_counters "flow offload for ns1/ns2 with masquerade and pmtu discovery $what"
443 echo "PASS: flow offload for ns1/ns2 with masquerade $what"
449 check_counters "flow offload for ns1/ns2 with dnat and pmtu discovery $what"
451 echo "PASS: flow offload for ns1/ns2 with dnat $what"
461 # No PMTU discovery, nsr1 is expected to fragment packets from ns1 to ns2 as needed.
465 if test_tcp_forwarding "$ns1" "$ns2"; then
466 echo "PASS: flow offloaded for ns1/ns2"
468 echo "FAIL: flow offload for ns1/ns2:" 1>&2
473 # delete default route, i.e. ns2 won't be able to reach ns1 and
474 # will depend on ns1 being masqueraded in nsr1.
475 # expect ns1 has nsr1 address.
497 if ! test_tcp_forwarding_set_dscp "$ns1" "$ns2" 0 ""; then
498 echo "FAIL: flow offload for ns1/ns2 with dscp update" 1>&2
502 if ! test_tcp_forwarding_nat "$ns1" "$ns2" 0 ""; then
503 echo "FAIL: flow offload for ns1/ns2 with NAT" 1>&2
512 ip netns exec "$ns1" sysctl net.ipv4.ip_no_pmtu_disc=0 > /dev/null
522 if ! test_tcp_forwarding_nat "$ns1" "$ns2" 1 ""; then
523 echo "FAIL: flow offload for ns1/ns2 with NAT and pmtu discovery" 1>&2
560 if ! test_tcp_forwarding_nat "$ns1" "$ns2" 1 "on bridge"; then
561 echo "FAIL: flow offload for ns1/ns2 with bridge NAT" 1>&2
576 ip -net "$ns1" addr flush dev eth0
577 ip -net "$ns1" link add link eth0 name eth0.10 type vlan id 10
578 ip -net "$ns1" link set eth0 up
579 ip -net "$ns1" link set eth0.10 up
580 ip -net "$ns1" addr add 10.0.1.99/24 dev eth0.10
581 ip -net "$ns1" route add default via 10.0.1.1
582 ip -net "$ns1" addr add dead:1::99/64 dev eth0.10 nodad
584 if ! test_tcp_forwarding_nat "$ns1" "$ns2" 1 "bridge and VLAN"; then
585 echo "FAIL: flow offload for ns1/ns2 with bridge NAT and VLAN" 1>&2
596 ip -net "$ns1" addr flush dev eth0.10
597 ip -net "$ns1" link set eth0.10 down
598 ip -net "$ns1" link set eth0 down
599 ip -net "$ns1" link delete eth0.10 type vlan
601 # restore address in ns1 and nsr1
602 ip -net "$ns1" link set eth0 up
603 ip -net "$ns1" addr add 10.0.1.99/24 dev eth0
604 ip -net "$ns1" route add default via 10.0.1.1
605 ip -net "$ns1" addr add dead:1::99/64 dev eth0 nodad
606 ip -net "$ns1" route add default via dead:1::1
652 if test_tcp_forwarding "$ns1" "$ns2"; then
653 check_counters "ipsec tunnel mode for ns1/ns2"
655 echo "FAIL: ipsec tunnel mode for ns1/ns2"