Lines Matching +full:6 +full:a

13 #   6. VRF and non-VRF permutations
16 # ns-A | ns-B
23 # ns-A:
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
85 NSA=ns-A
122 read a
123 [ "$a" = "q" ] && exit 1
130 read a
131 [ "$a" = "q" ] && exit 1
211 if [ "$VERBOSE" = "1" -a -n "$out" ]; then
249 read a
271 read a
293 read a
299 # set sysctl values in NS-A
307 # get sysctl values in NS-A
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";;
355 addr=$(ip -netns ${ns} -6 -br addr show dev ${dev} | \
386 ip -netns ${ns} -6 route add vrf ${vrf} unreachable default metric 8192
389 ip -netns ${ns} -6 addr add ::1 dev ${vrf} nodad
394 ip -netns ${ns} -6 addr add dev ${vrf} ${addr6}
399 ip -netns ${ns} -6 ru del pref 0
400 ip -netns ${ns} -6 ru add pref 32765 from all lookup local
416 ip -netns ${ns} -6 addr add dev lo ${addr6}
420 ip -netns ${ns} -6 ro add unreachable default metric 8192
436 local ns2_dev=$6
465 ip -netns ${NSA} -6 addr flush dev ${NSA_DEV}
489 # ns-B but for a device NOT in the VRF
499 # make sure we are starting with a clean slate
514 # tell ns-A how to get to remote addresses of ns-B
520 ip -netns ${NSA} -6 ro add vrf ${VRF} ${NSB_LO_IP6}/128 via ${NSB_IP6} dev ${NSA_DEV}
523 ip -netns ${NSB} -6 ro add ${VRF_IP6}/128 via ${NSA_IP6} dev ${NSB_DEV}
530 # tell ns-B how to get to remote addresses of ns-A
541 # make sure we are starting with a clean slate
574 local a
579 for a in ${NSB_IP} ${NSB_LO_IP}
582 run_cmd ping -c1 -w1 ${a}
583 log_test_addr ${a} $? 0 "ping out"
586 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
587 log_test_addr ${a} $? 0 "ping out, device bind"
590 run_cmd ping -c1 -w1 -I ${NSA_LO_IP} ${a}
591 log_test_addr ${a} $? 0 "ping out, address bind"
597 a=${NSB_IP}
599 run_cmd ping -c 1 -w 1 -r ${a}
600 log_test_addr ${a} $? 0 "ping out (don't route), peer on link"
602 a=${NSB_LO_IP}
605 run_cmd ping -c 1 -w 1 -r ${a}
606 log_test_addr ${a} $? 1 "ping out (don't route), peer not on link"
611 for a in ${NSA_IP} ${NSA_LO_IP}
614 run_cmd_nsb ping -c1 -w1 ${a}
615 log_test_addr ${a} $? 0 "ping in"
621 for a in ${NSA_IP} ${NSA_LO_IP} 127.0.0.1
624 run_cmd ping -c1 -w1 ${a}
625 log_test_addr ${a} $? 0 "ping local"
632 a=${NSA_IP}
634 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
635 log_test_addr ${a} $? 0 "ping local, device bind"
638 # fails in a really weird way though because ipv4 special cases
640 for a in ${NSA_LO_IP} 127.0.0.1
644 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
645 log_test_addr ${a} $? 1 "ping local, device bind"
657 a=${NSB_LO_IP}
658 run_cmd ping -c1 -w1 ${a}
659 log_test_addr ${a} $? 2 "ping out, blocked by rule"
662 # a viable rtable if the oif (e.g., bind to device) is set, so this
664 # run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
666 a=${NSA_LO_IP}
669 run_cmd_nsb ping -c1 -w1 ${a}
670 log_test_addr ${a} $? 1 "ping in, blocked by rule"
685 a=${NSB_LO_IP}
686 run_cmd ping -c1 -w1 ${a}
687 log_test_addr ${a} $? 2 "ping out, blocked by route"
690 # a viable rtable if the oif (e.g., bind to device) is set, so this
691 # case succeeds despite not having a route for the address
692 # run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
694 a=${NSA_LO_IP}
697 run_cmd_nsb ping -c1 -w1 ${a}
698 log_test_addr ${a} $? 1 "ping in, blocked by route"
706 a=${NSB_LO_IP}
707 run_cmd ping -c1 -w1 ${a}
708 log_test_addr ${a} $? 2 "ping out, unreachable default route"
711 # a viable rtable if the oif (e.g., bind to device) is set, so this
712 # case succeeds despite not having a route for the address
713 # run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
718 local a
726 for a in ${NSB_IP} ${NSB_LO_IP}
729 run_cmd ping -c1 -w1 -I ${VRF} ${a}
730 log_test_addr ${a} $? 0 "ping out, VRF bind"
733 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
734 log_test_addr ${a} $? 0 "ping out, device bind"
737 run_cmd ip vrf exec ${VRF} ping -c1 -w1 -I ${NSA_IP} ${a}
738 log_test_addr ${a} $? 0 "ping out, vrf device + dev address bind"
741 run_cmd ip vrf exec ${VRF} ping -c1 -w1 -I ${VRF_IP} ${a}
742 log_test_addr ${a} $? 0 "ping out, vrf device + vrf address bind"
748 for a in ${NSA_IP} ${VRF_IP}
751 run_cmd_nsb ping -c1 -w1 ${a}
752 log_test_addr ${a} $? 0 "ping in"
758 for a in ${NSA_IP} ${VRF_IP} 127.0.0.1
761 show_hint "Source address should be ${a}"
762 run_cmd ping -c1 -w1 -I ${VRF} ${a}
763 log_test_addr ${a} $? 0 "ping local, VRF bind"
770 a=${NSA_IP}
772 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
773 log_test_addr ${a} $? 0 "ping local, device bind"
776 for a in ${VRF_IP} 127.0.0.1
780 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
781 log_test_addr ${a} $? 2 "ping local, device bind"
791 a=${NSB_LO_IP}
792 run_cmd ping -c1 -w1 -I ${VRF} ${a}
793 log_test_addr ${a} $? 2 "ping out, vrf bind, blocked by rule"
796 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
797 log_test_addr ${a} $? 2 "ping out, device bind, blocked by rule"
799 a=${NSA_LO_IP}
802 run_cmd_nsb ping -c1 -w1 ${a}
803 log_test_addr ${a} $? 1 "ping in, blocked by rule"
815 a=${NSB_LO_IP}
816 run_cmd ping -c1 -w1 -I ${VRF} ${a}
817 log_test_addr ${a} $? 2 "ping out, vrf bind, unreachable route"
820 run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
821 log_test_addr ${a} $? 2 "ping out, device bind, unreachable route"
823 a=${NSA_LO_IP}
826 run_cmd_nsb ping -c1 -w1 ${a}
827 log_test_addr ${a} $? 1 "ping in, unreachable route"
992 # duplicate config between default VRF and a VRF
1060 log_test $? 1 "MD5: VRF: Device must be a VRF - single address"
1064 log_test $? 1 "MD5: VRF: Device must be a VRF - prefix"
1127 local a
1132 # on link (doesn't need to be routed through a gateway).
1142 a=${NSB_IP}
1144 do_run_cmd nettest -B -N "${NSA}" -O "${NSB}" -r ${a} --client-dontroute
1145 log_test_addr ${a} $? 0 "SO_DONTROUTE client, syncookies=${syncookies}"
1147 a=${NSB_IP}
1149 do_run_cmd nettest -B -N "${NSA}" -O "${NSB}" -r ${a} --server-dontroute
1150 log_test_addr ${a} $? 0 "SO_DONTROUTE server, syncookies=${syncookies}"
1157 # to respond to a routed address and not a link local one).
1159 a=${NSB_LO_IP}
1162 do_run_cmd nettest -B -N "${NSA}" -O "${NSB}" -c "${NSA_LO_IP}" -r ${a} --client-dontroute
1163 log_test_addr ${a} $? 1 "SO_DONTROUTE client, syncookies=${syncookies}"
1165 a=${NSB_LO_IP}
1168 do_run_cmd nettest -B -N "${NSA}" -O "${NSB}" -c "${NSA_LO_IP}" -r ${a} --server-dontroute
1169 log_test_addr ${a} $? 2 "SO_DONTROUTE server, syncookies=${syncookies}"
1177 local a
1182 for a in ${NSA_IP} ${NSA_LO_IP}
1187 run_cmd_nsb nettest -r ${a}
1188 log_test_addr ${a} $? 0 "Global server"
1191 a=${NSA_IP}
1195 run_cmd_nsb nettest -r ${a}
1196 log_test_addr ${a} $? 0 "Device server"
1199 for a in ${NSA_IP} ${NSA_LO_IP}
1203 run_cmd_nsb nettest -r ${a}
1204 log_test_addr ${a} $? 1 "No server"
1210 for a in ${NSB_IP} ${NSB_LO_IP}
1215 run_cmd nettest -r ${a} -0 ${NSA_IP}
1216 log_test_addr ${a} $? 0 "Client"
1221 run_cmd nettest -r ${a} -d ${NSA_DEV}
1222 log_test_addr ${a} $? 0 "Client, device bind"
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"
1238 for a in ${NSA_IP} ${NSA_LO_IP} 127.0.0.1
1243 run_cmd nettest -r ${a} -0 ${a} -1 ${a}
1244 log_test_addr ${a} $? 0 "Global server, local connection"
1247 a=${NSA_IP}
1251 run_cmd nettest -r ${a} -0 ${a}
1252 log_test_addr ${a} $? 0 "Device server, unbound client, local connection"
1254 for a in ${NSA_LO_IP} 127.0.0.1
1260 run_cmd nettest -r ${a}
1261 log_test_addr ${a} $? 1 "Device server, unbound client, local connection"
1264 a=${NSA_IP}
1268 run_cmd nettest -r ${a} -0 ${a} -d ${NSA_DEV}
1269 log_test_addr ${a} $? 0 "Global server, device client, local connection"
1271 for a in ${NSA_LO_IP} 127.0.0.1
1277 run_cmd nettest -r ${a} -d ${NSA_DEV}
1278 log_test_addr ${a} $? 1 "Global server, device client, local connection"
1281 a=${NSA_IP}
1285 run_cmd nettest -d ${NSA_DEV} -r ${a} -0 ${a}
1286 log_test_addr ${a} $? 0 "Device server, device client, local connection"
1290 run_cmd nettest -d ${NSA_DEV} -r ${a}
1291 log_test_addr ${a} $? 1 "No server, device client, local conn"
1301 local a
1311 for a in ${NSA_IP} ${VRF_IP}
1317 run_cmd_nsb nettest -r ${a}
1318 log_test_addr ${a} $? 1 "Global server"
1323 run_cmd_nsb nettest -r ${a}
1324 log_test_addr ${a} $? 0 "VRF server"
1329 run_cmd_nsb nettest -r ${a}
1330 log_test_addr ${a} $? 0 "Device server"
1335 run_cmd_nsb nettest -r ${a}
1336 log_test_addr ${a} $? 1 "No server"
1341 a=${NSA_IP}
1346 run_cmd nettest -r ${a} -d ${NSA_DEV}
1347 log_test_addr ${a} $? 1 "Global server, local connection"
1362 for a in ${NSA_IP} ${VRF_IP}
1368 run_cmd_nsb nettest -r ${a}
1369 log_test_addr ${a} $? 0 "Global server"
1375 run_cmd_nsb nettest -r ${a}
1376 log_test_addr ${a} $? 0 "VRF server"
1381 run_cmd_nsb nettest -r ${a}
1382 log_test_addr ${a} $? 1 "No server"
1385 a=${NSA_IP}
1390 run_cmd_nsb nettest -r ${a}
1391 log_test_addr ${a} $? 0 "Device server"
1394 for a in ${NSA_IP} ${VRF_IP}
1400 run_cmd nettest -r ${a}
1401 log_test_addr ${a} $? 1 "Global server, local connection"
1407 for a in ${NSB_IP} ${NSB_LO_IP}
1412 run_cmd nettest -r ${a} -d ${VRF}
1413 log_test_addr ${a} $? 0 "Client, VRF bind"
1418 run_cmd nettest -r ${a} -d ${NSA_DEV}
1419 log_test_addr ${a} $? 0 "Client, device bind"
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"
1432 for a in ${NSA_IP} ${VRF_IP} 127.0.0.1
1437 run_cmd nettest -r ${a} -d ${VRF} -0 ${a}
1438 log_test_addr ${a} $? 0 "VRF server, VRF client, local connection"
1441 a=${NSA_IP}
1445 run_cmd nettest -r ${a} -d ${NSA_DEV} -0 ${a}
1446 log_test_addr ${a} $? 0 "VRF server, device client, local connection"
1452 run_cmd nettest -r ${a}
1453 log_test_addr ${a} $? 1 "VRF server, unbound client, local connection"
1458 run_cmd nettest -r ${a} -d ${VRF} -0 ${a}
1459 log_test_addr ${a} $? 0 "Device server, VRF client, local connection"
1464 run_cmd nettest -r ${a} -d ${NSA_DEV} -0 ${a}
1465 log_test_addr ${a} $? 0 "Device server, device client, local connection"
1493 local a
1498 for a in ${NSA_IP} ${NSA_LO_IP}
1503 run_cmd_nsb nettest -D -r ${a}
1504 log_test_addr ${a} $? 0 "Global server"
1508 run_cmd_nsb nettest -D -r ${a}
1509 log_test_addr ${a} $? 1 "No server"
1512 a=${NSA_IP}
1516 run_cmd_nsb nettest -D -r ${a}
1517 log_test_addr ${a} $? 0 "Device server"
1522 for a in ${NSB_IP} ${NSB_LO_IP}
1527 run_cmd nettest -D -r ${a} -0 ${NSA_IP}
1528 log_test_addr ${a} $? 0 "Client"
1533 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -0 ${NSA_IP}
1534 log_test_addr ${a} $? 0 "Client, device bind"
1539 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -C -0 ${NSA_IP}
1540 log_test_addr ${a} $? 0 "Client, device send via cmsg"
1545 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S -0 ${NSA_IP}
1546 log_test_addr ${a} $? 0 "Client, device bind via IP_UNICAST_IF"
1551 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S -0 ${NSA_IP} -U
1552 log_test_addr ${a} $? 0 "Client, device bind via IP_UNICAST_IF, with connect()"
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"
1569 for a in ${NSA_IP} ${NSA_LO_IP} 127.0.0.1
1574 run_cmd nettest -D -r ${a} -0 ${a} -1 ${a}
1575 log_test_addr ${a} $? 0 "Global server, local connection"
1578 a=${NSA_IP}
1582 run_cmd nettest -D -r ${a}
1583 log_test_addr ${a} $? 0 "Device server, unbound client, local connection"
1585 for a in ${NSA_LO_IP} 127.0.0.1
1591 run_cmd nettest -D -r ${a}
1592 log_test_addr ${a} $? 1 "Device server, unbound client, local connection"
1595 a=${NSA_IP}
1599 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1600 log_test_addr ${a} $? 0 "Global server, device client, local connection"
1605 run_cmd nettest -D -d ${NSA_DEV} -C -r ${a}
1606 log_test_addr ${a} $? 0 "Global server, device send via cmsg, local connection"
1611 run_cmd nettest -D -d ${NSA_DEV} -S -r ${a}
1612 log_test_addr ${a} $? 0 "Global server, device client via IP_UNICAST_IF, local connection"
1617 run_cmd nettest -D -d ${NSA_DEV} -S -r ${a} -U
1618 …log_test_addr ${a} $? 0 "Global server, device client via IP_UNICAST_IF, local connection, with co…
1624 for a in ${NSA_LO_IP} 127.0.0.1
1630 run_cmd nettest -D -r ${a} -d ${NSA_DEV}
1631 log_test_addr ${a} $? 2 "Global server, device client, local connection"
1637 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -C
1638 log_test_addr ${a} $? 1 "Global server, device send via cmsg, local connection"
1644 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S
1645 log_test_addr ${a} $? 1 "Global server, device client via IP_UNICAST_IF, local connection"
1651 run_cmd nettest -D -r ${a} -d ${NSA_DEV} -S -U
1652 …log_test_addr ${a} $? 1 "Global server, device client via IP_UNICAST_IF, local connection, with co…
1657 a=${NSA_IP}
1661 run_cmd nettest -D -d ${NSA_DEV} -r ${a} -0 ${a}
1662 log_test_addr ${a} $? 0 "Device server, device client, local conn"
1665 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1666 log_test_addr ${a} $? 2 "No server, device client, local conn"
1671 # on link (doesn't need to be routed through a gateway).
1674 a=${NSB_IP}
1676 do_run_cmd nettest -B -D -N "${NSA}" -O "${NSB}" -r ${a} --client-dontroute
1677 log_test_addr ${a} $? 0 "SO_DONTROUTE client"
1679 a=${NSB_LO_IP}
1682 do_run_cmd nettest -B -D -N "${NSA}" -O "${NSB}" -r ${a} --client-dontroute
1683 log_test_addr ${a} $? 1 "SO_DONTROUTE client"
1688 local a
1697 for a in ${NSA_IP} ${VRF_IP}
1700 show_hint "Fails because ingress is in a VRF and global server is disabled"
1703 run_cmd_nsb nettest -D -r ${a}
1704 log_test_addr ${a} $? 1 "Global server"
1709 run_cmd_nsb nettest -D -r ${a}
1710 log_test_addr ${a} $? 0 "VRF server"
1715 run_cmd_nsb nettest -D -r ${a}
1716 log_test_addr ${a} $? 0 "Enslaved device server"
1720 run_cmd_nsb nettest -D -r ${a}
1721 log_test_addr ${a} $? 1 "No server"
1727 run_cmd nettest -D -d ${VRF} -r ${a}
1728 log_test_addr ${a} $? 1 "Global server, VRF client, local connection"
1731 a=${NSA_IP}
1735 run_cmd nettest -D -d ${VRF} -r ${a}
1736 log_test_addr ${a} $? 0 "VRF server, VRF client, local conn"
1741 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1742 log_test_addr ${a} $? 0 "VRF server, enslaved device client, local connection"
1744 a=${NSA_IP}
1748 run_cmd nettest -D -d ${VRF} -r ${a}
1749 log_test_addr ${a} $? 0 "Enslaved device server, VRF client, local conn"
1754 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1755 log_test_addr ${a} $? 0 "Enslaved device server, device client, local conn"
1764 for a in ${NSA_IP} ${VRF_IP}
1769 run_cmd_nsb nettest -D -r ${a}
1770 log_test_addr ${a} $? 0 "Global server"
1775 run_cmd_nsb nettest -D -r ${a}
1776 log_test_addr ${a} $? 0 "VRF server"
1781 run_cmd_nsb nettest -D -r ${a}
1782 log_test_addr ${a} $? 0 "Enslaved device server"
1786 run_cmd_nsb nettest -D -r ${a}
1787 log_test_addr ${a} $? 1 "No server"
1819 a=${NSA_IP}
1823 run_cmd nettest -D -d ${VRF} -r ${a}
1824 log_test_addr ${a} $? 0 "Global server, VRF client, local conn"
1829 run_cmd nettest -D -d ${VRF} -r ${a}
1830 log_test_addr ${a} $? 0 "VRF server, VRF client, local conn"
1835 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1836 log_test_addr ${a} $? 0 "VRF server, device client, local conn"
1841 run_cmd nettest -D -d ${VRF} -r ${a}
1842 log_test_addr ${a} $? 0 "Enslaved device server, VRF client, local conn"
1847 run_cmd nettest -D -d ${NSA_DEV} -r ${a}
1848 log_test_addr ${a} $? 0 "Enslaved device server, device client, local conn"
1850 for a in ${VRF_IP} 127.0.0.1
1855 run_cmd nettest -D -d ${VRF} -r ${a}
1856 log_test_addr ${a} $? 0 "Global server, VRF client, local conn"
1859 for a in ${VRF_IP} 127.0.0.1
1864 run_cmd nettest -D -d ${VRF} -r ${a}
1865 log_test_addr ${a} $? 0 "VRF server, VRF client, local conn"
1870 for a in ${NSA_IP} ${VRF_IP} 127.0.0.1
1874 run_cmd nettest -D -d ${VRF} -r ${a}
1875 log_test_addr ${a} $? 1 "No server, VRF client, local conn"
1910 for a in ${NSA_IP} ${NSA_LO_IP}
1913 run_cmd nettest -s -R -P icmp -l ${a} -b
1914 log_test_addr ${a} $? 0 "Raw socket bind to local address"
1917 run_cmd nettest -s -R -P icmp -l ${a} -I ${NSA_DEV} -b
1918 log_test_addr ${a} $? 0 "Raw socket bind to local address after device bind"
1924 a=${NL_IP}
1926 run_cmd nettest -s -R -f -l ${a} -b
1927 log_test_addr ${a} $? 0 "Raw socket bind to nonlocal address"
1930 run_cmd nettest -s -f -l ${a} -b
1931 log_test_addr ${a} $? 0 "TCP socket bind to nonlocal address"
1934 run_cmd nettest -s -D -P icmp -f -l ${a} -b
1935 log_test_addr ${a} $? 0 "ICMP socket bind to nonlocal address"
1940 a=${BCAST_IP}
1942 run_cmd nettest -s -D -P icmp -l ${a} -b
1943 log_test_addr ${a} $? 1 "ICMP socket bind to broadcast address"
1945 a=${MCAST_IP}
1947 run_cmd nettest -s -D -P icmp -l ${a} -b
1948 log_test_addr ${a} $? 1 "ICMP socket bind to multicast address"
1953 a=${NSA_IP}
1955 run_cmd nettest -c ${a} -r ${NSB_IP} -t1 -b
1956 log_test_addr ${a} $? 0 "TCP socket bind to local address"
1959 run_cmd nettest -c ${a} -r ${NSB_IP} -d ${NSA_DEV} -t1 -b
1960 log_test_addr ${a} $? 0 "TCP socket bind to local address after device bind"
1962 # Sadly, the kernel allows binding a socket to a device and then
1966 #a=${NSA_LO_IP}
1969 #run_cmd nettest -s -l ${a} -I ${NSA_DEV} -t1 -b
1970 #log_test_addr ${a} $? 1 "TCP socket bind to out of scope local address"
1978 for a in ${NSA_IP} ${VRF_IP}
1982 run_cmd nettest -s -R -P icmp -l ${a} -b
1983 log_test_addr ${a} $? 1 "Raw socket bind to local address"
1986 run_cmd nettest -s -R -P icmp -l ${a} -I ${NSA_DEV} -b
1987 log_test_addr ${a} $? 0 "Raw socket bind to local address after device bind"
1989 run_cmd nettest -s -R -P icmp -l ${a} -I ${VRF} -b
1990 log_test_addr ${a} $? 0 "Raw socket bind to local address after VRF bind"
1993 a=${NSA_LO_IP}
1996 run_cmd nettest -s -R -P icmp -l ${a} -I ${VRF} -b
1997 log_test_addr ${a} $? 1 "Raw socket bind to out of scope address after VRF bind"
2002 a=${NL_IP}
2004 run_cmd nettest -s -R -f -l ${a} -I ${VRF} -b
2005 log_test_addr ${a} $? 0 "Raw socket bind to nonlocal address after VRF bind"
2008 run_cmd nettest -s -f -l ${a} -I ${VRF} -b
2009 log_test_addr ${a} $? 0 "TCP socket bind to nonlocal address after VRF bind"
2012 run_cmd nettest -s -D -P icmp -f -l ${a} -I ${VRF} -b
2013 log_test_addr ${a} $? 0 "ICMP socket bind to nonlocal address after VRF bind"
2018 a=${BCAST_IP}
2020 run_cmd nettest -s -D -P icmp -l ${a} -I ${VRF} -b
2021 log_test_addr ${a} $? 1 "ICMP socket bind to broadcast address after VRF bind"
2023 a=${MCAST_IP}
2025 run_cmd nettest -s -D -P icmp -l ${a} -I ${VRF} -b
2026 log_test_addr ${a} $? 1 "ICMP socket bind to multicast address after VRF bind"
2031 for a in ${NSA_IP} ${VRF_IP}
2034 run_cmd nettest -s -l ${a} -I ${VRF} -t1 -b
2035 log_test_addr ${a} $? 0 "TCP socket bind to local address"
2038 run_cmd nettest -s -l ${a} -I ${NSA_DEV} -t1 -b
2039 log_test_addr ${a} $? 0 "TCP socket bind to local address after device bind"
2042 a=${NSA_LO_IP}
2045 run_cmd nettest -s -l ${a} -I ${VRF} -t1 -b
2046 log_test_addr ${a} $? 1 "TCP socket bind to invalid local address for VRF"
2050 run_cmd nettest -s -l ${a} -I ${NSA_DEV} -t1 -b
2051 log_test_addr ${a} $? 1 "TCP socket bind to invalid local address for device bind"
2077 local a
2082 for a in ${NSA_IP} ${VRF_IP}
2087 run_cmd_nsb nettest ${varg} -r ${a} &
2091 log_test_addr ${a} 0 0 "${desc}, global server"
2096 for a in ${NSA_IP} ${VRF_IP}
2101 run_cmd_nsb nettest ${varg} -r ${a} &
2105 log_test_addr ${a} 0 0 "${desc}, VRF server"
2110 a=${NSA_IP}
2114 run_cmd_nsb nettest ${varg} -r ${a} &
2118 log_test_addr ${a} 0 0 "${desc}, enslaved device server"
2132 log_test_addr ${a} 0 0 "${desc}, VRF client"
2143 log_test_addr ${a} 0 0 "${desc}, enslaved device client"
2150 for a in ${NSA_IP} ${VRF_IP}
2155 run_cmd nettest ${varg} -d ${VRF} -r ${a} &
2159 log_test_addr ${a} 0 0 "${desc}, global server, VRF client, local"
2164 for a in ${NSA_IP} ${VRF_IP}
2169 run_cmd nettest ${varg} -d ${VRF} -r ${a} &
2173 log_test_addr ${a} 0 0 "${desc}, VRF server and client, local"
2178 a=${NSA_IP}
2183 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
2187 log_test_addr ${a} 0 0 "${desc}, global server, enslaved device client, local"
2194 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
2198 log_test_addr ${a} 0 0 "${desc}, VRF server, enslaved device client, local"
2205 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
2209 log_test_addr ${a} 0 0 "${desc}, enslaved device server and client, local"
2215 local a
2217 for a in ${NSA_IP} ${VRF_IP}
2220 run_cmd_nsb ping -f ${a} &
2224 log_test_addr ${a} 0 0 "Device delete with active traffic - ping in"
2229 a=${NSB_IP}
2231 run_cmd ping -f -I ${VRF} ${a} &
2235 log_test_addr ${a} 0 0 "Device delete with active traffic - ping out"
2257 local a
2259 # should not have an impact, but make a known state
2265 for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}%${NSA_DEV} ${MCAST}%${NSA_DEV}
2268 run_cmd ${ping6} -c1 -w1 ${a}
2269 log_test_addr ${a} $? 0 "ping out"
2272 for a in ${NSB_IP6} ${NSB_LO_IP6}
2275 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2276 log_test_addr ${a} $? 0 "ping out, device bind"
2279 run_cmd ${ping6} -c1 -w1 -I ${NSA_LO_IP6} ${a}
2280 log_test_addr ${a} $? 0 "ping out, loopback address bind"
2286 for a in ${NSA_IP6} ${NSA_LO_IP6} ${NSA_LINKIP6}%${NSB_DEV} ${MCAST}%${NSB_DEV}
2289 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2290 log_test_addr ${a} $? 0 "ping in"
2296 for a in ${NSA_IP6} ${NSA_LO_IP6} ::1 ${NSA_LINKIP6}%${NSA_DEV} ${MCAST}%${NSA_DEV}
2299 run_cmd ${ping6} -c1 -w1 ${a}
2300 log_test_addr ${a} $? 0 "ping local, no bind"
2303 for a in ${NSA_IP6} ${NSA_LINKIP6}%${NSA_DEV} ${MCAST}%${NSA_DEV}
2306 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2307 log_test_addr ${a} $? 0 "ping local, device bind"
2310 for a in ${NSA_LO_IP6} ::1
2314 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2315 log_test_addr ${a} $? 2 "ping local, device bind"
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
2327 a=${NSB_LO_IP6}
2328 run_cmd ${ping6} -c1 -w1 ${a}
2329 log_test_addr ${a} $? 2 "ping out, blocked by rule"
2332 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2333 log_test_addr ${a} $? 2 "ping out, device bind, blocked by rule"
2335 a=${NSA_LO_IP6}
2338 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2339 log_test_addr ${a} $? 1 "ping in, blocked by rule"
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
2354 a=${NSB_LO_IP6}
2355 run_cmd ${ping6} -c1 -w1 ${a}
2356 log_test_addr ${a} $? 2 "ping out, blocked by route"
2359 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2360 log_test_addr ${a} $? 2 "ping out, device bind, blocked by route"
2362 a=${NSA_LO_IP6}
2365 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2366 log_test_addr ${a} $? 1 "ping in, blocked by route"
2373 setup_cmd ip -6 ro del unreachable ${NSB_LO_IP6}
2374 setup_cmd ip -6 ro del unreachable ${NSB_IP6}
2376 a=${NSB_LO_IP6}
2377 run_cmd ${ping6} -c1 -w1 ${a}
2378 log_test_addr ${a} $? 2 "ping out, unreachable route"
2381 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2382 log_test_addr ${a} $? 2 "ping out, device bind, unreachable route"
2387 local a
2395 for a in ${NSB_IP6} ${NSB_LO_IP6}
2398 run_cmd ${ping6} -c1 -w1 -I ${VRF} ${a}
2399 log_test_addr ${a} $? 0 "ping out, VRF bind"
2402 for a in ${NSB_LINKIP6}%${VRF} ${MCAST}%${VRF}
2406 run_cmd ${ping6} -c1 -w1 ${a}
2407 log_test_addr ${a} $? 1 "ping out, VRF bind"
2410 for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}%${NSA_DEV} ${MCAST}%${NSA_DEV}
2413 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2414 log_test_addr ${a} $? 0 "ping out, device bind"
2417 for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}%${NSA_DEV}
2420 run_cmd ip vrf exec ${VRF} ${ping6} -c1 -w1 -I ${VRF_IP6} ${a}
2421 log_test_addr ${a} $? 0 "ping out, vrf device+address bind"
2427 for a in ${NSA_IP6} ${VRF_IP6} ${NSA_LINKIP6}%${NSB_DEV} ${MCAST}%${NSB_DEV}
2430 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2431 log_test_addr ${a} $? 0 "ping in"
2434 a=${NSA_LO_IP6}
2437 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2438 log_test_addr ${a} $? 1 "ping in"
2443 for a in ${NSA_IP6} ${VRF_IP6} ::1
2446 show_hint "Source address should be ${a}"
2447 run_cmd ${ping6} -c1 -w1 -I ${VRF} ${a}
2448 log_test_addr ${a} $? 0 "ping local, VRF bind"
2451 for a in ${NSA_IP6} ${NSA_LINKIP6}%${NSA_DEV} ${MCAST}%${NSA_DEV}
2454 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2455 log_test_addr ${a} $? 0 "ping local, device bind"
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}
2463 for a in ${NSA_IP6} ${VRF_IP6}
2467 log_test_addr ${a} $? 0 "ping in, LLA to GUA"
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
2481 a=${NSB_LO_IP6}
2482 run_cmd ${ping6} -c1 -w1 ${a}
2483 log_test_addr ${a} $? 2 "ping out, blocked by rule"
2486 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2487 log_test_addr ${a} $? 2 "ping out, device bind, blocked by rule"
2489 a=${NSA_LO_IP6}
2492 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2493 log_test_addr ${a} $? 1 "ping in, blocked by rule"
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}
2505 a=${NSB_LO_IP6}
2506 run_cmd ${ping6} -c1 -w1 ${a}
2507 log_test_addr ${a} $? 2 "ping out, unreachable route"
2510 run_cmd ${ping6} -c1 -w1 -I ${NSA_DEV} ${a}
2511 log_test_addr ${a} $? 2 "ping out, device bind, unreachable route"
2513 ip -netns ${NSB} -6 ro del ${NSA_LO_IP6}
2514 a=${NSA_LO_IP6}
2516 run_cmd_nsb ${ping6} -c1 -w1 ${a}
2517 log_test_addr ${a} $? 2 "ping in, unreachable route"
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}
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}
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}
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}
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}
2678 # duplicate config between default VRF and a VRF
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"
2756 local a
2761 for a in ${NSA_IP6} ${NSA_LO_IP6} ${NSA_LINKIP6}%${NSB_DEV}
2764 run_cmd nettest -6 -s &
2766 run_cmd_nsb nettest -6 -r ${a}
2767 log_test_addr ${a} $? 0 "Global server"
2771 for a in ${NSA_IP6} ${NSA_LO_IP6} ${NSA_LINKIP6}%${NSB_DEV}
2775 run_cmd_nsb nettest -6 -r ${a}
2776 log_test_addr ${a} $? 1 "No server"
2782 for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}%${NSA_DEV}
2785 run_cmd_nsb nettest -6 -s &
2787 run_cmd nettest -6 -r ${a}
2788 log_test_addr ${a} $? 0 "Client"
2791 for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}%${NSA_DEV}
2794 run_cmd_nsb nettest -6 -s &
2796 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
2797 log_test_addr ${a} $? 0 "Client, device bind"
2800 for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}%${NSA_DEV}
2804 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
2805 log_test_addr ${a} $? 1 "No server, device client"
2811 for a in ${NSA_IP6} ${NSA_LO_IP6} ::1
2814 run_cmd nettest -6 -s &
2816 run_cmd nettest -6 -r ${a}
2817 log_test_addr ${a} $? 0 "Global server, local connection"
2820 a=${NSA_IP6}
2822 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
2824 run_cmd nettest -6 -r ${a} -0 ${a}
2825 log_test_addr ${a} $? 0 "Device server, unbound client, local connection"
2827 for a in ${NSA_LO_IP6} ::1
2831 run_cmd nettest -6 -s -I ${NSA_DEV} &
2833 run_cmd nettest -6 -r ${a}
2834 log_test_addr ${a} $? 1 "Device server, unbound client, local connection"
2837 a=${NSA_IP6}
2839 run_cmd nettest -6 -s &
2841 run_cmd nettest -6 -r ${a} -d ${NSA_DEV} -0 ${a}
2842 log_test_addr ${a} $? 0 "Global server, device client, local connection"
2844 for a in ${NSA_LO_IP6} ::1
2848 run_cmd nettest -6 -s &
2850 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
2851 log_test_addr ${a} $? 1 "Global server, device client, local connection"
2854 for a in ${NSA_IP6} ${NSA_LINKIP6}
2857 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
2859 run_cmd nettest -6 -d ${NSA_DEV} -r ${a}
2860 log_test_addr ${a} $? 0 "Device server, device client, local conn"
2863 for a in ${NSA_IP6} ${NSA_LINKIP6}
2867 run_cmd nettest -6 -d ${NSA_DEV} -r ${a}
2868 log_test_addr ${a} $? 1 "No server, device client, local conn"
2876 local a
2886 for a in ${NSA_IP6} ${VRF_IP6} ${NSA_LINKIP6}%${NSB_DEV}
2890 run_cmd nettest -6 -s &
2892 run_cmd_nsb nettest -6 -r ${a}
2893 log_test_addr ${a} $? 1 "Global server"
2896 for a in ${NSA_IP6} ${VRF_IP6}
2899 run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} &
2901 run_cmd_nsb nettest -6 -r ${a}
2902 log_test_addr ${a} $? 0 "VRF server"
2906 a=${NSA_LINKIP6}%${NSB_DEV}
2908 run_cmd nettest -6 -s -I ${VRF} -3 ${NSA_DEV} &
2910 run_cmd_nsb nettest -6 -r ${a}
2911 log_test_addr ${a} $? 0 "VRF server"
2913 for a in ${NSA_IP6} ${VRF_IP6} ${NSA_LINKIP6}%${NSB_DEV}
2916 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
2918 run_cmd_nsb nettest -6 -r ${a}
2919 log_test_addr ${a} $? 0 "Device server"
2923 for a in ${NSA_IP6} ${VRF_IP6} ${NSA_LINKIP6}%${NSB_DEV}
2927 run_cmd_nsb nettest -6 -r ${a}
2928 log_test_addr ${a} $? 1 "No server"
2932 a=${NSA_IP6}
2935 run_cmd nettest -6 -s &
2937 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
2938 log_test_addr ${a} $? 1 "Global server, local connection"
2953 for a in ${NSA_IP6} ${VRF_IP6}
2956 run_cmd nettest -6 -s -3 ${VRF} &
2958 run_cmd_nsb nettest -6 -r ${a}
2959 log_test_addr ${a} $? 0 "Global server"
2962 for a in ${NSA_IP6} ${VRF_IP6}
2965 run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} &
2967 run_cmd_nsb nettest -6 -r ${a}
2968 log_test_addr ${a} $? 0 "VRF server"
2972 a=${NSA_LINKIP6}%${NSB_DEV}
2974 run_cmd nettest -6 -s -3 ${NSA_DEV} &
2976 run_cmd_nsb nettest -6 -r ${a}
2977 log_test_addr ${a} $? 0 "Global server"
2980 run_cmd nettest -6 -s -I ${VRF} -3 ${NSA_DEV} &
2982 run_cmd_nsb nettest -6 -r ${a}
2983 log_test_addr ${a} $? 0 "VRF server"
2985 for a in ${NSA_IP6} ${NSA_LINKIP6}%${NSB_DEV}
2988 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
2990 run_cmd_nsb nettest -6 -r ${a}
2991 log_test_addr ${a} $? 0 "Device server"
2995 for a in ${NSA_IP6} ${VRF_IP6} ${NSA_LINKIP6}%${NSB_DEV}
2999 run_cmd_nsb nettest -6 -r ${a}
3000 log_test_addr ${a} $? 1 "No server"
3004 for a in ${NSA_IP6} ${VRF_IP6}
3008 run_cmd nettest -6 -s -I ${VRF} &
3010 run_cmd nettest -6 -r ${a}
3011 log_test_addr ${a} $? 1 "Global server, local connection"
3018 for a in ${NSB_IP6} ${NSB_LO_IP6}
3021 run_cmd_nsb nettest -6 -s &
3023 run_cmd nettest -6 -r ${a} -d ${VRF}
3024 log_test_addr ${a} $? 0 "Client, VRF bind"
3027 a=${NSB_LINKIP6}
3030 run_cmd_nsb nettest -6 -s &
3032 run_cmd nettest -6 -r ${a} -d ${VRF}
3033 log_test_addr ${a} $? 1 "Client, VRF bind"
3035 for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}
3038 run_cmd_nsb nettest -6 -s &
3040 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
3041 log_test_addr ${a} $? 0 "Client, device bind"
3044 for a in ${NSB_IP6} ${NSB_LO_IP6}
3048 run_cmd nettest -6 -r ${a} -d ${VRF}
3049 log_test_addr ${a} $? 1 "No server, VRF client"
3052 for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}
3056 run_cmd nettest -6 -r ${a} -d ${NSA_DEV}
3057 log_test_addr ${a} $? 1 "No server, device client"
3060 for a in ${NSA_IP6} ${VRF_IP6} ::1
3063 run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} &
3065 run_cmd nettest -6 -r ${a} -d ${VRF} -0 ${a}
3066 log_test_addr ${a} $? 0 "VRF server, VRF client, local connection"
3069 a=${NSA_IP6}
3071 run_cmd nettest -6 -s -I ${VRF} -3 ${VRF} &
3073 run_cmd nettest -6 -r ${a} -d ${NSA_DEV} -0 ${a}
3074 log_test_addr ${a} $? 0 "VRF server, device client, local connection"
3076 a=${NSA_IP6}
3079 run_cmd nettest -6 -s -I ${VRF} &
3081 run_cmd nettest -6 -r ${a}
3082 log_test_addr ${a} $? 1 "VRF server, unbound client, local connection"
3085 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
3087 run_cmd nettest -6 -r ${a} -d ${VRF} -0 ${a}
3088 log_test_addr ${a} $? 0 "Device server, VRF client, local connection"
3090 for a in ${NSA_IP6} ${NSA_LINKIP6}
3093 run_cmd nettest -6 -s -I ${NSA_DEV} -3 ${NSA_DEV} &
3095 run_cmd nettest -6 -r ${a} -d ${NSA_DEV} -0 ${a}
3096 log_test_addr ${a} $? 0 "Device server, device client, local connection"
3125 local a
3130 for a in ${NSA_IP6} ${NSA_LINKIP6}%${NSB_DEV}
3133 run_cmd nettest -6 -D -s -3 ${NSA_DEV} &
3135 run_cmd_nsb nettest -6 -D -r ${a}
3136 log_test_addr ${a} $? 0 "Global server"
3139 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3141 run_cmd_nsb nettest -6 -D -r ${a}
3142 log_test_addr ${a} $? 0 "Device server"
3145 a=${NSA_LO_IP6}
3147 run_cmd nettest -6 -D -s -3 ${NSA_DEV} &
3149 run_cmd_nsb nettest -6 -D -r ${a}
3150 log_test_addr ${a} $? 0 "Global server"
3152 # should fail since loopback address is out of scope for a device
3157 #run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3159 #run_cmd_nsb nettest -6 -D -r ${a}
3160 #log_test_addr ${a} $? 1 "Device server"
3163 for a in ${NSA_IP6} ${NSA_LO_IP6} ${NSA_LINKIP6}%${NSB_DEV}
3167 run_cmd_nsb nettest -6 -D -r ${a}
3168 log_test_addr ${a} $? 1 "No server"
3174 for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}%${NSA_DEV}
3177 run_cmd_nsb nettest -6 -D -s &
3179 run_cmd nettest -6 -D -r ${a} -0 ${NSA_IP6}
3180 log_test_addr ${a} $? 0 "Client"
3183 run_cmd_nsb nettest -6 -D -s &
3185 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -0 ${NSA_IP6}
3186 log_test_addr ${a} $? 0 "Client, device bind"
3189 run_cmd_nsb nettest -6 -D -s &
3191 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -C -0 ${NSA_IP6}
3192 log_test_addr ${a} $? 0 "Client, device send via cmsg"
3195 run_cmd_nsb nettest -6 -D -s &
3197 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -S -0 ${NSA_IP6}
3198 log_test_addr ${a} $? 0 "Client, device bind via IPV6_UNICAST_IF"
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"
3214 for a in ${NSA_IP6} ${NSA_LO_IP6} ::1
3217 run_cmd nettest -6 -D -s &
3219 run_cmd nettest -6 -D -r ${a} -0 ${a} -1 ${a}
3220 log_test_addr ${a} $? 0 "Global server, local connection"
3223 a=${NSA_IP6}
3225 run_cmd nettest -6 -s -D -I ${NSA_DEV} -3 ${NSA_DEV} &
3227 run_cmd nettest -6 -D -r ${a}
3228 log_test_addr ${a} $? 0 "Device server, unbound client, local connection"
3230 for a in ${NSA_LO_IP6} ::1
3234 run_cmd nettest -6 -s -D -I ${NSA_DEV} &
3236 run_cmd nettest -6 -D -r ${a}
3237 log_test_addr ${a} $? 1 "Device server, local connection"
3240 a=${NSA_IP6}
3242 run_cmd nettest -6 -s -D &
3244 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3245 log_test_addr ${a} $? 0 "Global server, device client, local connection"
3248 run_cmd nettest -6 -s -D &
3250 run_cmd nettest -6 -D -d ${NSA_DEV} -C -r ${a}
3251 log_test_addr ${a} $? 0 "Global server, device send via cmsg, local connection"
3254 run_cmd nettest -6 -s -D &
3256 run_cmd nettest -6 -D -d ${NSA_DEV} -S -r ${a}
3257 log_test_addr ${a} $? 0 "Global server, device client via IPV6_UNICAST_IF, local connection"
3259 for a in ${NSA_LO_IP6} ::1
3263 run_cmd nettest -6 -D -s &
3265 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV}
3266 log_test_addr ${a} $? 1 "Global server, device client, local connection"
3270 run_cmd nettest -6 -D -s &
3272 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -C
3273 log_test_addr ${a} $? 1 "Global server, device send via cmsg, local connection"
3277 run_cmd nettest -6 -D -s &
3279 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -S
3280 log_test_addr ${a} $? 1 "Global server, device client via IP_UNICAST_IF, local connection"
3284 run_cmd nettest -6 -D -s &
3286 run_cmd nettest -6 -D -r ${a} -d ${NSA_DEV} -S -U
3287 …log_test_addr ${a} $? 1 "Global server, device client via IP_UNICAST_IF, local connection, with co…
3290 a=${NSA_IP6}
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}
3295 log_test_addr ${a} $? 0 "Device server, device client, local conn"
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}
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
3317 local a
3326 for a in ${NSA_IP6} ${VRF_IP6}
3330 run_cmd nettest -6 -D -s &
3332 run_cmd_nsb nettest -6 -D -r ${a}
3333 log_test_addr ${a} $? 1 "Global server"
3336 for a in ${NSA_IP6} ${VRF_IP6}
3339 run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} &
3341 run_cmd_nsb nettest -6 -D -r ${a}
3342 log_test_addr ${a} $? 0 "VRF server"
3345 for a in ${NSA_IP6} ${VRF_IP6}
3348 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3350 run_cmd_nsb nettest -6 -D -r ${a}
3351 log_test_addr ${a} $? 0 "Enslaved device server"
3355 for a in ${NSA_IP6} ${VRF_IP6}
3359 run_cmd_nsb nettest -6 -D -r ${a}
3360 log_test_addr ${a} $? 1 "No server"
3366 for a in ${NSA_IP6} ${VRF_IP6}
3370 run_cmd nettest -6 -D -s &
3372 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3373 log_test_addr ${a} $? 1 "Global server, VRF client, local conn"
3376 for a in ${NSA_IP6} ${VRF_IP6}
3379 run_cmd nettest -6 -D -I ${VRF} -s &
3381 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3382 log_test_addr ${a} $? 0 "VRF server, VRF client, local conn"
3385 a=${NSA_IP6}
3388 run_cmd nettest -6 -D -s &
3390 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3391 log_test_addr ${a} $? 1 "Global server, device client, local conn"
3394 run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} &
3396 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3397 log_test_addr ${a} $? 0 "VRF server, device client, local conn"
3400 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3402 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3403 log_test_addr ${a} $? 0 "Enslaved device server, VRF client, local conn"
3406 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3408 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3409 log_test_addr ${a} $? 0 "Enslaved device server, device client, local conn"
3418 for a in ${NSA_IP6} ${VRF_IP6}
3421 run_cmd nettest -6 -D -s -3 ${NSA_DEV} &
3423 run_cmd_nsb nettest -6 -D -r ${a}
3424 log_test_addr ${a} $? 0 "Global server"
3427 for a in ${NSA_IP6} ${VRF_IP6}
3430 run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} &
3432 run_cmd_nsb nettest -6 -D -r ${a}
3433 log_test_addr ${a} $? 0 "VRF server"
3436 for a in ${NSA_IP6} ${VRF_IP6}
3439 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3441 run_cmd_nsb nettest -6 -D -r ${a}
3442 log_test_addr ${a} $? 0 "Enslaved device server"
3446 for a in ${NSA_IP6} ${VRF_IP6}
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}
3464 run_cmd nettest -6 -D -d ${VRF} -r ${NSB_IP6}
3468 run_cmd_nsb nettest -6 -D -s &
3470 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSB_IP6}
3475 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSB_IP6}
3481 a=${NSA_IP6}
3483 run_cmd nettest -6 -D -s -3 ${NSA_DEV} &
3485 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3486 log_test_addr ${a} $? 0 "Global server, VRF client, local conn"
3489 run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} &
3491 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3492 log_test_addr ${a} $? 0 "VRF server, VRF client, local conn"
3495 a=${VRF_IP6}
3497 run_cmd nettest -6 -D -s -3 ${VRF} &
3499 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3500 log_test_addr ${a} $? 0 "Global server, VRF client, local conn"
3503 run_cmd nettest -6 -D -I ${VRF} -s -3 ${VRF} &
3505 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3506 log_test_addr ${a} $? 0 "VRF server, VRF client, local conn"
3509 for a in ${NSA_IP6} ${VRF_IP6}
3512 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3513 log_test_addr ${a} $? 1 "No server, VRF client, local conn"
3517 a=${NSA_IP6}
3519 run_cmd nettest -6 -D -s -3 ${NSA_DEV} &
3521 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3522 log_test_addr ${a} $? 0 "Global server, device client, local conn"
3525 run_cmd nettest -6 -D -I ${VRF} -s -3 ${NSA_DEV} &
3527 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3528 log_test_addr ${a} $? 0 "VRF server, device client, local conn"
3531 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3533 run_cmd nettest -6 -D -d ${VRF} -r ${a}
3534 log_test_addr ${a} $? 0 "Device server, VRF client, local conn"
3537 run_cmd nettest -6 -D -I ${NSA_DEV} -s -3 ${NSA_DEV} &
3539 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${a}
3540 log_test_addr ${a} $? 0 "Device server, device client, local conn"
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}
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}
3571 run_cmd nettest -6 -D -s &
3573 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSA_LINKIP6}
3577 run_cmd nettest -6 -D -d ${NSA_DEV} -r ${NSA_LINKIP6}
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}
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
3624 for a in ${NSA_IP6} ${NSA_LO_IP6}
3627 run_cmd nettest -6 -s -R -P ipv6-icmp -l ${a} -b
3628 log_test_addr ${a} $? 0 "Raw socket bind to local address"
3631 run_cmd nettest -6 -s -R -P ipv6-icmp -l ${a} -I ${NSA_DEV} -b
3632 log_test_addr ${a} $? 0 "Raw socket bind to local address after device bind"
3638 a=${NL_IP6}
3640 run_cmd nettest -6 -s -R -P icmp -f -l ${a} -I ${NSA_DEV} -b
3641 log_test_addr ${a} $? 0 "Raw socket bind to nonlocal address"
3646 a=${NSA_IP6}
3648 run_cmd nettest -6 -s -l ${a} -t1 -b
3649 log_test_addr ${a} $? 0 "TCP socket bind to local address"
3652 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
3653 log_test_addr ${a} $? 0 "TCP socket bind to local address after device bind"
3655 # Sadly, the kernel allows binding a socket to a device and then
3658 a=${NSA_LO_IP6}
3661 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
3662 log_test_addr ${a} $? 0 "TCP socket bind to out of scope local address"
3670 for a in ${NSA_IP6} ${VRF_IP6}
3673 run_cmd nettest -6 -s -R -P ipv6-icmp -l ${a} -I ${VRF} -b
3674 log_test_addr ${a} $? 0 "Raw socket bind to local address after vrf bind"
3677 run_cmd nettest -6 -s -R -P ipv6-icmp -l ${a} -I ${NSA_DEV} -b
3678 log_test_addr ${a} $? 0 "Raw socket bind to local address after device bind"
3681 a=${NSA_LO_IP6}
3684 run_cmd nettest -6 -s -R -P ipv6-icmp -l ${a} -I ${VRF} -b
3685 log_test_addr ${a} $? 1 "Raw socket bind to invalid local address after vrf bind"
3690 a=${NL_IP6}
3692 run_cmd nettest -6 -s -R -P icmp -f -l ${a} -I ${VRF} -b
3693 log_test_addr ${a} $? 0 "Raw socket bind to nonlocal address after VRF bind"
3698 # address on enslaved device is valid for the VRF or device in a VRF
3699 for a in ${NSA_IP6} ${VRF_IP6}
3702 run_cmd nettest -6 -s -l ${a} -I ${VRF} -t1 -b
3703 log_test_addr ${a} $? 0 "TCP socket bind to local address with VRF bind"
3706 a=${NSA_IP6}
3708 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
3709 log_test_addr ${a} $? 0 "TCP socket bind to local address with device bind"
3711 # Sadly, the kernel allows binding a socket to a device and then
3715 a=${VRF_IP6}
3718 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
3719 log_test_addr ${a} $? 0 "TCP socket bind to VRF address with device bind"
3721 a=${NSA_LO_IP6}
3724 run_cmd nettest -6 -s -l ${a} -I ${VRF} -t1 -b
3725 log_test_addr ${a} $? 1 "TCP socket bind to invalid local address for VRF"
3729 run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
3730 log_test_addr ${a} $? 1 "TCP socket bind to invalid local address for device bind"
3753 local varg="-6 $2"
3755 local a
3760 for a in ${NSA_IP6} ${VRF_IP6}
3765 run_cmd_nsb nettest ${varg} -r ${a} &
3769 log_test_addr ${a} 0 0 "${desc}, global server"
3774 for a in ${NSA_IP6} ${VRF_IP6}
3779 run_cmd_nsb nettest ${varg} -r ${a} &
3783 log_test_addr ${a} 0 0 "${desc}, VRF server"
3788 for a in ${NSA_IP6} ${VRF_IP6}
3793 run_cmd_nsb nettest ${varg} -r ${a} &
3797 log_test_addr ${a} 0 0 "${desc}, enslaved device server"
3831 for a in ${NSA_IP6} ${VRF_IP6}
3836 run_cmd nettest ${varg} -d ${VRF} -r ${a} &
3840 log_test_addr ${a} 0 0 "${desc}, global server, VRF client"
3845 for a in ${NSA_IP6} ${VRF_IP6}
3850 run_cmd nettest ${varg} -d ${VRF} -r ${a} &
3854 log_test_addr ${a} 0 0 "${desc}, VRF server and client"
3859 a=${NSA_IP6}
3863 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
3867 log_test_addr ${a} 0 0 "${desc}, global server, device client"
3874 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
3878 log_test_addr ${a} 0 0 "${desc}, VRF server, device client"
3885 run_cmd nettest ${varg} -d ${NSA_DEV} -r ${a} &
3889 log_test_addr ${a} 0 0 "${desc}, device server, device client"
3895 local a
3897 a=${NSA_IP6}
3899 run_cmd_nsb ${ping6} -f ${a} &
3903 log_test_addr ${a} 0 0 "Device delete with active traffic - ping in"
3912 log_test_addr ${a} 0 0 "Device delete with active traffic - ping out"
3937 local a
3939 for a in ${NSA_IP} ${VRF_IP}
3944 run_cmd_nsb nettest -r ${a}
3945 log_test_addr ${a} $? 1 "Global server, reject with TCP-reset on Rx"
3953 local a
3957 for a in ${NSA_IP} ${VRF_IP}
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
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
3994 local a
3996 for a in ${NSA_IP6} ${VRF_IP6}
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"
4010 local a
4014 for a in ${NSA_IP6} ${VRF_IP6}
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
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
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
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
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
4179 # cycle/flap the first ns-A interface
4190 # cycle/flap the second ns-A interface
4202 # Perform IPv{4,6} SNAT on ns-A, and verify TCP connection is successfully
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…
4218 run_cmd_nsb nettest -6 -s -l ${NSB_IP6} -p ${port} &
4220 run_cmd nettest -6 -d ${VRF} -r ${NSB_IP6} -p ${port}
4248 -6 IPv6 tests only
4273 6) TESTS=ipv6;;