Lines Matching full:ip
55 IP="$(which ip) -netns $ns1"
56 NS_EXEC="$(which ip) netns exec $ns1"
57 ip netns exec $ns1 sysctl -qw net.ipv4.ip_forward=1
58 ip netns exec $ns1 sysctl -qw net.ipv6.conf.all.forwarding=1
60 $IP link add dummy0 type dummy
61 $IP link set dev dummy0 up
62 $IP address add 198.51.100.1/24 dev dummy0
63 $IP -6 address add 2001:db8:1::1/64 dev dummy0
70 $IP link del dev dummy0 &> /dev/null
79 addr=$($IP -6 -br addr show dev ${dev} | \
104 $IP route get fibmatch 198.51.100.2 &> /dev/null
106 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
110 $IP link del dev dummy0
114 $IP route get fibmatch 198.51.100.2 &> /dev/null
116 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
131 $IP link add dummy1 type dummy
132 $IP link set dev dummy1 up
133 $IP address add 192.0.2.1/24 dev dummy1
134 $IP -6 address add 2001:db8:2::1/64 dev dummy1
136 $IP route add 203.0.113.0/24 \
139 $IP -6 route add 2001:db8:3::/64 \
145 $IP route get fibmatch 203.0.113.1 &> /dev/null
147 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
151 $IP link del dev dummy0
155 $IP route get fibmatch 203.0.113.1 &> /dev/null
158 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
163 $IP link del dev dummy1
167 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
187 $IP route get fibmatch 198.51.100.2 &> /dev/null
189 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
193 $IP link set dev dummy0 down
197 $IP route get fibmatch 198.51.100.2 &> /dev/null
199 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
210 $IP route get fibmatch 203.0.113.1 \
213 $IP -6 route get fibmatch 2001:db8:3::1 \
217 $IP route get fibmatch 203.0.113.1 \
220 $IP -6 route get fibmatch 2001:db8:3::1 \
224 $IP route get fibmatch 203.0.113.1 | \
227 $IP -6 route get fibmatch 2001:db8:3::1 | \
231 $IP route get fibmatch 203.0.113.1 | \
234 $IP -6 route get fibmatch 2001:db8:3::1 | \
247 $IP link add dummy1 type dummy
248 $IP link set dev dummy1 up
250 $IP address add 192.0.2.1/24 dev dummy1
251 $IP -6 address add 2001:db8:2::1/64 dev dummy1
253 $IP route add 203.0.113.0/24 \
256 $IP -6 route add 2001:db8:3::/64 \
262 $IP route get fibmatch 203.0.113.1 &> /dev/null
265 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
269 $IP link set dev dummy0 down
276 $IP link set dev dummy0 up
277 $IP link set dev dummy1 down
284 $IP link set dev dummy0 down
288 $IP route get fibmatch 203.0.113.1 &> /dev/null
290 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
293 $IP link del dev dummy1
312 $IP link set dev dummy0 carrier on
316 $IP route get fibmatch 198.51.100.1 &> /dev/null
318 $IP -6 route get fibmatch 2001:db8:1::1 &> /dev/null
321 $IP route get fibmatch 198.51.100.1 | \
324 $IP -6 route get fibmatch 2001:db8:1::1 | \
329 $IP link set dev dummy0 carrier off
334 $IP route get fibmatch 198.51.100.1 &> /dev/null
336 $IP -6 route get fibmatch 2001:db8:1::1 &> /dev/null
339 $IP route get fibmatch 198.51.100.1 | \
342 $IP -6 route get fibmatch 2001:db8:1::1 | \
347 $IP address add 192.0.2.1/24 dev dummy0
348 $IP -6 address add 2001:db8:2::1/64 dev dummy0
352 $IP route get fibmatch 192.0.2.1 &> /dev/null
354 $IP -6 route get fibmatch 2001:db8:2::1 &> /dev/null
357 $IP route get fibmatch 192.0.2.1 | \
360 $IP -6 route get fibmatch 2001:db8:2::1 | \
377 $IP link set dev dummy0 carrier on
381 $IP route get fibmatch 198.51.100.2 &> /dev/null
383 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
386 $IP route get fibmatch 198.51.100.2 | \
389 $IP -6 route get fibmatch 2001:db8:1::2 | \
394 $IP link set dev dummy0 carrier off
399 $IP route get fibmatch 198.51.100.2 &> /dev/null
401 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
404 $IP route get fibmatch 198.51.100.2 | \
407 $IP -6 route get fibmatch 2001:db8:1::2 | \
412 $IP address add 192.0.2.1/24 dev dummy0
413 $IP -6 address add 2001:db8:2::1/64 dev dummy0
417 $IP route get fibmatch 192.0.2.2 &> /dev/null
419 $IP -6 route get fibmatch 2001:db8:2::2 &> /dev/null
422 $IP route get fibmatch 192.0.2.2 | \
425 $IP -6 route get fibmatch 2001:db8:2::2 | \
448 $IP link add name veth1 type veth peer name veth2
449 $IP link set dev veth2 netns $ns2
450 $IP address add 192.0.2.1/24 dev veth1
451 ip -netns $ns2 address add 192.0.2.1/24 dev veth2
452 $IP link set dev veth1 up
453 ip -netns $ns2 link set dev veth2 up
455 $IP link set dev lo address 52:54:00:6a:c7:5e
456 $IP link set dev veth1 address 52:54:00:6a:c7:5e
457 ip -netns $ns2 link set dev lo address 52:54:00:6a:c7:5e
458 ip -netns $ns2 link set dev veth2 address 52:54:00:6a:c7:5e
461 ip netns exec $ns2 tc qdisc add dev lo parent root handle 1: fq_codel
462 ip netns exec $ns2 tc filter add dev lo parent 1: protocol arp basic \
464 ip netns exec $ns2 tc filter add dev lo parent 1: protocol ip basic \
471 $NS_EXEC tc filter add dev veth1 ingress protocol ip basic \
478 $NS_EXEC tc filter add dev lo parent 1: protocol ip basic \
482 ip netns exec $ns2 tc qdisc add dev veth2 ingress
483 ip netns exec $ns2 tc filter add dev veth2 ingress protocol arp basic \
485 ip netns exec $ns2 tc filter add dev veth2 ingress protocol ip basic \
491 ip netns exec $ns2 sysctl -qw net.ipv4.conf.all.rp_filter=1
492 ip netns exec $ns2 sysctl -qw net.ipv4.conf.all.accept_local=1
493 ip netns exec $ns2 sysctl -qw net.ipv4.conf.all.route_localnet=1
496 run_cmd "ip netns exec $ns2 ping -w1 -c1 192.0.2.1"
499 run_cmd "ip netns exec $ns2 ping -w1 -c1 127.0.0.1"
508 # run 'ip route add' with given spec
523 cmd="$IP route add vrf $vrf $pfx $gw $dev"
617 $IP -4 rule add pref 32765 table local
618 $IP -4 rule del pref 0
619 $IP -6 rule add pref 32765 table local
620 $IP -6 rule del pref 0
622 $IP link add red type vrf table 1
623 $IP link set red up
624 $IP -4 route add vrf red unreachable default metric 4278198272
625 $IP -6 route add vrf red unreachable default metric 4278198272
627 $IP link add veth0 type veth peer name veth1
628 $IP link set dev veth0 up
629 $IP address add 192.0.2.1/24 dev veth0
630 $IP -6 address add 2001:db8:51::1/64 dev veth0
632 $IP link set dev veth1 vrf red up
633 $IP address add 192.0.2.2/24 dev veth1
634 $IP -6 address add 2001:db8:51::2/64 dev veth1
636 $IP link add dummy1 type dummy
637 $IP link set dev dummy1 vrf red up
638 $IP address add 192.168.2.1/24 dev dummy1
639 $IP -6 address add 2001:db8:2::1/64 dev dummy1
647 $IP link del dev dummy1
648 $IP link del veth0
649 $IP link del red
664 $IP link add dummy_$i type dummy
665 $IP link set dev dummy_$i up
666 $IP -6 address add 2001:$i::1/64 dev dummy_$i
669 $NS_EXEC ip monitor route &> errors.txt &
672 $IP -6 route add 2001::/64 \
711 $IP link add dummy_$i type dummy
712 $IP link set dev dummy_$i up
713 $IP address add 20.20.$i.2/24 dev dummy_$i
716 $NS_EXEC ip monitor route &> errors.txt &
719 $IP route add 10.0.0.0/24 \
721 nexthop encap ip dst 192.168.10.20 via 20.20.20.1 dev dummy_20 \
722 nexthop encap ip dst 192.168.10.30 via 20.20.30.1 dev dummy_30 \
723 nexthop encap ip dst 192.168.10.40 via 20.20.40.1 dev dummy_40 \
724 nexthop encap ip dst 192.168.10.50 via 20.20.50.1 dev dummy_50 \
725 nexthop encap ip dst 192.168.10.60 via 20.20.60.1 dev dummy_60 \
726 nexthop encap ip dst 192.168.10.70 via 20.20.70.1 dev dummy_70
749 $IP link del dev dummy_10
751 $IP link add dummy_10 type dummy
752 $IP link set dev dummy_10 up
753 $IP -6 address add 2001:10::1/64 dev dummy_10
797 $IP link add dummy_10 type dummy
798 $IP link set dev dummy_10 up
799 $IP -6 address add 2001:10::1/64 dev dummy_10
806 $IP -6 route add 2001:20::$i \
811 check_rt_num 0 $($IP -6 route list |grep expires|wc -l)
818 $IP -6 route add 2001:30::$i \
824 $IP -6 route add 2001:20::$i \
829 check_rt_num 0 $($IP -6 route list |grep expires|wc -l)
836 $IP -6 route add 2001:20::$i \
842 $IP -6 route replace 2001:20::$i \
847 check_rt_num 0 $($IP -6 route list |grep expires|wc -l)
855 $IP -6 route add 2001:20::$i \
860 $IP -6 route replace 2001:20::$i \
863 check_rt_num_clean 0 $($IP -6 route list |grep expires|wc -l) || return
867 check_rt_num 5 $($IP -6 route list |grep -v expires|grep 2001:20::|wc -l)
879 $IP link del dev dummy_10
883 $IP link add veth1 type veth peer name veth2
884 $IP link set dev veth1 up
885 $IP link set dev veth2 up
886 $IP -6 address add 2001:10::1/64 dev veth1 nodad
887 $IP -6 address add 2001:10::2/64 dev veth2 nodad
900 check_rt_num_clean 1 $($IP -6 route list|grep expires|wc -l) || return
904 check_rt_num 0 $($IP -6 route list |grep expires|wc -l)
918 $IP link add dummy1 type dummy
919 $IP link set dummy1 up
920 $IP -6 route add default dev dummy1
921 $IP -6 rule add table main suppress_prefixlength 0
923 $IP -6 rule del table main suppress_prefixlength 0
924 $IP link del dummy1
974 # tricky way to convert output to 1-line without ip's
1004 run_cmd "$IP -6 ro flush ${pfx}"
1007 out=$($IP -6 ro ls match ${pfx})
1013 run_cmd "$IP -6 ro add ${pfx} ${nh}"
1036 out=$($IP -6 ro ls match ${pfx} | sed -e 's/ pref medium//')
1042 $IP li del red 2>/dev/null
1043 $IP li del dummy1 2>/dev/null
1044 $IP li del veth1 2>/dev/null
1045 $IP li del veth3 2>/dev/null
1059 ip netns exec $ns2 sysctl -qw net.ipv4.ip_forward=1
1060 ip netns exec $ns2 sysctl -qw net.ipv6.conf.all.forwarding=1
1062 $IP li add veth1 type veth peer name veth2
1063 $IP li add veth3 type veth peer name veth4
1065 $IP li set veth1 up
1066 $IP li set veth3 up
1067 $IP li set veth2 netns $ns2 up
1068 $IP li set veth4 netns $ns2 up
1069 ip -netns $ns2 li add dummy1 type dummy
1070 ip -netns $ns2 li set dummy1 up
1072 $IP -6 addr add 2001:db8:101::1/64 dev veth1 nodad
1073 $IP -6 addr add 2001:db8:103::1/64 dev veth3 nodad
1074 $IP addr add 172.16.101.1/24 dev veth1
1075 $IP addr add 172.16.103.1/24 dev veth3
1077 ip -netns $ns2 -6 addr add 2001:db8:101::2/64 dev veth2 nodad
1078 ip -netns $ns2 -6 addr add 2001:db8:103::2/64 dev veth4 nodad
1079 ip -netns $ns2 -6 addr add 2001:db8:104::1/64 dev dummy1 nodad
1081 ip -netns $ns2 addr add 172.16.101.2/24 dev veth2
1082 ip -netns $ns2 addr add 172.16.103.2/24 dev veth4
1083 ip -netns $ns2 addr add 172.16.104.1/24 dev dummy1
1097 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1099 run_cmd "$IP -6 ro add 2001:db8:104::/64 via 2001:db8:103::2"
1102 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1104 run_cmd "$IP -6 ro add 2001:db8:104::/64 dev veth3"
1107 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1109 run_cmd "$IP -6 ro add unreachable 2001:db8:104::/64"
1115 run_cmd "$IP -6 ro append 2001:db8:104::/64 via 2001:db8:103::2"
1125 run_cmd "$IP -6 ro add 2001:db8:104::/64 nexthop via 2001:db8:101::2 nexthop via 2001:db8:103::2"
1130 run_cmd "$IP -6 ro add 2001:db8:104::/64 via 2001:db8:103::2 metric 512"
1133 run_cmd "$IP -6 ro add 2001:db8:104::/64 via 2001:db8:103::3 metric 256"
1138 run_cmd "$IP -6 ro del 2001:db8:104::/64 metric 512"
1152 run_cmd "$IP -6 ro replace 2001:db8:104::/64 via 2001:db8:103::2"
1159 …run_cmd "$IP -6 ro replace 2001:db8:104::/64 nexthop via 2001:db8:101::3 nexthop via 2001:db8:103:…
1166 run_cmd "$IP -6 ro replace 2001:db8:104::/64 nexthop via 2001:db8:103::2"
1172 run_cmd "$IP -6 ro replace 2001:db8:104::/64 via 2001:db8:104::2"
1183 # - note use of change versus replace since ip adds NLM_F_CREATE
1186 run_cmd "$IP -6 ro change 2001:db8:105::/64 via 2001:db8:101::2"
1194 …run_cmd "$IP -6 ro replace 2001:db8:104::/64 nexthop via 2001:db8:101::3 nexthop via 2001:db8:103:…
1200 run_cmd "$IP -6 ro replace 2001:db8:104::/64 via 2001:db8:101::3"
1206 run_cmd "$IP -6 ro replace 2001:db8:104::/64 nexthop via 2001:db8:101::3"
1212 run_cmd "$IP -6 ro replace 2001:db8:104::/64 dev veth1"
1218 …run_cmd "$IP -6 ro replace 2001:db8:104::/64 nexthop via 2001:db8:111::3 nexthop via 2001:db8:103:…
1224 …run_cmd "$IP -6 ro replace 2001:db8:104::/64 nexthop via 2001:db8:101::3 nexthop via 2001:db8:113:…
1230 …run_cmd "$IP -6 ro change 2001:db8:105::/64 nexthop via 2001:db8:101::3 nexthop via 2001:db8:103::…
1248 run_cmd "$IP -6 route flush 2001:db8:102::/64"
1251 run_cmd "$IP -6 route add 2001:db8:102::/64 dsfield 0x04 via 2001:db8:101::2"
1268 ip addr help 2>&1 | grep -q metric
1289 $IP li add dummy1 type dummy
1290 $IP li add dummy2 type dummy
1291 $IP li set dummy1 up
1292 $IP li set dummy2 up
1295 run_cmd "$IP -6 addr add dev dummy1 2001:db8:104::1/64"
1296 run_cmd "$IP -6 addr add dev dummy2 2001:db8:104::2/64"
1303 run_cmd "$IP -6 addr flush dev dummy1"
1304 run_cmd "$IP -6 addr add dev dummy1 2001:db8:104::1/64 metric 257"
1311 run_cmd "$IP -6 addr flush dev dummy2"
1312 run_cmd "$IP -6 addr add dev dummy2 2001:db8:104::2/64 metric 258"
1318 run_cmd "$IP -6 addr del dev dummy1 2001:db8:104::1/64 metric 257"
1326 run_cmd "$IP -6 addr change dev dummy2 2001:db8:104::2/64 metric 259"
1335 run_cmd "ip netns exec $ns1 sysctl -qw net.ipv6.conf.all.keep_addr_on_down=1"
1336 run_cmd "$IP li set dev dummy2 down"
1339 out=$($IP -6 ro ls match 2001:db8:104::/64)
1346 run_cmd "$IP li set dev dummy2 up"
1356 run_cmd "$IP -6 addr flush dev dummy2"
1357 run_cmd "$IP -6 addr add dev dummy2 2001:db8:104::1 peer 2001:db8:104::2 metric 260"
1366 run_cmd "$IP -6 addr change dev dummy2 2001:db8:104::1 peer 2001:db8:104::3 metric 261"
1374 $IP li del dummy1
1375 $IP li del dummy2
1391 run_cmd "$IP -6 ro add 2001:db8:111::/64 via 2001:db8:101::2 mtu 1400"
1403 run_cmd "$IP -6 ro add 2001:db8:112::/64 via 2001:db8:101::2 mtu 1400"
1404 run_cmd "$IP -6 ro append 2001:db8:112::/64 via 2001:db8:103::2"
1414 run_cmd "$IP -6 ro add 2001:db8:113::/64 via 2001:db8:101::2"
1415 run_cmd "$IP -6 ro append 2001:db8:113::/64 via 2001:db8:103::2 mtu 1400"
1423 run_cmd "$IP -6 ro del 2001:db8:113::/64 via 2001:db8:101::2"
1432 …run_cmd "$IP -6 ro add 2001:db8:115::/64 mtu 1400 nexthop via 2001:db8:101::2 nexthop via 2001:db8…
1440 $IP -6 ro add 2001:db8:104::/64 via 2001:db8:101::2 mtu 1300
1441 run_cmd "ip netns exec $ns1 ${ping6} -w1 -c1 -s 1500 2001:db8:104::1"
1444 run_cmd "$IP -6 ro add 2001:db8:114::/64 via 2001:db8:101::2 congctl lock foo"
1464 run_cmd "$IP ro flush ${pfx}"
1467 out=$($IP ro ls match ${pfx})
1473 run_cmd "$IP ro add ${pfx} ${nh}"
1496 out=$($IP ro ls match ${pfx})
1509 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1511 run_cmd "$IP ro add 172.16.104.0/24 via 172.16.103.2"
1514 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1516 run_cmd "$IP ro add 172.16.104.0/24 dev veth3"
1519 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1521 run_cmd "$IP ro add unreachable 172.16.104.0/24"
1527 run_cmd "$IP ro prepend 172.16.104.0/24 via 172.16.103.2"
1534 run_cmd "$IP ro append 172.16.104.0/24 via 172.16.103.2"
1539 run_cmd "$IP ro append 172.16.104.0/24 dev veth3"
1544 run_cmd "$IP ro append unreachable 172.16.104.0/24"
1548 run_cmd "$IP ro flush 172.16.104.0/24"
1549 run_cmd "$IP ro add unreachable 172.16.104.0/24"
1550 run_cmd "$IP ro append 172.16.104.0/24 via 172.16.103.2"
1554 run_cmd "$IP ro flush 172.16.104.0/24"
1555 run_cmd "$IP ro add unreachable 172.16.104.0/24"
1556 run_cmd "$IP ro append 172.16.104.0/24 dev veth3"
1566 run_cmd "$IP ro add 172.16.104.0/24 nexthop via 172.16.101.2 nexthop via 172.16.103.2"
1571 run_cmd "$IP ro add 172.16.104.0/24 via 172.16.103.2 metric 512"
1574 run_cmd "$IP ro add 172.16.104.0/24 via 172.16.103.3 metric 256"
1579 run_cmd "$IP ro del 172.16.104.0/24 metric 512"
1593 run_cmd "$IP ro replace 172.16.104.0/24 via 172.16.103.2"
1600 run_cmd "$IP ro replace 172.16.104.0/24 nexthop via 172.16.101.3 nexthop via 172.16.103.2"
1607 run_cmd "$IP ro replace unreachable 172.16.104.0/24"
1614 run_cmd "$IP ro replace 172.16.104.0/24 nexthop via 172.16.103.2"
1620 run_cmd "$IP ro replace 172.16.104.0/24 via 2001:db8:104::2"
1631 # - note use of change versus replace since ip adds NLM_F_CREATE
1634 run_cmd "$IP ro change 172.16.105.0/24 via 172.16.101.2"
1642 run_cmd "$IP ro replace 172.16.104.0/24 nexthop via 172.16.101.3 nexthop via 172.16.103.3"
1648 run_cmd "$IP ro replace 172.16.104.0/24 via 172.16.101.3"
1654 run_cmd "$IP ro replace 172.16.104.0/24 nexthop via 172.16.101.3"
1660 run_cmd "$IP ro replace unreachable 172.16.104.0/24"
1666 run_cmd "$IP ro replace 172.16.104.0/24 nexthop via 172.16.111.3 nexthop via 172.16.103.3"
1672 run_cmd "$IP ro replace 172.16.104.0/24 nexthop via 172.16.101.3 nexthop via 172.16.113.3"
1678 run_cmd "$IP ro change 172.16.105.0/24 nexthop via 172.16.101.3 nexthop via 172.16.103.3"
1695 run_cmd "ip addr add 10.0.0.1/32 dev lo"
1697 run_cmd "ip link add veth-outside type veth peer name veth-inside"
1698 run_cmd "ip link add vrf-100 type vrf table 1100"
1699 run_cmd "ip link set veth-outside master vrf-100"
1700 run_cmd "ip link set veth-inside netns $test-ns"
1701 run_cmd "ip link set veth-outside up"
1702 run_cmd "ip link set vrf-100 up"
1703 run_cmd "ip route add 10.1.1.1/32 dev veth-outside table 1100"
1704 run_cmd "ip netns exec $test-ns ip link set veth-inside up"
1705 run_cmd "ip netns exec $test-ns ip addr add 10.1.1.1/32 dev veth-inside"
1706 run_cmd "ip netns exec $test-ns ip route add 10.0.0.1/32 dev veth-inside"
1707 run_cmd "ip netns exec $test-ns ip route add default via 10.0.0.1"
1708 run_cmd "ip netns exec $test-ns ping 10.0.0.1 -c 1 -i 1"
1709 run_cmd "ip link delete vrf-100"
1720 run_cmd "$IP route flush 172.16.102.0/24"
1723 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x01 via 172.16.101.2"
1726 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x02 via 172.16.101.2"
1729 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x03 via 172.16.101.2"
1733 run_cmd "$IP route add 172.16.102.0/24 via 172.16.101.2"
1736 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x10 via 172.16.103.2"
1739 $IP route get fibmatch 172.16.102.1 dsfield 0x10 | \
1743 $IP route get fibmatch 172.16.102.1 dsfield 0x11 | \
1747 $IP route get fibmatch 172.16.102.1 dsfield 0x12 | \
1751 $IP route get fibmatch 172.16.102.1 dsfield 0x13 | \
1756 $IP route get fibmatch 172.16.102.1 dsfield 0x14 | \
1760 $IP route get fibmatch 172.16.102.1 dsfield 0x15 | \
1764 $IP route get fibmatch 172.16.102.1 dsfield 0x16 | \
1768 $IP route get fibmatch 172.16.102.1 dsfield 0x17 | \
1773 $IP route get fibmatch 172.16.102.1 dsfield 0x00 | \
1777 $IP route get fibmatch 172.16.102.1 dsfield 0x01 | \
1781 $IP route get fibmatch 172.16.102.1 dsfield 0x02 | \
1785 $IP route get fibmatch 172.16.102.1 dsfield 0x03 | \
1814 $IP li add dummy1 type dummy
1815 $IP li add dummy2 type dummy
1816 $IP li set dummy1 up
1817 $IP li set dummy2 up
1820 run_cmd "$IP addr add dev dummy1 172.16.104.1/24"
1821 run_cmd "$IP addr add dev dummy2 172.16.104.2/24"
1828 run_cmd "$IP addr flush dev dummy1"
1829 run_cmd "$IP addr add dev dummy1 172.16.104.1/24 metric 257"
1836 run_cmd "$IP addr flush dev dummy2"
1837 run_cmd "$IP addr add dev dummy2 172.16.104.2/24 metric 258"
1843 run_cmd "$IP addr del dev dummy1 172.16.104.1/24 metric 257"
1851 run_cmd "$IP addr change dev dummy2 172.16.104.2/24 metric 259"
1860 run_cmd "$IP li set dev dummy2 down"
1863 out=$($IP ro ls match 172.16.104.0/24)
1870 run_cmd "$IP li set dev dummy2 up"
1879 run_cmd "$IP addr flush dev dummy2"
1880 run_cmd "$IP addr add dev dummy2 172.16.104.0/24 metric 259"
1881 run_cmd "$IP addr change dev dummy2 172.16.104.0/24 metric 260"
1889 run_cmd "$IP addr flush dev dummy2"
1890 run_cmd "$IP addr add dev dummy2 172.16.104.1/32 peer 172.16.104.2 metric 260"
1898 run_cmd "$IP addr change dev dummy2 172.16.104.1/32 peer 172.16.104.3 metric 261"
1906 $IP li del dummy1
1907 $IP li del dummy2
1920 run_cmd "$IP ro add 172.16.111.0/24 via 172.16.101.2 mtu 1400"
1929 run_cmd "$IP ro add 172.16.112.0/24 mtu 1400 nexthop via 172.16.101.2 nexthop via 172.16.103.2"
1937 $IP ro add 172.16.104.0/24 via 172.16.101.2 mtu 1300
1938 run_cmd "ip netns exec $ns1 ping -w1 -c1 -s 1500 172.16.104.1"
1941 run_cmd "$IP ro add 172.16.111.0/24 via 172.16.101.2 congctl lock foo"
1955 $IP li add dummy1 type dummy
1956 $IP li set dummy1 up
1957 $IP li add dummy2 type dummy
1958 $IP li set dummy2 up
1959 $IP li add red type vrf table 1111
1960 $IP li set red up
1961 $IP ro add vrf red unreachable default
1962 $IP li set dummy2 vrf red
1964 $IP addr add dev dummy1 172.16.104.1/24
1965 $IP addr add dev dummy1 172.16.104.11/24
1966 $IP addr add dev dummy1 172.16.104.12/24
1967 $IP addr add dev dummy1 172.16.104.13/24
1968 $IP addr add dev dummy2 172.16.104.1/24
1969 $IP addr add dev dummy2 172.16.104.11/24
1970 $IP addr add dev dummy2 172.16.104.12/24
1971 $IP route add 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1972 $IP route add 172.16.106.0/24 dev lo src 172.16.104.12
1973 $IP route add table 0 172.16.107.0/24 via 172.16.104.2 src 172.16.104.13
1974 $IP route add vrf red 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1975 $IP route add vrf red 172.16.106.0/24 dev lo src 172.16.104.12
1981 $IP addr del dev dummy2 172.16.104.11/24
1982 $IP ro ls vrf red | grep -q 172.16.105.0/24
1985 $IP ro ls | grep -q 172.16.105.0/24
1988 $IP addr add dev dummy2 172.16.104.11/24
1989 $IP route add vrf red 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1991 $IP addr del dev dummy1 172.16.104.11/24
1992 $IP ro ls | grep -q 172.16.105.0/24
1995 $IP ro ls vrf red | grep -q 172.16.105.0/24
2002 $IP addr del dev dummy2 172.16.104.12/24
2003 $IP ro ls vrf red | grep -q 172.16.106.0/24
2006 $IP ro ls | grep -q 172.16.106.0/24
2009 $IP addr add dev dummy2 172.16.104.12/24
2010 $IP route add vrf red 172.16.106.0/24 dev lo src 172.16.104.12
2012 $IP addr del dev dummy1 172.16.104.12/24
2013 $IP ro ls | grep -q 172.16.106.0/24
2016 $IP ro ls vrf red | grep -q 172.16.106.0/24
2023 $IP addr del dev dummy1 172.16.104.13/24
2024 $IP ro ls | grep -q 172.16.107.0/24
2027 $IP li del dummy1
2028 $IP li del dummy2
2041 $IP li add dummy${i} up type dummy
2044 $IP li add red up type vrf table 1111
2045 $IP ro add vrf red unreachable default
2047 $IP li set dummy${i} vrf red
2050 $IP addr add dev dummy1 fe80::1/128
2051 $IP addr add dev dummy1 2001:db8:101::1/64
2052 $IP addr add dev dummy1 2001:db8:101::10/64
2053 $IP addr add dev dummy1 2001:db8:101::11/64
2054 $IP addr add dev dummy1 2001:db8:101::12/64
2055 $IP addr add dev dummy1 2001:db8:101::13/64
2056 $IP addr add dev dummy1 2001:db8:101::14/64
2057 $IP addr add dev dummy1 2001:db8:101::15/64
2058 $IP addr add dev dummy2 fe80::1/128
2059 $IP addr add dev dummy2 2001:db8:101::1/64
2060 $IP addr add dev dummy2 2001:db8:101::11/64
2061 $IP addr add dev dummy3 fe80::1/128
2063 $IP addr add dev dummy4 2001:db8:101::1/64
2064 $IP addr add dev dummy4 2001:db8:101::10/64
2065 $IP addr add dev dummy4 2001:db8:101::11/64
2066 $IP addr add dev dummy4 2001:db8:101::12/64
2067 $IP addr add dev dummy4 2001:db8:101::13/64
2068 $IP addr add dev dummy4 2001:db8:101::14/64
2069 $IP addr add dev dummy5 2001:db8:101::1/64
2070 $IP addr add dev dummy5 2001:db8:101::11/64
2073 $IP route add 2001:db8:110::/64 dev dummy3 src 2001:db8:101::10
2075 $IP route add 2001:db8:111::/64 dev dummy3 src 2001:db8:101::11
2077 $IP route add vrf red 2001:db8:110::/64 dev dummy6 src 2001:db8:101::10
2079 $IP route add vrf red 2001:db8:111::/64 dev dummy6 src 2001:db8:101::11
2081 $IP route add 2001:db8:112::/64 dev dummy3 src 2001:db8:101::12
2082 $IP route add vrf red 2001:db8:112::/64 dev dummy6 src 2001:db8:101::12
2084 $IP route add 2001:db8:113::/64 dev lo src 2001:db8:101::13
2085 $IP route add vrf red 2001:db8:113::/64 dev lo src 2001:db8:101::13
2087 $IP route add table 0 2001:db8:115::/64 via 2001:db8:101::2 src 2001:db8:101::15
2089 $IP route add 2001:db8:116::/64 dev dummy2 src fe80::1
2090 $IP route add 2001:db8:117::/64 dev dummy3 src fe80::1
2095 $IP addr del dev dummy1 2001:db8:101::10/64
2096 $IP -6 route show | grep -q "src 2001:db8:101::10 "
2101 $IP addr del dev dummy1 2001:db8:101::11/64
2102 $IP -6 route show | grep -q "src 2001:db8:101::11 "
2105 $IP addr del dev dummy2 2001:db8:101::11/64
2106 $IP -6 route show | grep -q "src 2001:db8:101::11 "
2111 $IP addr del dev dummy4 2001:db8:101::10/64
2112 $IP -6 route show vrf red | grep -q "src 2001:db8:101::10 "
2117 $IP addr del dev dummy4 2001:db8:101::11/64
2118 $IP -6 route show vrf red | grep -q "src 2001:db8:101::11 "
2121 $IP addr del dev dummy5 2001:db8:101::11/64
2122 $IP -6 route show vrf red | grep -q "src 2001:db8:101::11 "
2127 $IP addr del dev dummy4 2001:db8:101::12/64
2128 $IP -6 route show vrf red | grep -q "src 2001:db8:101::12 "
2130 $IP -6 route show | grep -q " src 2001:db8:101::12 "
2133 $IP addr add dev dummy4 2001:db8:101::12/64
2134 $IP route replace vrf red 2001:db8:112::/64 dev dummy6 src 2001:db8:101::12
2135 $IP addr del dev dummy1 2001:db8:101::12/64
2136 $IP -6 route show vrf red | grep -q "src 2001:db8:101::12 "
2138 $IP -6 route show | grep -q " src 2001:db8:101::12 "
2143 $IP addr del dev dummy4 2001:db8:101::13/64
2144 $IP -6 route show vrf red | grep -q "src 2001:db8:101::13 "
2146 $IP -6 route show | grep -q "src 2001:db8:101::13 "
2149 $IP addr add dev dummy4 2001:db8:101::13/64
2150 $IP addr del dev dummy1 2001:db8:101::13/64
2151 $IP -6 route show vrf red | grep -q "src 2001:db8:101::13 "
2153 $IP -6 route show | grep -q "src 2001:db8:101::13 "
2158 $IP addr del dev dummy1 2001:db8:101::15/64
2159 $IP -6 route show | grep -q "src 2001:db8:101::15"
2163 $IP addr del dev dummy1 fe80::1/128
2164 $IP -6 route show | grep -q "2001:db8:116::/64 dev dummy2 src fe80::1"
2166 $IP addr del dev dummy2 fe80::1/128
2167 $IP -6 route show | grep -q "2001:db8:116::/64 dev dummy2 src fe80::1"
2169 $IP -6 route show | grep -q "2001:db8:117::/64 dev dummy3 src fe80::1"
2171 $IP addr add dev dummy1 fe80::1/128
2172 $IP addr del dev dummy3 fe80::1/128
2173 $IP -6 route show | grep -q "2001:db8:117::/64 dev dummy3 src fe80::1"
2177 $IP li del dummy${i}
2195 run_cmd "$IP ro add 172.16.104.0/24 via inet6 2001:db8:101::2"
2202 run_cmd "ip netns exec $ns1 ping -w1 -c1 172.16.104.1"
2205 run_cmd "$IP ro del 172.16.104.0/24 via inet6 2001:db8:101::2"
2215 …run_cmd "$IP ro add 172.16.104.0/24 nexthop via inet6 2001:db8:101::2 dev veth1 nexthop via 172.16…
2222 …run_cmd "$IP ro del 172.16.104.0/24 nexthop via 172.16.103.2 dev veth3 nexthop via inet6 2001:db8:…
2225 …run_cmd "$IP ro del 172.16.104.0/24 nexthop via inet6 2001:db8:101::2 dev veth1 nexthop via 172.16…
2231 …run_cmd "$IP ro add 172.16.104.0/24 nexthop via 172.16.103.2 dev veth3 nexthop via inet6 2001:db8:…
2238 …run_cmd "$IP ro del 172.16.104.0/24 nexthop via inet6 2001:db8:101::2 dev veth1 nexthop via 172.16…
2241 …run_cmd "$IP ro del 172.16.104.0/24 nexthop via 172.16.103.2 dev veth3 nexthop via inet6 2001:db8:…
2293 ip netns exec $ns2 socat UDP4-LISTEN:54321,fork $tmp_file &
2297 $IP rule add pref 100 ipproto udp sport 12345 dport 54321 table 123
2298 $IP route add table 123 172.16.101.0/24 dev veth1
2302 $IP route add unreachable 172.16.101.2/32
2327 $IP route del unreachable 172.16.101.2/32
2328 $IP route del table 123 172.16.101.0/24 dev veth1
2329 $IP rule del pref 100
2351 ip netns exec $ns2 socat UDP6-LISTEN:54321,fork $tmp_file &
2355 $IP -6 rule add pref 100 ipproto udp sport 12345 dport 54321 table 123
2356 $IP -6 route add table 123 2001:db8:101::/64 dev veth1
2360 $IP -6 route add unreachable 2001:db8:101::2/128
2385 $IP -6 route del unreachable 2001:db8:101::2/128
2386 $IP -6 route del table 123 2001:db8:101::/64 dev veth1
2387 $IP -6 rule del pref 100
2397 ip neigh help 2>&1 | grep -q 'ip neigh get'
2418 run_cmd "$IP neigh add 192.0.2.111 lladdr 00:11:22:33:44:55 nud perm dev dummy0"
2419 run_cmd "$IP neigh add 192.0.2.255 lladdr 00:11:22:33:44:55 nud perm dev dummy0"
2421 run_cmd "$IP neigh get 192.0.2.111 dev dummy0"
2422 run_cmd "$IP neigh get 192.0.2.255 dev dummy0"
2424 run_cmd "$IP address add 192.0.2.1/24 broadcast 192.0.2.111 dev dummy0"
2426 run_cmd "$IP neigh add 203.0.113.111 nud failed dev dummy0"
2427 run_cmd "$IP neigh add 203.0.113.255 nud failed dev dummy0"
2429 run_cmd "$IP neigh get 203.0.113.111 dev dummy0"
2430 run_cmd "$IP neigh get 203.0.113.255 dev dummy0"
2432 run_cmd "$IP address add 203.0.113.1/24 broadcast 203.0.113.111 dev dummy0"
2435 run_cmd "$IP neigh get 192.0.2.111 dev dummy0"
2438 run_cmd "$IP neigh get 192.0.2.255 dev dummy0"
2441 run_cmd "$IP neigh get 203.0.113.111 dev dummy0"
2444 run_cmd "$IP neigh get 203.0.113.255 dev dummy0"
2494 ip -n $ns -j -s link show dev $dev \
2520 run_cmd "ip netns exec $ns1 ethtool -K veth1 tcp-segmentation-offload off"
2522 run_cmd "ip netns exec $ns2 bash -c \"echo 20000 > /sys/class/net/veth2/gro_flush_timeout\""
2523 run_cmd "ip netns exec $ns2 bash -c \"echo 1 > /sys/class/net/veth2/napi_defer_hard_irqs\""
2524 run_cmd "ip netns exec $ns2 ethtool -K veth2 generic-receive-offload on"
2525 run_cmd "ip -n $ns2 link add name nh1 up type dummy"
2526 run_cmd "ip -n $ns2 link add name nh2 up type dummy"
2527 run_cmd "ip -n $ns2 address add 172.16.201.1/24 dev nh1"
2528 run_cmd "ip -n $ns2 address add 172.16.202.1/24 dev nh2"
2529 run_cmd "ip -n $ns2 neigh add 172.16.201.2 lladdr 00:11:22:33:44:55 nud perm dev nh1"
2530 run_cmd "ip -n $ns2 neigh add 172.16.202.2 lladdr 00:aa:bb:cc:dd:ee nud perm dev nh2"
2531 run_cmd "ip -n $ns2 route add 203.0.113.0/24
2533 run_cmd "ip netns exec $ns2 sysctl -qw net.ipv4.fib_multipath_hash_policy=1"
2534 run_cmd "ip netns exec $ns2 sysctl -qw net.ipv4.conf.veth2.rp_filter=0"
2535 run_cmd "ip netns exec $ns2 sysctl -qw net.ipv4.conf.all.rp_filter=0"
2536 run_cmd "ip netns exec $ns2 sysctl -qw net.ipv4.conf.default.rp_filter=0"
2539 local dmac=$(ip -n $ns2 -j link show dev veth2 | jq -r '.[]["address"]')
2541 local cmd="ip netns exec $ns1 mausezahn veth1 -a own -b $dmac
2568 run_cmd "ip netns exec $ns1 ethtool -K veth1 tcp-segmentation-offload off"
2570 run_cmd "ip netns exec $ns2 bash -c \"echo 20000 > /sys/class/net/veth2/gro_flush_timeout\""
2571 run_cmd "ip netns exec $ns2 bash -c \"echo 1 > /sys/class/net/veth2/napi_defer_hard_irqs\""
2572 run_cmd "ip netns exec $ns2 ethtool -K veth2 generic-receive-offload on"
2573 run_cmd "ip -n $ns2 link add name nh1 up type dummy"
2574 run_cmd "ip -n $ns2 link add name nh2 up type dummy"
2575 run_cmd "ip -n $ns2 -6 address add 2001:db8:201::1/64 dev nh1"
2576 run_cmd "ip -n $ns2 -6 address add 2001:db8:202::1/64 dev nh2"
2577 run_cmd "ip -n $ns2 -6 neigh add 2001:db8:201::2 lladdr 00:11:22:33:44:55 nud perm dev nh1"
2578 run_cmd "ip -n $ns2 -6 neigh add 2001:db8:202::2 lladdr 00:aa:bb:cc:dd:ee nud perm dev nh2"
2579 run_cmd "ip -n $ns2 -6 route add 2001:db8:301::/64
2581 run_cmd "ip netns exec $ns2 sysctl -qw net.ipv6.fib_multipath_hash_policy=1"
2584 local dmac=$(ip -n $ns2 -j link show dev veth2 | jq -r '.[]["address"]')
2586 local cmd="ip netns exec $ns1 mausezahn -6 veth1 -a own -b $dmac
2636 PEER_CMD="ip netns exec ${PEER_NS}"
2646 if [ ! -x "$(command -v ip)" ]; then
2647 echo "SKIP: Could not run test without ip tool"
2651 ip route help 2>&1 | grep -q fibmatch