Lines Matching full:route

99 	echo "Single path route test"
104 $IP route get fibmatch 198.51.100.2 &> /dev/null
106 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
114 $IP route get fibmatch 198.51.100.2 &> /dev/null
115 log_test $? 2 "IPv4 fibmatch - no route"
116 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
117 log_test $? 2 "IPv6 fibmatch - no route"
126 echo "Multipath route test"
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
155 $IP route get fibmatch 203.0.113.1 &> /dev/null
156 log_test $? 2 "IPv4 - multipath route removed on delete"
158 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
159 # In IPv6 we do not flush the entire multipath route.
167 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
168 log_test $? 2 "IPv6 - no route"
187 $IP route get fibmatch 198.51.100.2 &> /dev/null
189 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
196 echo " Route deleted on 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 | \
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
288 $IP route get fibmatch 203.0.113.1 &> /dev/null
290 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
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 | \
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 | \
351 echo " Route to local address with carrier down"
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 | \
372 echo "Single path route carrier test"
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 | \
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 | \
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 | \
508 # run 'ip route add' with given spec
523 cmd="$IP route add vrf $vrf $pfx $gw $dev"
591 add_rt "VRF route, gateway can be local address in default VRF" 0 \
595 add_rt "VRF route, gateway can not be a local address" 2 \
597 add_rt "VRF route, gateway can not be a local addr with device" 2 \
624 $IP -4 route add vrf red unreachable default metric 4278198272
625 $IP -6 route add vrf red unreachable default metric 4278198272
659 echo "Fib6 info length calculation in route notify test"
669 $NS_EXEC ip monitor route &> errors.txt &
672 $IP -6 route add 2001::/64 \
690 log_test $ret 0 "ipv6 route add notify"
705 echo "Fib4 info length calculation in route notify test"
716 $NS_EXEC ip monitor route &> errors.txt &
719 $IP route add 10.0.0.0/24 \
737 log_test $ret 0 "ipv4 route add notify"
757 $NS_EXEC sysctl -wq net.ipv6.route.gc_interval=$EXPIRE
763 $NS_EXEC sysctl -wq net.ipv6.route.flush=1
767 # Expire route after $EXPIRE seconds
768 $IP -6 route add 2001:20::$i \
772 N_EXP_SLEEP=$($IP -6 route list |grep expires|wc -l)
782 $IP -6 route add 2001:30::$i \
787 # Expire route after $EXPIRE seconds
788 $IP -6 route add 2001:20::$i \
792 N_EXP_SLEEP=$($IP -6 route list |grep expires|wc -l)
803 log_test $ret 0 "ipv6 route garbage collection"
816 $IP -6 route add default dev dummy1
829 # Tests on route add and replace
863 printf "\nNo route entry found\n"
876 printf " Unexpected route entry. Have:\n"
886 # add route for a prefix, flushing any existing routes first
911 echo "Failed to add initial route for test."
916 # add initial route - used in replace route tests
984 # assumption is that basic add of a single path route works
991 echo "IPv6 route add / append tests"
993 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
996 log_test $? 2 "Attempt to add duplicate route - gw"
998 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1001 log_test $? 2 "Attempt to add duplicate route - dev only"
1003 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1006 log_test $? 2 "Attempt to add duplicate route - reject route"
1008 # route append with same prefix adds a new route
1013 log_test $? 0 "Append nexthop to existing route - gw"
1018 log_test $? 0 "Add multipath route"
1022 log_test $? 2 "Attempt to add duplicate multipath route"
1024 # insert of a second route without append but different metric
1032 log_test $rc 0 "Route add with different metrics"
1040 log_test $rc 0 "Route delete with metric"
1066 # route replace fails - invalid nexthop
1078 # replace non-existent route
1083 log_test $? 2 "Single path - replace of non-existent route"
1112 # route replace fails - invalid nexthop 1
1118 # route replace fails - invalid nexthop 2
1124 # multipath non-existent route
1127 log_test $? 2 "Multipath - replace of non-existent route"
1133 echo "IPv6 route replace tests"
1142 echo "IPv6 route with dsfield tests"
1144 run_cmd "$IP -6 route flush 2001:db8:102::/64"
1147 run_cmd "$IP -6 route add 2001:db8:102::/64 dsfield 0x04 via 2001:db8:101::2"
1148 log_test $? 2 "Reject route with dsfield"
1178 echo "IPv6 prefix route tests"
1230 # verify prefix route removed on down
1239 log_test $rc 0 "Prefix route removed on link down"
1241 # verify prefix route re-inserted with assigned metric
1248 log_test $rc 0 "Prefix route with metric on link up"
1257 log_test $? 0 "Set metric with peer route on local side"
1259 log_test $? 0 "Set metric with peer route on peer side"
1293 log_test $rc 0 "Single path route with mtu metric"
1306 log_test $rc 0 "Multipath route via 2 single routes with mtu metric on first"
1308 # second route is coalesced to first to make a multipath route.
1317 log_test $rc 0 "Multipath route via 2 single routes with mtu metric on 2nd"
1334 log_test $rc 0 "Multipath route with mtu metric"
1338 log_test $? 0 "Using route with mtu metric"
1346 # add route for a prefix, flushing any existing routes first
1371 echo "Failed to add initial route for test."
1376 # add initial route - used in replace route tests
1396 # assumption is that basic add of a single path route works
1403 echo "IPv4 route add / append tests"
1405 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1408 log_test $? 2 "Attempt to add duplicate route - gw"
1410 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1413 log_test $? 2 "Attempt to add duplicate route - dev only"
1415 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1418 log_test $? 2 "Attempt to add duplicate route - reject route"
1421 # - adds a new route; does NOT convert existing route to ECMP
1427 # route append with same prefix adds a new route
1432 log_test $? 0 "Append nexthop to existing route - gw"
1437 log_test $? 0 "Append nexthop to existing route - dev only"
1442 log_test $? 0 "Append nexthop to existing route - reject route"
1448 log_test $? 0 "Append nexthop to existing reject route - gw"
1454 log_test $? 0 "Append nexthop to existing reject route - dev only"
1459 log_test $? 0 "add multipath route"
1463 log_test $? 2 "Attempt to add duplicate multipath route"
1465 # insert of a second route without append but different metric
1473 log_test $rc 0 "Route add with different metrics"
1481 log_test $rc 0 "Route delete with metric"
1505 log_test $? 0 "Single path with reject route"
1514 # route replace fails - invalid nexthop
1526 # replace non-existent route
1531 log_test $? 2 "Single path - replace of non-existent route"
1558 log_test $? 0 "Multipath with reject route"
1560 # route replace fails - invalid nexthop 1
1566 # route replace fails - invalid nexthop 2
1572 # multipath non-existent route
1575 log_test $? 2 "Multipath - replace of non-existent route"
1581 echo "IPv4 route replace tests"
1587 # checks that cached input route on VRF port is deleted
1599 run_cmd "ip route add 10.1.1.1/32 dev veth-outside table 1100"
1602 run_cmd "ip netns exec $test-ns ip route add 10.0.0.1/32 dev veth-inside"
1603 run_cmd "ip netns exec $test-ns ip route add default via 10.0.0.1"
1608 log_test $? 0 "Cached route removed from VRF port device"
1614 echo "IPv4 route with dsfield tests"
1616 run_cmd "$IP route flush 172.16.102.0/24"
1619 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x01 via 172.16.101.2"
1620 log_test $? 2 "Reject route with dsfield 0x01"
1622 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x02 via 172.16.101.2"
1623 log_test $? 2 "Reject route with dsfield 0x02"
1625 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x03 via 172.16.101.2"
1626 log_test $? 2 "Reject route with dsfield 0x03"
1628 # A generic route that doesn't take DSCP into account
1629 run_cmd "$IP route add 172.16.102.0/24 via 172.16.101.2"
1631 # A more specific route for DSCP 0x10
1632 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x10 via 172.16.103.2"
1634 # DSCP 0x10 should match the specific route, no matter the ECN bits
1635 $IP route get fibmatch 172.16.102.1 dsfield 0x10 | \
1637 log_test $? 0 "IPv4 route with DSCP and ECN:Not-ECT"
1639 $IP route get fibmatch 172.16.102.1 dsfield 0x11 | \
1641 log_test $? 0 "IPv4 route with DSCP and ECN:ECT(1)"
1643 $IP route get fibmatch 172.16.102.1 dsfield 0x12 | \
1645 log_test $? 0 "IPv4 route with DSCP and ECN:ECT(0)"
1647 $IP route get fibmatch 172.16.102.1 dsfield 0x13 | \
1649 log_test $? 0 "IPv4 route with DSCP and ECN:CE"
1651 # Unknown DSCP should match the generic route, no matter the ECN bits
1652 $IP route get fibmatch 172.16.102.1 dsfield 0x14 | \
1654 log_test $? 0 "IPv4 route with unknown DSCP and ECN:Not-ECT"
1656 $IP route get fibmatch 172.16.102.1 dsfield 0x15 | \
1658 log_test $? 0 "IPv4 route with unknown DSCP and ECN:ECT(1)"
1660 $IP route get fibmatch 172.16.102.1 dsfield 0x16 | \
1662 log_test $? 0 "IPv4 route with unknown DSCP and ECN:ECT(0)"
1664 $IP route get fibmatch 172.16.102.1 dsfield 0x17 | \
1666 log_test $? 0 "IPv4 route with unknown DSCP and ECN:CE"
1668 # Null DSCP should match the generic route, no matter the ECN bits
1669 $IP route get fibmatch 172.16.102.1 dsfield 0x00 | \
1671 log_test $? 0 "IPv4 route with no DSCP and ECN:Not-ECT"
1673 $IP route get fibmatch 172.16.102.1 dsfield 0x01 | \
1675 log_test $? 0 "IPv4 route with no DSCP and ECN:ECT(1)"
1677 $IP route get fibmatch 172.16.102.1 dsfield 0x02 | \
1679 log_test $? 0 "IPv4 route with no DSCP and ECN:ECT(0)"
1681 $IP route get fibmatch 172.16.102.1 dsfield 0x03 | \
1683 log_test $? 0 "IPv4 route with no DSCP and ECN:CE"
1703 echo "IPv4 prefix route tests"
1755 # verify prefix route removed on down
1763 log_test $rc 0 "Prefix route removed on link down"
1765 # verify prefix route re-inserted with assigned metric
1772 log_test $rc 0 "Prefix route with metric on link up"
1792 log_test $rc 0 "Set metric of address with peer route"
1800 log_test $rc 0 "Modify metric and peer address for peer route"
1812 echo "IPv4 route add / append tests"
1822 log_test $rc 0 "Single path route with mtu metric"
1831 log_test $rc 0 "Multipath route with mtu metric"
1835 log_test $? 0 "Using route with mtu metric"
1846 echo "IPv4 delete address route tests"
1867 $IP route add 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1868 $IP route add 172.16.106.0/24 dev lo src 172.16.104.12
1869 $IP route add table 0 172.16.107.0/24 via 172.16.104.2 src 172.16.104.13
1870 $IP route add vrf red 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1871 $IP route add vrf red 172.16.106.0/24 dev lo src 172.16.104.12
1874 # removing address from device in vrf should only remove route from vrf table
1879 log_test $? 1 "Route removed from VRF when source address deleted"
1882 log_test $? 0 "Route in default VRF not removed"
1885 $IP route add vrf red 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1889 log_test $? 1 "Route removed in default VRF when source address deleted"
1892 log_test $? 0 "Route in VRF is not removed by address delete"
1894 # removing address from device in vrf should only remove route from vrf
1900 log_test $? 1 "Route removed from VRF when source address deleted"
1903 log_test $? 0 "Route in default VRF not removed"
1906 $IP route add vrf red 172.16.106.0/24 dev lo src 172.16.104.12
1910 log_test $? 1 "Route removed in default VRF when source address deleted"
1913 log_test $? 0 "Route in VRF is not removed by address delete"
1915 # removing address from device in default vrf should remove route from
1916 # the default vrf even when route was inserted with a table ID of 0.
1921 log_test $? 1 "Route removed in default VRF when source address deleted"
1931 echo "IPv6 delete address route tests"
1969 $IP route add 2001:db8:110::/64 dev dummy3 src 2001:db8:101::10
1971 $IP route add 2001:db8:111::/64 dev dummy3 src 2001:db8:101::11
1973 $IP route add vrf red 2001:db8:110::/64 dev dummy6 src 2001:db8:101::10
1975 $IP route add vrf red 2001:db8:111::/64 dev dummy6 src 2001:db8:101::11
1977 $IP route add 2001:db8:112::/64 dev dummy3 src 2001:db8:101::12
1978 $IP route add vrf red 2001:db8:112::/64 dev dummy6 src 2001:db8:101::12
1980 $IP route add 2001:db8:113::/64 dev lo src 2001:db8:101::13
1981 $IP route add vrf red 2001:db8:113::/64 dev lo src 2001:db8:101::13
1983 $IP route add table 0 2001:db8:115::/64 via 2001:db8:101::2 src 2001:db8:101::15
1984 # Link local source route
1985 $IP route add 2001:db8:116::/64 dev dummy2 src fe80::1
1986 $IP route add 2001:db8:117::/64 dev dummy3 src fe80::1
1992 $IP -6 route show | grep -q "src 2001:db8:101::10 "
1998 $IP -6 route show | grep -q "src 2001:db8:101::11 "
2002 $IP -6 route show | grep -q "src 2001:db8:101::11 "
2008 $IP -6 route show vrf red | grep -q "src 2001:db8:101::10 "
2014 $IP -6 route show vrf red | grep -q "src 2001:db8:101::11 "
2018 $IP -6 route show vrf red | grep -q "src 2001:db8:101::11 "
2024 $IP -6 route show vrf red | grep -q "src 2001:db8:101::12 "
2026 $IP -6 route show | grep -q " src 2001:db8:101::12 "
2030 $IP route replace vrf red 2001:db8:112::/64 dev dummy6 src 2001:db8:101::12
2032 $IP -6 route show vrf red | grep -q "src 2001:db8:101::12 "
2034 $IP -6 route show | grep -q " src 2001:db8:101::12 "
2040 $IP -6 route show vrf red | grep -q "src 2001:db8:101::13 "
2042 $IP -6 route show | grep -q "src 2001:db8:101::13 "
2047 $IP -6 route show vrf red | grep -q "src 2001:db8:101::13 "
2049 $IP -6 route show | grep -q "src 2001:db8:101::13 "
2055 $IP -6 route show | grep -q "src 2001:db8:101::15"
2058 echo " Link local source route"
2060 $IP -6 route show | grep -q "2001:db8:116::/64 dev dummy2 src fe80::1"
2063 $IP -6 route show | grep -q "2001:db8:116::/64 dev dummy2 src fe80::1"
2065 $IP -6 route show | grep -q "2001:db8:117::/64 dev dummy3 src fe80::1"
2069 $IP -6 route show | grep -q "2001:db8:117::/64 dev dummy3 src fe80::1"
2083 echo "IPv4 route with IPv6 gateway tests"
2089 # single path route
2093 log_test $rc 0 "Single path route with IPv6 gateway"
2099 log_test $rc 0 "Single path route with IPv6 gateway - ping"
2103 log_test $rc 0 "Single path route delete"
2113 log_test $rc 0 "Multipath route add - v6 nexthop then v4"
2119 log_test $? 2 " Multipath route delete - nexthops in wrong order"
2122 log_test $? 0 " Multipath route delete exact match"
2129 log_test $rc 0 "Multipath route add - v4 nexthop then v6"
2135 log_test $? 2 " Multipath route delete - nexthops in wrong order"
2138 log_test $? 0 " Multipath route delete exact match"
2191 # Add a FIB rule and a route that will direct our connection to the
2194 $IP route add table 123 172.16.101.0/24 dev veth1
2196 # Add an unreachable route to the main table that will block our
2198 $IP route add unreachable 172.16.101.2/32
2223 $IP route del unreachable 172.16.101.2/32
2224 $IP route del table 123 172.16.101.0/24 dev veth1
2249 # Add a FIB rule and a route that will direct our connection to the
2252 $IP -6 route add table 123 2001:db8:101::/64 dev veth1
2254 # Add an unreachable route to the main table that will block our
2256 $IP -6 route add unreachable 2001:db8:101::2/128
2281 $IP -6 route del unreachable 2001:db8:101::2/128
2282 $IP -6 route del table 123 2001:db8:101::/64 dev veth1
2403 log_test $? 0 "Multipath route hit ratio ($ratio)"
2427 run_cmd "ip -n $ns2 route add 203.0.113.0/24
2440 # Packets forwarded in a list using a multipath route must not reuse a
2475 run_cmd "ip -n $ns2 -6 route add 2001:db8:301::/64
2485 # Packets forwarded in a list using a multipath route must not reuse a
2547 ip route help 2>&1 | grep -q fibmatch