Lines Matching +full:no +full:- +full:loopback +full:- +full:test
2 # SPDX-License-Identifier: GPL-2.0
9 # 2. client, server, no-server
13 # 6. VRF and non-VRF permutations
16 # ns-A | ns-B
17 # No VRF case:
18 # [ lo ] [ eth1 ]---|---[ eth1 ] [ lo ]
21 # [ red ]---[ eth1 ]---|---[ eth1 ] [ lo ]
23 # ns-A:
30 # ns-B:
35 # ns-A to ns-C connection - only for VRF and same config
36 # as ns-A to ns-B
38 # server / client nomenclature relative to ns-A
40 # Kselftest framework requirement - SKIP code is 4.
69 # non-local addresses for freebind tests
85 NSA=ns-A
86 NSB=ns-B
87 NSC=ns-C
96 if [ -f /proc/sys/crypto/fips_enabled ]; then
113 if [ ${rc} -eq ${expected} ]; then
115 printf "TEST: %-70s [ OK ]\n" "${msg}"
118 printf "TEST: %-70s [FAIL]\n" "${msg}"
146 log_test $rc $expected "$msg - ${astr}"
168 # make sure we have no test instances running
211 if [ "$VERBOSE" = "1" -a -n "$out" ]; then
240 if [ $rc -ne 0 ]; then
262 if [ $rc -ne 0 ]; then
284 if [ $rc -ne 0 ]; then
299 # set sysctl values in NS-A
304 run_cmd sysctl -q -w $*
307 # get sysctl values in NS-A
310 ${NSA_CMD} sysctl -n $*
319 127.0.0.1) echo "loopback";;
320 ::1) echo "IPv6 loopback";;
325 ${NSA_IP}) echo "ns-A IP";;
326 ${NSA_IP6}) echo "ns-A IPv6";;
327 ${NSA_LO_IP}) echo "ns-A loopback IP";;
328 ${NSA_LO_IP6}) echo "ns-A loopback IPv6";;
329 ${NSA_LINKIP6}|${NSA_LINKIP6}%*) echo "ns-A IPv6 LLA";;
331 ${NSB_IP}) echo "ns-B IP";;
332 ${NSB_IP6}) echo "ns-B IPv6";;
333 ${NSB_LO_IP}) echo "ns-B loopback IP";;
334 ${NSB_LO_IP6}) echo "ns-B loopback IPv6";;
335 ${NSB_LINKIP6}|${NSB_LINKIP6}%*) echo "ns-B IPv6 LLA";;
355 addr=$(ip -netns ${ns} -6 -br addr show dev ${dev} | \
365 [ -z "$addr" ] && return 1
383 ip -netns ${ns} link add ${vrf} type vrf table ${table}
384 ip -netns ${ns} link set ${vrf} up
385 ip -netns ${ns} route add vrf ${vrf} unreachable default metric 8192
386 ip -netns ${ns} -6 route add vrf ${vrf} unreachable default metric 8192
388 ip -netns ${ns} addr add 127.0.0.1/8 dev ${vrf}
389 ip -netns ${ns} -6 addr add ::1 dev ${vrf} nodad
390 if [ "${addr}" != "-" ]; then
391 ip -netns ${ns} addr add dev ${vrf} ${addr}
393 if [ "${addr6}" != "-" ]; then
394 ip -netns ${ns} -6 addr add dev ${vrf} ${addr6}
397 ip -netns ${ns} ru del pref 0
398 ip -netns ${ns} ru add pref 32765 from all lookup local
399 ip -netns ${ns} -6 ru del pref 0
400 ip -netns ${ns} -6 ru add pref 32765 from all lookup local
411 ip -netns ${ns} link set lo up
412 if [ "${addr}" != "-" ]; then
413 ip -netns ${ns} addr add dev lo ${addr}
415 if [ "${addr6}" != "-" ]; then
416 ip -netns ${ns} -6 addr add dev lo ${addr6}
419 ip -netns ${ns} ro add unreachable default metric 8192
420 ip -netns ${ns} -6 ro add unreachable default metric 8192
422 ip netns exec ${ns} sysctl -qw net.ipv4.ip_forward=1
423 ip netns exec ${ns} sysctl -qw net.ipv6.conf.all.keep_addr_on_down=1
424 ip netns exec ${ns} sysctl -qw net.ipv6.conf.all.forwarding=1
425 ip netns exec ${ns} sysctl -qw net.ipv6.conf.default.forwarding=1
440 ip -netns ${ns1} li add ${ns1_dev} type veth peer name tmp
441 ip -netns ${ns1} li set ${ns1_dev} up
442 ip -netns ${ns1} li set tmp netns ${ns2} name ${ns2_dev}
443 ip -netns ${ns2} li set ${ns2_dev} up
445 if [ "${ns1_addr}" != "-" ]; then
446 ip -netns ${ns1} addr add dev ${ns1_dev} ${ns1_addr}
447 ip -netns ${ns2} addr add dev ${ns2_dev} ${ns2_addr}
450 if [ "${ns1_addr6}" != "-" ]; then
451 ip -netns ${ns1} addr add dev ${ns1_dev} ${ns1_addr6}
452 ip -netns ${ns2} addr add dev ${ns2_dev} ${ns2_addr6}
459 ip netns | grep -q ${NSA}
460 if [ $? -eq 0 ]; then
461 ip -netns ${NSA} link delete ${VRF}
462 ip -netns ${NSA} ro flush table ${VRF_TABLE}
464 ip -netns ${NSA} addr flush dev ${NSA_DEV}
465 ip -netns ${NSA} -6 addr flush dev ${NSA_DEV}
466 ip -netns ${NSA} link set dev ${NSA_DEV} down
467 ip -netns ${NSA} link del dev ${NSA_DEV}
488 # some VRF tests use ns-C which has the same config as
489 # ns-B but for a device NOT in the VRF
490 create_ns ${NSC} "-" "-"
504 set -e
514 # tell ns-A how to get to remote addresses of ns-B
518 ip -netns ${NSA} link set dev ${NSA_DEV} vrf ${VRF}
519 ip -netns ${NSA} ro add vrf ${VRF} ${NSB_LO_IP}/32 via ${NSB_IP} dev ${NSA_DEV}
520 ip -netns ${NSA} -6 ro add vrf ${VRF} ${NSB_LO_IP6}/128 via ${NSB_IP6} dev ${NSA_DEV}
522 ip -netns ${NSB} ro add ${VRF_IP}/32 via ${NSA_IP} dev ${NSB_DEV}
523 ip -netns ${NSB} -6 ro add ${VRF_IP6}/128 via ${NSA_IP6} dev ${NSB_DEV}
525 ip -netns ${NSA} ro add ${NSB_LO_IP}/32 via ${NSB_IP} dev ${NSA_DEV}
526 ip -netns ${NSA} ro add ${NSB_LO_IP6}/128 via ${NSB_IP6} dev ${NSA_DEV}
530 # tell ns-B how to get to remote addresses of ns-A
531 ip -netns ${NSB} ro add ${NSA_LO_IP}/32 via ${NSA_IP} dev ${NSB_DEV}
532 ip -netns ${NSB} ro add ${NSA_LO_IP6}/128 via ${NSA_IP6} dev ${NSB_DEV}
546 set -e
548 create_ns ${NSA} "-" "-"
549 create_ns ${NSB} "-" "-"
550 create_ns ${NSC} "-" "-"
551 connect_ns ${NSA} ${NSA_DEV} "-" "-" \
552 ${NSB} ${NSB_DEV} "-" "-"
553 connect_ns ${NSA} ${NSA_DEV2} "-" "-" \
554 ${NSC} ${NSC_DEV} "-" "-"
560 create_vrf ${NSA} ${VRF} ${VRF_TABLE} "-" "-"
561 ip -netns ${NSA} link set dev ${NSA_DEV} vrf ${VRF}
562 ip -netns ${NSA} link set dev ${NSA_DEV2} vrf ${VRF}
582 run_cmd ping -c1 -w1 ${a}
586 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
590 run_cmd ping -c1 -w1 -I ${NSA_LO_IP} ${a}
599 run_cmd ping -c 1 -w 1 -r ${a}
605 run_cmd ping -c 1 -w 1 -r ${a}
614 run_cmd_nsb ping -c1 -w1 ${a}
624 run_cmd ping -c1 -w1 ${a}
634 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
637 # loopback addresses not reachable from device bind
643 show_hint "Fails since address on loopback device is out of device scope"
644 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
658 run_cmd ping -c1 -w1 ${a}
664 # run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
669 run_cmd_nsb ping -c1 -w1 ${a}
686 run_cmd ping -c1 -w1 ${a}
692 # run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
697 run_cmd_nsb ping -c1 -w1 ${a}
707 run_cmd ping -c1 -w1 ${a}
713 # run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
729 run_cmd ping -c1 -w1 -I ${VRF} ${a}
733 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
737 run_cmd ip vrf exec ${VRF} ping -c1 -w1 -I ${NSA_IP} ${a}
741 run_cmd ip vrf exec ${VRF} ping -c1 -w1 -I ${VRF_IP} ${a}
751 run_cmd_nsb ping -c1 -w1 ${a}
762 run_cmd ping -c1 -w1 -I ${VRF} ${a}
772 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
780 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
792 run_cmd ping -c1 -w1 -I ${VRF} ${a}
796 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
802 run_cmd_nsb ping -c1 -w1 ${a}
816 run_cmd ping -c1 -w1 -I ${VRF} ${a}
820 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
826 run_cmd_nsb ping -c1 -w1 ${a}
834 log_subsection "No VRF"
867 run_cmd nettest -s -M ${MD5_PW} -m ${NSB_IP} &
869 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
875 run_cmd nettest -s &
877 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
878 log_test $? 2 "MD5: Server no config, client uses password"
883 run_cmd nettest -s -M ${MD5_PW} -m ${NSB_IP} &
885 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW}
891 run_cmd nettest -s -M ${MD5_PW} -m ${NSB_LO_IP} &
893 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
897 # MD5 extension - prefix length
902 run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} &
904 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
910 run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} &
912 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW}
918 run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} &
920 run_cmd_nsb nettest -c ${NSB_LO_IP} -r ${NSA_IP} -X ${MD5_PW}
935 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} &
937 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
943 run_cmd nettest -s -I ${VRF} &
945 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
946 log_test $? 2 "MD5: VRF: Server no config, client uses password"
951 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} &
953 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW}
959 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_LO_IP} &
961 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
965 # MD5 extension - prefix length
970 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} &
972 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
978 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} &
980 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW}
986 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} &
988 run_cmd_nsb nettest -c ${NSB_LO_IP} -r ${NSA_IP} -X ${MD5_PW}
996 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} &
997 run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NSB_IP} &
999 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
1003 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} &
1004 run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NSB_IP} &
1006 run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_WRONG_PW}
1011 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} &
1012 run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NSB_IP} &
1014 run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_PW}
1019 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP} &
1020 run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NSB_IP} &
1022 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW}
1026 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} &
1027 run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NS_NET} &
1029 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
1033 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} &
1034 run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NS_NET} &
1036 run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_WRONG_PW}
1041 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} &
1042 run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NS_NET} &
1044 run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_PW}
1049 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} &
1050 run_cmd nettest -s -M ${MD5_WRONG_PW} -m ${NS_NET} &
1052 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_WRONG_PW}
1059 run_cmd nettest -s -I ${NSA_DEV} -M ${MD5_PW} -m ${NSB_IP}
1060 log_test $? 1 "MD5: VRF: Device must be a VRF - single address"
1063 run_cmd nettest -s -I ${NSA_DEV} -M ${MD5_PW} -m ${NS_NET}
1064 log_test $? 1 "MD5: VRF: Device must be a VRF - prefix"
1074 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} --no-bind-key-ifindex &
1076 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
1077 log_test $? 0 "MD5: VRF: VRF-bound server, unbound key accepts connection"
1081 run_cmd nettest -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET} --force-bind-key-ifindex &
1083 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
1084 log_test $? 0 "MD5: VRF: VRF-bound server, bound key accepts connection"
1089 # This particular test needs tcp_l3mdev_accept=1 for Global server to accept VRF connections
1095 run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} --force-bind-key-ifindex &
1097 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
1101 run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} --force-bind-key-ifindex &
1103 run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_PW}
1104 log_test $? 0 "MD5: VRF: Global server, key bound to ifindex=0 accepts non-VRF connection"
1107 run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} --no-bind-key-ifindex &
1109 run_cmd_nsb nettest -r ${NSA_IP} -X ${MD5_PW}
1113 run_cmd nettest -s -M ${MD5_PW} -m ${NS_NET} --no-bind-key-ifindex &
1115 run_cmd_nsc nettest -r ${NSA_IP} -X ${MD5_PW}
1116 log_test $? 0 "MD5: VRF: Global server, key not bound to ifindex accepts non-VRF connection"
1135 nsa_syncookies=$(ip netns exec "${NSA}" sysctl -n net.ipv4.tcp_syncookies)
1136 nsb_syncookies=$(ip netns exec "${NSB}" sysctl -n net.ipv4.tcp_syncookies)
1137 ip netns exec "${NSA}" sysctl -wq net.ipv4.tcp_syncookies=${syncookies}
1138 ip netns exec "${NSB}" sysctl -wq net.ipv4.tcp_syncookies=${syncookies}
1140 # Test with eth1 address (on link).
1144 do_run_cmd nettest -B -N "${NSA}" -O "${NSB}" -r ${a} --client-dontroute
1149 do_run_cmd nettest -B -N "${NSA}" -O "${NSB}" -r ${a} --server-dontroute
1152 # Test with loopback address (routed).
1155 # Therefore, we need to use the -c option here, to force the use of the
1156 # routed (loopback) address as source IP (so that the server will try
1162 do_run_cmd nettest -B -N "${NSA}" -O "${NSB}" -c "${NSA_LO_IP}" -r ${a} --client-dontroute
1168 do_run_cmd nettest -B -N "${NSA}" -O "${NSB}" -c "${NSA_LO_IP}" -r ${a} --server-dontroute
1171 ip netns exec "${NSB}" sysctl -wq net.ipv4.tcp_syncookies=${nsb_syncookies}
1172 ip netns exec "${NSA}" sysctl -wq net.ipv4.tcp_syncookies=${nsa_syncookies}
1185 run_cmd nettest -s &
1187 run_cmd_nsb nettest -r ${a}
1193 run_cmd nettest -s -I ${NSA_DEV} &
1195 run_cmd_nsb nettest -r ${a}
1202 show_hint "Should fail 'Connection refused' since there is no server"
1203 run_cmd_nsb nettest -r ${a}
1204 log_test_addr ${a} $? 1 "No server"
1213 run_cmd_nsb nettest -s &
1215 run_cmd nettest -r ${a} -0 ${NSA_IP}
1219 run_cmd_nsb nettest -s &
1221 run_cmd nettest -r ${a} -d ${NSA_DEV}
1226 run_cmd nettest -r ${a}
1227 log_test_addr ${a} $? 1 "No server, unbound client"
1231 run_cmd nettest -r ${a} -d ${NSA_DEV}
1232 log_test_addr ${a} $? 1 "No server, device client"
1241 run_cmd nettest -s &
1243 run_cmd nettest -r ${a} -0 ${a} -1 ${a}
1249 run_cmd nettest -s -I ${NSA_DEV} &
1251 run_cmd nettest -r ${a} -0 ${a}
1257 show_hint "Should fail 'Connection refused' since addresses on loopback are out of device scope"
1258 run_cmd nettest -s -I ${NSA_DEV} &
1260 run_cmd nettest -r ${a}
1266 run_cmd nettest -s &
1268 run_cmd nettest -r ${a} -0 ${a} -d ${NSA_DEV}
1274 show_hint "Should fail 'No route to host' since addresses on loopback are out of device scope"
1275 run_cmd nettest -s &
1277 run_cmd nettest -r ${a} -d ${NSA_DEV}
1283 run_cmd nettest -s -I ${NSA_DEV} -3 ${NSA_DEV} &
1285 run_cmd nettest -d ${NSA_DEV} -r ${a} -0 ${a}
1290 run_cmd nettest -d ${NSA_DEV} -r ${a}
1291 log_test_addr ${a} $? 1 "No server, device client, local conn"
1315 run_cmd nettest -s &
1317 run_cmd_nsb nettest -r ${a}
1321 run_cmd nettest -s -I ${VRF} -3 ${VRF} &
1323 run_cmd_nsb nettest -r ${a}
1327 run_cmd nettest -s -I ${NSA_DEV} -3 ${NSA_DEV} &
1329 run_cmd_nsb nettest -r ${a}
1334 show_hint "Should fail 'Connection refused' since there is no server"
1335 run_cmd_nsb nettest -r ${a}
1336 log_test_addr ${a} $? 1 "No server"
1344 run_cmd nettest -s &
1346 run_cmd nettest -r ${a} -d ${NSA_DEV}
1366 run_cmd nettest -s -3 ${VRF} &
1368 run_cmd_nsb nettest -r ${a}
1373 run_cmd nettest -s -I ${VRF} -3 ${VRF} &
1375 run_cmd_nsb nettest -r ${a}
1381 run_cmd_nsb nettest -r ${a}
1382 log_test_addr ${a} $? 1 "No server"
1388 run_cmd nettest -s -I ${NSA_DEV} -3 ${NSA_DEV} &
1390 run_cmd_nsb nettest -r ${a}
1398 run_cmd nettest -s -I ${VRF} &
1400 run_cmd nettest -r ${a}
1410 run_cmd_nsb nettest -s &
1412 run_cmd nettest -r ${a} -d ${VRF}
1416 run_cmd_nsb nettest -s &
1418 run_cmd nettest -r ${a} -d ${NSA_DEV}
1423 run_cmd nettest -r ${a} -d ${VRF}
1424 log_test_addr ${a} $? 1 "No server, VRF client"
1428 run_cmd nettest -r ${a} -d ${NSA_DEV}
1429 log_test_addr ${a} $? 1 "No server, device client"
1435 run_cmd nettest -s -I ${VRF} -3 ${VRF} &
1437 run_cmd nettest -r ${a} -d ${VRF} -0 ${a}
1443 run_cmd nettest -s -I ${VRF} -3 ${VRF} &
1445 run_cmd nettest -r ${a} -d ${NSA_DEV} -0 ${a}
1449 show_hint "Should fail 'No route to host' since client is out of VRF scope"
1450 run_cmd nettest -s -I ${VRF} &
1452 run_cmd nettest -r ${a}
1456 run_cmd nettest -s -I ${NSA_DEV} -3 ${NSA_DEV} &
1458 run_cmd nettest -r ${a} -d ${VRF} -0 ${a}
1462 run_cmd nettest -s -I ${NSA_DEV} -3 ${NSA_DEV} &
1464 run_cmd nettest -r ${a} -d ${NSA_DEV} -0 ${a}
1471 log_subsection "No VRF"
1474 # tcp_l3mdev_accept should have no affect without VRF;
1501 run_cmd nettest -D -s -3 ${NSA_DEV} &
1503 run_cmd_nsb nettest -D -r ${a}
1507 show_hint "Should fail 'Connection refused' since there is no server"
1508 run_cmd_nsb nettest -D -r ${a}
1509 log_test_addr ${a} $? 1 "No server"
1514 run_cmd nettest -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
1516 run_cmd_nsb nettest -D -r ${a}
1525 run_cmd_nsb nettest -D -s &
1527 run_cmd nettest -D -r ${a} -0 ${NSA_IP}
1531 run_cmd_nsb nettest -D -s &
1533 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -0 ${NSA_IP}
1537 run_cmd_nsb nettest -D -s &
1539 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -C -0 ${NSA_IP}
1543 run_cmd_nsb nettest -D -s &
1545 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S -0 ${NSA_IP}
1549 run_cmd_nsb nettest -D -s &
1551 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S -0 ${NSA_IP} -U
1557 run_cmd nettest -D -r ${a}
1558 log_test_addr ${a} $? 1 "No server, unbound client"
1562 run_cmd nettest -D -r ${a} -d ${NSA_DEV}
1563 log_test_addr ${a} $? 1 "No server, device client"
1572 run_cmd nettest -D -s &
1574 run_cmd nettest -D -r ${a} -0 ${a} -1 ${a}
1580 run_cmd nettest -s -D -I ${NSA_DEV} -3 ${NSA_DEV} &
1582 run_cmd nettest -D -r ${a}
1589 run_cmd nettest -s -D -I ${NSA_DEV} &
1591 run_cmd nettest -D -r ${a}
1597 run_cmd nettest -s -D &
1599 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1603 run_cmd nettest -s -D &
1605 run_cmd nettest -D -d ${NSA_DEV} -C -r ${a}
1609 run_cmd nettest -s -D &
1611 run_cmd nettest -D -d ${NSA_DEV} -S -r ${a}
1615 run_cmd nettest -s -D &
1617 run_cmd nettest -D -d ${NSA_DEV} -S -r ${a} -U
1621 # IPv4 with device bind has really weird behavior - it overrides the
1627 show_hint "Should fail since addresses on loopback are out of device scope"
1628 run_cmd nettest -D -s &
1630 run_cmd nettest -D -r ${a} -d ${NSA_DEV}
1634 show_hint "Should fail since addresses on loopback are out of device scope"
1635 run_cmd nettest -D -s &
1637 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -C
1641 show_hint "Should fail since addresses on loopback are out of device scope"
1642 run_cmd nettest -D -s &
1644 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S
1648 show_hint "Should fail since addresses on loopback are out of device scope"
1649 run_cmd nettest -D -s &
1651 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S -U
1659 run_cmd nettest -D -s -I ${NSA_DEV} -3 ${NSA_DEV} &
1661 run_cmd nettest -D -d ${NSA_DEV} -r ${a} -0 ${a}
1665 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1666 log_test_addr ${a} $? 2 "No server, device client, local conn"
1676 do_run_cmd nettest -B -D -N "${NSA}" -O "${NSB}" -r ${a} --client-dontroute
1682 do_run_cmd nettest -B -D -N "${NSA}" -O "${NSB}" -r ${a} --client-dontroute
1701 run_cmd nettest -D -s &
1703 run_cmd_nsb nettest -D -r ${a}
1707 run_cmd nettest -D -I ${VRF} -s -3 ${NSA_DEV} &
1709 run_cmd_nsb nettest -D -r ${a}
1713 run_cmd nettest -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
1715 run_cmd_nsb nettest -D -r ${a}
1719 show_hint "Should fail 'Connection refused' since there is no server"
1720 run_cmd_nsb nettest -D -r ${a}
1721 log_test_addr ${a} $? 1 "No server"
1725 run_cmd nettest -D -s &
1727 run_cmd nettest -D -d ${VRF} -r ${a}
1733 run_cmd nettest -s -D -I ${VRF} -3 ${NSA_DEV} &
1735 run_cmd nettest -D -d ${VRF} -r ${a}
1739 run_cmd nettest -s -D -I ${VRF} -3 ${NSA_DEV} &
1741 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1746 run_cmd nettest -s -D -I ${NSA_DEV} -3 ${NSA_DEV} &
1748 run_cmd nettest -D -d ${VRF} -r ${a}
1752 run_cmd nettest -s -D -I ${NSA_DEV} -3 ${NSA_DEV} &
1754 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1767 run_cmd nettest -D -s -3 ${NSA_DEV} &
1769 run_cmd_nsb nettest -D -r ${a}
1773 run_cmd nettest -D -I ${VRF} -s -3 ${NSA_DEV} &
1775 run_cmd_nsb nettest -D -r ${a}
1779 run_cmd nettest -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
1781 run_cmd_nsb nettest -D -r ${a}
1786 run_cmd_nsb nettest -D -r ${a}
1787 log_test_addr ${a} $? 1 "No server"
1794 run_cmd_nsb nettest -D -s &
1796 run_cmd nettest -d ${VRF} -D -r ${NSB_IP} -1 ${NSA_IP}
1800 run_cmd_nsb nettest -D -s &
1802 run_cmd nettest -d ${NSA_DEV} -D -r ${NSB_IP} -1 ${NSA_IP}
1805 # negative test - should fail
1808 run_cmd nettest -D -d ${VRF} -r ${NSB_IP}
1809 log_test $? 1 "No server, VRF client"
1813 run_cmd nettest -D -d ${NSA_DEV} -r ${NSB_IP}
1814 log_test $? 1 "No server, enslaved device client"
1821 run_cmd nettest -D -s -3 ${NSA_DEV} &
1823 run_cmd nettest -D -d ${VRF} -r ${a}
1827 run_cmd nettest -s -D -I ${VRF} -3 ${NSA_DEV} &
1829 run_cmd nettest -D -d ${VRF} -r ${a}
1833 run_cmd nettest -s -D -I ${VRF} -3 ${NSA_DEV} &
1835 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1839 run_cmd nettest -s -D -I ${NSA_DEV} -3 ${NSA_DEV} &
1841 run_cmd nettest -D -d ${VRF} -r ${a}
1845 run_cmd nettest -s -D -I ${NSA_DEV} -3 ${NSA_DEV} &
1847 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1853 run_cmd nettest -D -s -3 ${VRF} &
1855 run_cmd nettest -D -d ${VRF} -r ${a}
1862 run_cmd nettest -s -D -I ${VRF} -3 ${VRF} &
1864 run_cmd nettest -D -d ${VRF} -r ${a}
1868 # negative test - should fail
1874 run_cmd nettest -D -d ${VRF} -r ${a}
1875 log_test_addr ${a} $? 1 "No server, VRF client, local conn"
1882 log_subsection "No VRF"
1886 # udp_l3mdev_accept should have no affect without VRF;
1913 run_cmd nettest -s -R -P icmp -l ${a} -b
1917 run_cmd nettest -s -R -P icmp -l ${a} -I ${NSA_DEV} -b
1926 run_cmd nettest -s -R -f -l ${a} -b
1930 run_cmd nettest -s -f -l ${a} -b
1934 run_cmd nettest -s -D -P icmp -f -l ${a} -b
1942 run_cmd nettest -s -D -P icmp -l ${a} -b
1947 run_cmd nettest -s -D -P icmp -l ${a} -b
1955 run_cmd nettest -c ${a} -r ${NSB_IP} -t1 -b
1959 run_cmd nettest -c ${a} -r ${NSB_IP} -d ${NSA_DEV} -t1 -b
1964 # is that the address is valid in the L3 domain. So this test
1969 #run_cmd nettest -s -l ${a} -I ${NSA_DEV} -t1 -b
1982 run_cmd nettest -s -R -P icmp -l ${a} -b
1986 run_cmd nettest -s -R -P icmp -l ${a} -I ${NSA_DEV} -b
1989 run_cmd nettest -s -R -P icmp -l ${a} -I ${VRF} -b
1995 show_hint "Address on loopback is out of VRF scope"
1996 run_cmd nettest -s -R -P icmp -l ${a} -I ${VRF} -b
2004 run_cmd nettest -s -R -f -l ${a} -I ${VRF} -b
2008 run_cmd nettest -s -f -l ${a} -I ${VRF} -b
2012 run_cmd nettest -s -D -P icmp -f -l ${a} -I ${VRF} -b
2020 run_cmd nettest -s -D -P icmp -l ${a} -I ${VRF} -b
2025 run_cmd nettest -s -D -P icmp -l ${a} -I ${VRF} -b
2034 run_cmd nettest -s -l ${a} -I ${VRF} -t1 -b
2038 run_cmd nettest -s -l ${a} -I ${NSA_DEV} -t1 -b
2044 show_hint "Address on loopback out of scope for VRF"
2045 run_cmd nettest -s -l ${a} -I ${VRF} -t1 -b
2049 show_hint "Address on loopback out of scope for device in VRF"
2050 run_cmd nettest -s -l ${a} -I ${NSA_DEV} -t1 -b
2058 log_subsection "No VRF"
2085 run_cmd nettest ${varg} -s &
2087 run_cmd_nsb nettest ${varg} -r ${a} &
2099 run_cmd nettest ${varg} -s -I ${VRF} &
2101 run_cmd_nsb nettest ${varg} -r ${a} &
2112 run_cmd nettest ${varg} -s -I ${NSA_DEV} &
2114 run_cmd_nsb nettest ${varg} -r ${a} &
2123 # client test
2126 run_cmd_nsb nettest ${varg} -s &
2128 run_cmd nettest ${varg} -d ${VRF} -r ${NSB_IP} &
2137 run_cmd_nsb nettest ${varg} -s &
2139 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${NSB_IP} &
2153 run_cmd nettest ${varg} -s &
2155 run_cmd nettest ${varg} -d ${VRF} -r ${a} &
2167 run_cmd nettest ${varg} -I ${VRF} -s &
2169 run_cmd nettest ${varg} -d ${VRF} -r ${a} &
2181 run_cmd nettest ${varg} -s &
2183 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
2192 run_cmd nettest ${varg} -I ${VRF} -s &
2194 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
2203 run_cmd nettest ${varg} -I ${NSA_DEV} -s &
2205 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
2220 run_cmd_nsb ping -f ${a} &
2224 log_test_addr ${a} 0 0 "Device delete with active traffic - ping in"
2231 run_cmd ping -f -I ${VRF} ${a} &
2235 log_test_addr ${a} 0 0 "Device delete with active traffic - ping out"
2240 log_section "Run time tests - ipv4"
2246 ipv4_rt "TCP active socket" "-n -1"
2249 ipv4_rt "TCP passive socket" "-i"
2268 run_cmd ${ping6} -c1 -w1 ${a}
2275 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2279 run_cmd ${ping6} -c1 -w1 -I ${NSA_LO_IP6} ${a}
2280 log_test_addr ${a} $? 0 "ping out, loopback address bind"
2289 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2299 run_cmd ${ping6} -c1 -w1 ${a}
2300 log_test_addr ${a} $? 0 "ping local, no bind"
2306 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2313 show_hint "Fails since address on loopback is out of device scope"
2314 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2322 setup_cmd ip -6 rule add pref 32765 from all lookup local
2323 setup_cmd ip -6 rule del pref 0 from all lookup local
2324 setup_cmd ip -6 rule add pref 50 to ${NSB_LO_IP6} prohibit
2325 setup_cmd ip -6 rule add pref 51 from ${NSB_IP6} prohibit
2328 run_cmd ${ping6} -c1 -w1 ${a}
2332 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2338 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2341 setup_cmd ip -6 rule add pref 0 from all lookup local
2342 setup_cmd ip -6 rule del pref 32765 from all lookup local
2343 setup_cmd ip -6 rule del pref 50 to ${NSB_LO_IP6} prohibit
2344 setup_cmd ip -6 rule del pref 51 from ${NSB_IP6} prohibit
2350 setup_cmd ip -6 route del ${NSB_LO_IP6}
2351 setup_cmd ip -6 route add unreachable ${NSB_LO_IP6} metric 10
2352 setup_cmd ip -6 route add unreachable ${NSB_IP6} metric 10
2355 run_cmd ${ping6} -c1 -w1 ${a}
2359 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2365 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2373 setup_cmd ip -6 ro del unreachable ${NSB_LO_IP6}
2374 setup_cmd ip -6 ro del unreachable ${NSB_IP6}
2377 run_cmd ${ping6} -c1 -w1 ${a}
2381 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2398 run_cmd ${ping6} -c1 -w1 -I ${VRF} ${a}
2406 run_cmd ${ping6} -c1 -w1 ${a}
2413 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2420 run_cmd ip vrf exec ${VRF} ${ping6} -c1 -w1 -I ${VRF_IP6} ${a}
2430 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2436 show_hint "Fails since loopback address is out of VRF scope"
2437 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2447 run_cmd ${ping6} -c1 -w1 -I ${VRF} ${a}
2454 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2458 # LLA to GUA - remove ipv6 global addresses from ns-B
2459 setup_cmd_nsb ip -6 addr del ${NSB_IP6}/64 dev ${NSB_DEV}
2460 setup_cmd_nsb ip -6 addr del ${NSB_LO_IP6}/128 dev lo
2461 setup_cmd_nsb ip -6 ro add ${NSA_IP6}/128 via ${NSA_LINKIP6} dev ${NSB_DEV}
2466 run_cmd_nsb ${ping6} -c1 -w1 ${NSA_IP6}
2470 setup_cmd_nsb ip -6 ro del ${NSA_IP6}/128 via ${NSA_LINKIP6} dev ${NSB_DEV}
2471 setup_cmd_nsb ip -6 addr add ${NSB_IP6}/64 dev ${NSB_DEV}
2472 setup_cmd_nsb ip -6 addr add ${NSB_LO_IP6}/128 dev lo
2478 setup_cmd ip -6 rule add pref 50 to ${NSB_LO_IP6} prohibit
2479 setup_cmd ip -6 rule add pref 51 from ${NSB_IP6} prohibit
2482 run_cmd ${ping6} -c1 -w1 ${a}
2486 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2492 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2496 setup_cmd ip -6 rule del pref 50 to ${NSB_LO_IP6} prohibit
2497 setup_cmd ip -6 rule del pref 51 from ${NSB_IP6} prohibit
2503 setup_cmd ip -6 ro del ${NSB_LO_IP6} vrf ${VRF}
2506 run_cmd ${ping6} -c1 -w1 ${a}
2510 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2513 ip -netns ${NSB} -6 ro del ${NSA_LO_IP6}
2516 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2524 log_subsection "No VRF"
2553 run_cmd nettest -6 -s -M ${MD5_PW} -m ${NSB_IP6} &
2555 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2561 run_cmd nettest -6 -s &
2563 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2564 log_test $? 2 "MD5: Server no config, client uses password"
2569 run_cmd nettest -6 -s -M ${MD5_PW} -m ${NSB_IP6} &
2571 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW}
2577 run_cmd nettest -6 -s -M ${MD5_PW} -m ${NSB_LO_IP6} &
2579 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2583 # MD5 extension - prefix length
2588 run_cmd nettest -6 -s -M ${MD5_PW} -m ${NS_NET6} &
2590 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2596 run_cmd nettest -6 -s -M ${MD5_PW} -m ${NS_NET6} &
2598 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW}
2604 run_cmd nettest -6 -s -M ${MD5_PW} -m ${NS_NET6} &
2606 run_cmd_nsb nettest -6 -c ${NSB_LO_IP6} -r ${NSA_IP6} -X ${MD5_PW}
2621 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} &
2623 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2629 run_cmd nettest -6 -s -I ${VRF} &
2631 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2632 log_test $? 2 "MD5: VRF: Server no config, client uses password"
2637 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} &
2639 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW}
2645 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_LO_IP6} &
2647 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2651 # MD5 extension - prefix length
2656 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} &
2658 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2664 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} &
2666 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW}
2672 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} &
2674 run_cmd_nsb nettest -6 -c ${NSB_LO_IP6} -r ${NSA_IP6} -X ${MD5_PW}
2682 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} &
2683 run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NSB_IP6} &
2685 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2689 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} &
2690 run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NSB_IP6} &
2692 run_cmd_nsc nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW}
2697 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} &
2698 run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NSB_IP6} &
2700 run_cmd_nsc nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2705 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NSB_IP6} &
2706 run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NSB_IP6} &
2708 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW}
2712 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} &
2713 run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NS_NET6} &
2715 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2719 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} &
2720 run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NS_NET6} &
2722 run_cmd_nsc nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW}
2727 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} &
2728 run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NS_NET6} &
2730 run_cmd_nsc nettest -6 -r ${NSA_IP6} -X ${MD5_PW}
2735 run_cmd nettest -6 -s -I ${VRF} -M ${MD5_PW} -m ${NS_NET6} &
2736 run_cmd nettest -6 -s -M ${MD5_WRONG_PW} -m ${NS_NET6} &
2738 run_cmd_nsb nettest -6 -r ${NSA_IP6} -X ${MD5_WRONG_PW}
2745 run_cmd nettest -6 -s -I ${NSA_DEV} -M ${MD5_PW} -m ${NSB_IP6}
2746 log_test $? 1 "MD5: VRF: Device must be a VRF - single address"
2749 run_cmd nettest -6 -s -I ${NSA_DEV} -M ${MD5_PW} -m ${NS_NET6}
2750 log_test $? 1 "MD5: VRF: Device must be a VRF - prefix"
2764 run_cmd nettest -6 -s &
2766 run_cmd_nsb nettest -6 -r ${a}
2775 run_cmd_nsb nettest -6 -r ${a}
2776 log_test_addr ${a} $? 1 "No server"
2785 run_cmd_nsb nettest -6 -s &
2787 run_cmd nettest -6 -r ${a}
2794 run_cmd_nsb nettest -6 -s &
2796 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
2804 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
2805 log_test_addr ${a} $? 1 "No server, device client"
2814 run_cmd nettest -6 -s &
2816 run_cmd nettest -6 -r ${a}
2822 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
2824 run_cmd nettest -6 -r ${a} -0 ${a}
2830 show_hint "Should fail 'Connection refused' since addresses on loopback are out of device scope"
2831 run_cmd nettest -6 -s -I ${NSA_DEV} &
2833 run_cmd nettest -6 -r ${a}
2839 run_cmd nettest -6 -s &
2841 run_cmd nettest -6 -r ${a} -d ${NSA_DEV} -0 ${a}
2847 show_hint "Should fail 'Connection refused' since addresses on loopback are out of device scope"
2848 run_cmd nettest -6 -s &
2850 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
2857 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
2859 run_cmd nettest -6 -d ${NSA_DEV} -r ${a}
2867 run_cmd nettest -6 -d ${NSA_DEV} -r ${a}
2868 log_test_addr ${a} $? 1 "No server, device client, local conn"
2890 run_cmd nettest -6 -s &
2892 run_cmd_nsb nettest -6 -r ${a}
2899 run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} &
2901 run_cmd_nsb nettest -6 -r ${a}
2908 run_cmd nettest -6 -s -I ${VRF} -3 ${NSA_DEV} &
2910 run_cmd_nsb nettest -6 -r ${a}
2916 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
2918 run_cmd_nsb nettest -6 -r ${a}
2927 run_cmd_nsb nettest -6 -r ${a}
2928 log_test_addr ${a} $? 1 "No server"
2935 run_cmd nettest -6 -s &
2937 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
2956 run_cmd nettest -6 -s -3 ${VRF} &
2958 run_cmd_nsb nettest -6 -r ${a}
2965 run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} &
2967 run_cmd_nsb nettest -6 -r ${a}
2974 run_cmd nettest -6 -s -3 ${NSA_DEV} &
2976 run_cmd_nsb nettest -6 -r ${a}
2980 run_cmd nettest -6 -s -I ${VRF} -3 ${NSA_DEV} &
2982 run_cmd_nsb nettest -6 -r ${a}
2988 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
2990 run_cmd_nsb nettest -6 -r ${a}
2999 run_cmd_nsb nettest -6 -r ${a}
3000 log_test_addr ${a} $? 1 "No server"
3008 run_cmd nettest -6 -s -I ${VRF} &
3010 run_cmd nettest -6 -r ${a}
3021 run_cmd_nsb nettest -6 -s &
3023 run_cmd nettest -6 -r ${a} -d ${VRF}
3030 run_cmd_nsb nettest -6 -s &
3032 run_cmd nettest -6 -r ${a} -d ${VRF}
3038 run_cmd_nsb nettest -6 -s &
3040 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
3048 run_cmd nettest -6 -r ${a} -d ${VRF}
3049 log_test_addr ${a} $? 1 "No server, VRF client"
3056 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
3057 log_test_addr ${a} $? 1 "No server, device client"
3063 run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} &
3065 run_cmd nettest -6 -r ${a} -d ${VRF} -0 ${a}
3071 run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} &
3073 run_cmd nettest -6 -r ${a} -d ${NSA_DEV} -0 ${a}
3079 run_cmd nettest -6 -s -I ${VRF} &
3081 run_cmd nettest -6 -r ${a}
3085 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
3087 run_cmd nettest -6 -r ${a} -d ${VRF} -0 ${a}
3093 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
3095 run_cmd nettest -6 -r ${a} -d ${NSA_DEV} -0 ${a}
3103 log_subsection "No VRF"
3106 # tcp_l3mdev_accept should have no affect without VRF;
3133 run_cmd nettest -6 -D -s -3 ${NSA_DEV} &
3135 run_cmd_nsb nettest -6 -D -r ${a}
3139 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3141 run_cmd_nsb nettest -6 -D -r ${a}
3147 run_cmd nettest -6 -D -s -3 ${NSA_DEV} &
3149 run_cmd_nsb nettest -6 -D -r ${a}
3152 # should fail since loopback address is out of scope for a device
3153 # bound server, but it does not - hence this is more documenting
3156 #show_hint "Should fail since loopback address is out of scope"
3157 #run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3159 #run_cmd_nsb nettest -6 -D -r ${a}
3162 # negative test - should fail
3166 show_hint "Should fail 'Connection refused' since there is no server"
3167 run_cmd_nsb nettest -6 -D -r ${a}
3168 log_test_addr ${a} $? 1 "No server"
3177 run_cmd_nsb nettest -6 -D -s &
3179 run_cmd nettest -6 -D -r ${a} -0 ${NSA_IP6}
3183 run_cmd_nsb nettest -6 -D -s &
3185 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -0 ${NSA_IP6}
3189 run_cmd_nsb nettest -6 -D -s &
3191 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -C -0 ${NSA_IP6}
3195 run_cmd_nsb nettest -6 -D -s &
3197 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -S -0 ${NSA_IP6}
3202 run_cmd nettest -6 -D -r ${a}
3203 log_test_addr ${a} $? 1 "No server, unbound client"
3207 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV}
3208 log_test_addr ${a} $? 1 "No server, device client"
3217 run_cmd nettest -6 -D -s &
3219 run_cmd nettest -6 -D -r ${a} -0 ${a} -1 ${a}
3225 run_cmd nettest -6 -s -D -I ${NSA_DEV} -3 ${NSA_DEV} &
3227 run_cmd nettest -6 -D -r ${a}
3234 run_cmd nettest -6 -s -D -I ${NSA_DEV} &
3236 run_cmd nettest -6 -D -r ${a}
3242 run_cmd nettest -6 -s -D &
3244 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3248 run_cmd nettest -6 -s -D &
3250 run_cmd nettest -6 -D -d ${NSA_DEV} -C -r ${a}
3254 run_cmd nettest -6 -s -D &
3256 run_cmd nettest -6 -D -d ${NSA_DEV} -S -r ${a}
3262 show_hint "Should fail 'No route to host' since addresses on loopback are out of device scope"
3263 run_cmd nettest -6 -D -s &
3265 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV}
3269 show_hint "Should fail 'No route to host' since addresses on loopback are out of device scope"
3270 run_cmd nettest -6 -D -s &
3272 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -C
3276 show_hint "Should fail 'No route to host' since addresses on loopback are out of device scope"
3277 run_cmd nettest -6 -D -s &
3279 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -S
3283 show_hint "Should fail 'No route to host' since addresses on loopback are out of device scope"
3284 run_cmd nettest -6 -D -s &
3286 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -S -U
3292 run_cmd nettest -6 -D -s -I ${NSA_DEV} -3 ${NSA_DEV} &
3294 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a} -0 ${a}
3299 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3300 log_test_addr ${a} $? 1 "No server, device client, local conn"
3303 run_cmd_nsb ip -6 addr del ${NSB_IP6}/64 dev ${NSB_DEV}
3304 run_cmd_nsb ip -6 ro add ${NSA_IP6}/128 dev ${NSB_DEV}
3306 run_cmd nettest -6 -s -D &
3308 run_cmd_nsb nettest -6 -D -r ${NSA_IP6}
3309 log_test $? 0 "UDP in - LLA to GUA"
3311 run_cmd_nsb ip -6 ro del ${NSA_IP6}/128 dev ${NSB_DEV}
3312 run_cmd_nsb ip -6 addr add ${NSB_IP6}/64 dev ${NSB_DEV} nodad
3330 run_cmd nettest -6 -D -s &
3332 run_cmd_nsb nettest -6 -D -r ${a}
3339 run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} &
3341 run_cmd_nsb nettest -6 -D -r ${a}
3348 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3350 run_cmd_nsb nettest -6 -D -r ${a}
3354 # negative test - should fail
3358 show_hint "Should fail 'Connection refused' since there is no server"
3359 run_cmd_nsb nettest -6 -D -r ${a}
3360 log_test_addr ${a} $? 1 "No server"
3370 run_cmd nettest -6 -D -s &
3372 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3379 run_cmd nettest -6 -D -I ${VRF} -s &
3381 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3388 run_cmd nettest -6 -D -s &
3390 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3394 run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} &
3396 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3400 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3402 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3406 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3408 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3421 run_cmd nettest -6 -D -s -3 ${NSA_DEV} &
3423 run_cmd_nsb nettest -6 -D -r ${a}
3430 run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} &
3432 run_cmd_nsb nettest -6 -D -r ${a}
3439 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3441 run_cmd_nsb nettest -6 -D -r ${a}
3445 # negative test - should fail
3449 run_cmd_nsb nettest -6 -D -r ${a}
3450 log_test_addr ${a} $? 1 "No server"
3457 run_cmd_nsb nettest -6 -D -s &
3459 run_cmd nettest -6 -D -d ${VRF} -r ${NSB_IP6}
3462 # negative test - should fail
3464 run_cmd nettest -6 -D -d ${VRF} -r ${NSB_IP6}
3465 log_test $? 1 "No server, VRF client"
3468 run_cmd_nsb nettest -6 -D -s &
3470 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSB_IP6}
3473 # negative test - should fail
3475 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSB_IP6}
3476 log_test $? 1 "No server, enslaved device client"
3483 run_cmd nettest -6 -D -s -3 ${NSA_DEV} &
3485 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3489 run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} &
3491 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3497 run_cmd nettest -6 -D -s -3 ${VRF} &
3499 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3503 run_cmd nettest -6 -D -I ${VRF} -s -3 ${VRF} &
3505 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3508 # negative test - should fail
3512 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3513 log_test_addr ${a} $? 1 "No server, VRF client, local conn"
3519 run_cmd nettest -6 -D -s -3 ${NSA_DEV} &
3521 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3525 run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} &
3527 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3531 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3533 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3537 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3539 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3543 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3544 log_test_addr ${a} $? 1 "No server, device client, local conn"
3549 run_cmd nettest -6 -D -s &
3551 run_cmd_nsb nettest -6 -D -d ${NSB_DEV} -r ${NSA_LINKIP6}
3555 run_cmd_nsb nettest -6 -D -d ${NSB_DEV} -r ${NSA_LINKIP6}
3556 log_test $? 1 "No server, linklocal IP"
3560 run_cmd_nsb nettest -6 -D -s &
3562 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSB_LINKIP6}
3566 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSB_LINKIP6}
3567 log_test $? 1 "No server, device client, peer linklocal IP"
3571 run_cmd nettest -6 -D -s &
3573 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSA_LINKIP6}
3574 log_test $? 0 "Enslaved device client, local conn - linklocal IP"
3577 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSA_LINKIP6}
3578 log_test $? 1 "No server, device client, local conn - linklocal IP"
3581 run_cmd_nsb ip -6 addr del ${NSB_IP6}/64 dev ${NSB_DEV}
3582 run_cmd_nsb ip -6 ro add ${NSA_IP6}/128 dev ${NSB_DEV}
3584 run_cmd nettest -6 -s -D &
3586 run_cmd_nsb nettest -6 -D -r ${NSA_IP6}
3587 log_test $? 0 "UDP in - LLA to GUA"
3589 run_cmd_nsb ip -6 ro del ${NSA_IP6}/128 dev ${NSB_DEV}
3590 run_cmd_nsb ip -6 addr add ${NSB_IP6}/64 dev ${NSB_DEV} nodad
3599 log_subsection "No VRF"
3602 # udp_l3mdev_accept should have no affect without VRF;
3627 run_cmd nettest -6 -s -R -P ipv6-icmp -l ${a} -b
3631 run_cmd nettest -6 -s -R -P ipv6-icmp -l ${a} -I ${NSA_DEV} -b
3640 run_cmd nettest -6 -s -R -P icmp -f -l ${a} -I ${NSA_DEV} -b
3648 run_cmd nettest -6 -s -l ${a} -t1 -b
3652 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
3656 # binding to an address not on the device. So this test passes
3661 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
3673 run_cmd nettest -6 -s -R -P ipv6-icmp -l ${a} -I ${VRF} -b
3677 run_cmd nettest -6 -s -R -P ipv6-icmp -l ${a} -I ${NSA_DEV} -b
3683 show_hint "Address on loopback is out of VRF scope"
3684 run_cmd nettest -6 -s -R -P ipv6-icmp -l ${a} -I ${VRF} -b
3692 run_cmd nettest -6 -s -R -P icmp -f -l ${a} -I ${VRF} -b
3702 run_cmd nettest -6 -s -l ${a} -I ${VRF} -t1 -b
3708 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
3713 # is that the address is valid in the L3 domain. So this test
3718 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
3723 show_hint "Address on loopback out of scope for VRF"
3724 run_cmd nettest -6 -s -l ${a} -I ${VRF} -t1 -b
3728 show_hint "Address on loopback out of scope for device in VRF"
3729 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
3738 log_subsection "No VRF"
3753 local varg="-6 $2"
3763 run_cmd nettest ${varg} -s &
3765 run_cmd_nsb nettest ${varg} -r ${a} &
3777 run_cmd nettest ${varg} -I ${VRF} -s &
3779 run_cmd_nsb nettest ${varg} -r ${a} &
3791 run_cmd nettest ${varg} -I ${NSA_DEV} -s &
3793 run_cmd_nsb nettest ${varg} -r ${a} &
3803 # client test
3806 run_cmd_nsb nettest ${varg} -s &
3808 run_cmd nettest ${varg} -d ${VRF} -r ${NSB_IP6} &
3817 run_cmd_nsb nettest ${varg} -s &
3819 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${NSB_IP6} &
3834 run_cmd nettest ${varg} -s &
3836 run_cmd nettest ${varg} -d ${VRF} -r ${a} &
3848 run_cmd nettest ${varg} -I ${VRF} -s &
3850 run_cmd nettest ${varg} -d ${VRF} -r ${a} &
3861 run_cmd nettest ${varg} -s &
3863 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
3872 run_cmd nettest ${varg} -I ${VRF} -s &
3874 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
3883 run_cmd nettest ${varg} -I ${NSA_DEV} -s &
3885 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
3899 run_cmd_nsb ${ping6} -f ${a} &
3903 log_test_addr ${a} 0 0 "Device delete with active traffic - ping in"
3908 run_cmd ${ping6} -f ${NSB_IP6} -I ${VRF} &
3912 log_test_addr ${a} 0 0 "Device delete with active traffic - ping out"
3917 log_section "Run time tests - ipv6"
3923 ipv6_rt "TCP active socket" "-n -1"
3926 ipv6_rt "TCP passive socket" "-i"
3929 ipv6_rt "UDP active socket" "-D -n -1"
3942 run_cmd nettest -s &
3944 run_cmd_nsb nettest -r ${a}
3945 log_test_addr ${a} $? 1 "Global server, reject with TCP-reset on Rx"
3955 [ "${stype}" = "UDP" ] && arg="-D"
3960 run_cmd nettest ${arg} -s &
3962 run_cmd_nsb nettest ${arg} -r ${a}
3963 log_test_addr ${a} $? 1 "Global ${stype} server, Rx reject icmp-port-unreach"
3973 run_cmd iptables -A INPUT -p tcp --dport 12345 -j REJECT --reject-with tcp-reset
3981 run_cmd iptables -F
3982 run_cmd iptables -A INPUT -p tcp --dport 12345 -j REJECT --reject-with icmp-port-unreachable
3983 run_cmd iptables -A INPUT -p udp --dport 12345 -j REJECT --reject-with icmp-port-unreachable
3989 iptables -F
3999 run_cmd nettest -6 -s &
4001 run_cmd_nsb nettest -6 -r ${a}
4002 log_test_addr ${a} $? 1 "Global server, reject with TCP-reset on Rx"
4012 [ "${stype}" = "UDP" ] && arg="$arg -D"
4017 run_cmd nettest -6 -s ${arg} &
4019 run_cmd_nsb nettest -6 ${arg} -r ${a}
4020 log_test_addr ${a} $? 1 "Global ${stype} server, Rx reject icmp-port-unreach"
4030 run_cmd ip6tables -A INPUT -p tcp --dport 12345 -j REJECT --reject-with tcp-reset
4037 run_cmd ip6tables -F
4038 run_cmd ip6tables -A INPUT -p tcp --dport 12345 -j REJECT --reject-with icmp6-port-unreachable
4039 run_cmd ip6tables -A INPUT -p udp --dport 12345 -j REJECT --reject-with icmp6-port-unreachable
4045 ip6tables -F
4052 # ns-A device enslaved to bridge. Verify traffic with and without
4060 setup_cmd ip -6 addr del dev ${NSA_DEV} ${NSA_IP6}/64
4064 setup_cmd ip -6 addr add dev br0 ${NSA_IP6}/64 nodad
4075 run_cmd ping -c1 -w1 -I br0 ${NSB_IP}
4076 log_test $? 0 "Bridge into VRF - IPv4 ping out"
4079 run_cmd ${ping6} -c1 -w1 -I br0 ${NSB_IP6}
4080 log_test $? 0 "Bridge into VRF - IPv6 ping out"
4083 run_cmd_nsb ping -c1 -w1 ${NSA_IP}
4084 log_test $? 0 "Bridge into VRF - IPv4 ping in"
4087 run_cmd_nsb ${ping6} -c1 -w1 ${NSA_IP6}
4088 log_test $? 0 "Bridge into VRF - IPv6 ping in"
4091 if [ $? -eq 0 ]; then
4093 run_cmd ping -c1 -w1 -I br0 ${NSB_IP}
4094 log_test $? 0 "Bridge into VRF with br_netfilter - IPv4 ping out"
4097 run_cmd ${ping6} -c1 -w1 -I br0 ${NSB_IP6}
4098 log_test $? 0 "Bridge into VRF with br_netfilter - IPv6 ping out"
4101 run_cmd_nsb ping -c1 -w1 ${NSA_IP}
4102 log_test $? 0 "Bridge into VRF with br_netfilter - IPv4 ping in"
4105 run_cmd_nsb ${ping6} -c1 -w1 ${NSA_IP6}
4106 log_test $? 0 "Bridge into VRF with br_netfilter - IPv6 ping in"
4113 setup_cmd ip -6 addr add dev br0.100 2001:db8:101::1/64 nodad
4117 setup_cmd_nsb ip -6 addr add dev vlan100 2001:db8:101::2/64 nodad
4124 run_cmd ping -c1 -w1 -I br0.100 172.16.101.2
4125 log_test $? 0 "Bridge vlan into VRF - IPv4 ping out"
4128 run_cmd ${ping6} -c1 -w1 -I br0.100 2001:db8:101::2
4129 log_test $? 0 "Bridge vlan into VRF - IPv6 ping out"
4132 run_cmd_nsb ping -c1 -w1 172.16.101.1
4133 log_test $? 0 "Bridge vlan into VRF - IPv4 ping in"
4136 run_cmd_nsb ${ping6} -c1 -w1 2001:db8:101::1
4137 log_test $? 0 "Bridge vlan into VRF - IPv6 ping in"
4140 if [ $? -eq 0 ]; then
4142 run_cmd ping -c1 -w1 -I br0.100 172.16.101.2
4143 log_test $? 0 "Bridge vlan into VRF with br_netfilter - IPv4 ping out"
4146 run_cmd ${ping6} -c1 -w1 -I br0.100 2001:db8:101::2
4147 log_test $? 0 "Bridge vlan into VRF with br_netfilter - IPv6 ping out"
4150 run_cmd_nsb ping -c1 -w1 172.16.101.1
4151 log_test $? 0 "Bridge vlan into VRF - IPv4 ping in"
4154 run_cmd_nsb ${ping6} -c1 -w1 2001:db8:101::1
4155 log_test $? 0 "Bridge vlan into VRF - IPv6 ping in"
4163 # ns-A device is connected to both ns-B and ns-C on a single VRF but only has
4168 # only want reply from ns-A
4169 setup_cmd_nsb sysctl -qw net.ipv6.icmp.echo_ignore_multicast=1
4170 setup_cmd_nsc sysctl -qw net.ipv6.icmp.echo_ignore_multicast=1
4173 run_cmd_nsb ping -c1 -w1 ${MCAST}%${NSB_DEV}
4174 log_test_addr ${MCAST}%${NSB_DEV} $? 0 "Pre cycle, ping out ns-B"
4176 run_cmd_nsc ping -c1 -w1 ${MCAST}%${NSC_DEV}
4177 log_test_addr ${MCAST}%${NSC_DEV} $? 0 "Pre cycle, ping out ns-C"
4179 # cycle/flap the first ns-A interface
4185 run_cmd_nsb ping -c1 -w1 ${MCAST}%${NSB_DEV}
4186 log_test_addr ${MCAST}%${NSB_DEV} $? 0 "Post cycle ${NSA} ${NSA_DEV}, ping out ns-B"
4187 run_cmd_nsc ping -c1 -w1 ${MCAST}%${NSC_DEV}
4188 log_test_addr ${MCAST}%${NSC_DEV} $? 0 "Post cycle ${NSA} ${NSA_DEV}, ping out ns-C"
4190 # cycle/flap the second ns-A interface
4196 run_cmd_nsb ping -c1 -w1 ${MCAST}%${NSB_DEV}
4197 log_test_addr ${MCAST}%${NSB_DEV} $? 0 "Post cycle ${NSA} ${NSA_DEV2}, ping out ns-B"
4198 run_cmd_nsc ping -c1 -w1 ${MCAST}%${NSC_DEV}
4199 log_test_addr ${MCAST}%${NSC_DEV} $? 0 "Post cycle ${NSA} ${NSA_DEV2}, ping out ns-C"
4202 # Perform IPv{4,6} SNAT on ns-A, and verify TCP connection is successfully
4203 # established with ns-B.
4210 …run_cmd iptables -t nat -A POSTROUTING -p tcp -m tcp --dport ${port} -j SNAT --to-source ${NSA_LO_…
4211 …run_cmd ip6tables -t nat -A POSTROUTING -p tcp -m tcp --dport ${port} -j SNAT --to-source ${NSA_LO…
4213 run_cmd_nsb nettest -s -l ${NSB_IP} -p ${port} &
4215 run_cmd nettest -d ${VRF} -r ${NSB_IP} -p ${port}
4218 run_cmd_nsb nettest -6 -s -l ${NSB_IP6} -p ${port} &
4220 run_cmd nettest -6 -d ${VRF} -r ${NSB_IP6} -p ${port}
4224 …run_cmd iptables -t nat -D POSTROUTING -p tcp -m tcp --dport ${port} -j SNAT --to-source ${NSA_LO_…
4225 …run_cmd ip6tables -t nat -D POSTROUTING -p tcp -m tcp --dport ${port} -j SNAT --to-source ${NSA_LO…
4247 -4 IPv4 tests only
4248 -6 IPv6 tests only
4249 -t <test> Test name/set to run
4250 -p Pause on fail
4251 -P Pause after each test
4252 -v Be verbose
4266 PAUSE_ON_FAIL=no
4267 PAUSE=no
4284 [ "${PAUSE}" = "yes" ] && PAUSE_ON_FAIL=no
4287 # show user test config
4289 if [ -z "$TESTS" ]; then
4306 declare -i nfail=0
4307 declare -i nsuccess=0
4339 if [ $nfail -ne 0 ]; then
4341 elif [ $nsuccess -eq 0 ]; then