Lines Matching full:route

104 	echo "Single path route test"
109 $IP route get fibmatch 198.51.100.2 &> /dev/null
111 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
119 $IP route get fibmatch 198.51.100.2 &> /dev/null
120 log_test $? 2 "IPv4 fibmatch - no route"
121 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
122 log_test $? 2 "IPv6 fibmatch - no route"
131 echo "Multipath route test"
141 $IP route add 203.0.113.0/24 \
144 $IP -6 route add 2001:db8:3::/64 \
150 $IP route get fibmatch 203.0.113.1 &> /dev/null
152 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
160 $IP route get fibmatch 203.0.113.1 &> /dev/null
161 log_test $? 2 "IPv4 - multipath route removed on delete"
163 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
164 # In IPv6 we do not flush the entire multipath route.
172 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
173 log_test $? 2 "IPv6 - no route"
192 $IP route get fibmatch 198.51.100.2 &> /dev/null
194 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
201 echo " Route deleted on down"
202 $IP route get fibmatch 198.51.100.2 &> /dev/null
204 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
215 $IP route get fibmatch 203.0.113.1 \
218 $IP -6 route get fibmatch 2001:db8:3::1 \
222 $IP route get fibmatch 203.0.113.1 \
225 $IP -6 route get fibmatch 2001:db8:3::1 \
229 $IP route get fibmatch 203.0.113.1 | \
232 $IP -6 route get fibmatch 2001:db8:3::1 | \
236 $IP route get fibmatch 203.0.113.1 | \
239 $IP -6 route get fibmatch 2001:db8:3::1 | \
258 $IP route add 203.0.113.0/24 \
261 $IP -6 route add 2001:db8:3::/64 \
267 $IP route get fibmatch 203.0.113.1 &> /dev/null
270 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
293 $IP route get fibmatch 203.0.113.1 &> /dev/null
295 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
321 $IP route get fibmatch 198.51.100.1 &> /dev/null
323 $IP -6 route get fibmatch 2001:db8:1::1 &> /dev/null
326 $IP route get fibmatch 198.51.100.1 | \
329 $IP -6 route get fibmatch 2001:db8:1::1 | \
339 $IP route get fibmatch 198.51.100.1 &> /dev/null
341 $IP -6 route get fibmatch 2001:db8:1::1 &> /dev/null
344 $IP route get fibmatch 198.51.100.1 | \
347 $IP -6 route get fibmatch 2001:db8:1::1 | \
356 echo " Route to local address with carrier down"
357 $IP route get fibmatch 192.0.2.1 &> /dev/null
359 $IP -6 route get fibmatch 2001:db8:2::1 &> /dev/null
362 $IP route get fibmatch 192.0.2.1 | \
365 $IP -6 route get fibmatch 2001:db8:2::1 | \
377 echo "Single path route carrier test"
386 $IP route get fibmatch 198.51.100.2 &> /dev/null
388 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
391 $IP route get fibmatch 198.51.100.2 | \
394 $IP -6 route get fibmatch 2001:db8:1::2 | \
404 $IP route get fibmatch 198.51.100.2 &> /dev/null
406 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
409 $IP route get fibmatch 198.51.100.2 | \
412 $IP -6 route get fibmatch 2001:db8:1::2 | \
422 $IP route get fibmatch 192.0.2.2 &> /dev/null
424 $IP -6 route get fibmatch 2001:db8:2::2 &> /dev/null
427 $IP route get fibmatch 192.0.2.2 | \
430 $IP -6 route get fibmatch 2001:db8:2::2 | \
516 # run 'ip route add' with given spec
531 cmd="$IP route add vrf $vrf $pfx $gw $dev"
599 add_rt "VRF route, gateway can be local address in default VRF" 0 \
603 add_rt "VRF route, gateway can not be a local address" 2 \
605 add_rt "VRF route, gateway can not be a local addr with device" 2 \
632 $IP -4 route add vrf red unreachable default metric 4278198272
633 $IP -6 route add vrf red unreachable default metric 4278198272
667 echo "Fib6 info length calculation in route notify test"
677 $NS_EXEC ip monitor route &> errors.txt &
680 $IP -6 route add 2001::/64 \
698 log_test $ret 0 "ipv6 route add notify"
713 echo "Fib4 info length calculation in route notify test"
724 $NS_EXEC ip monitor route &> errors.txt &
727 $IP route add 10.0.0.0/24 \
745 log_test $ret 0 "ipv4 route add notify"
765 $NS_EXEC sysctl -wq net.ipv6.route.gc_interval=$EXPIRE
771 $NS_EXEC sysctl -wq net.ipv6.route.flush=1
775 # Expire route after $EXPIRE seconds
776 $IP -6 route add 2001:20::$i \
780 N_EXP_SLEEP=$($IP -6 route list |grep expires|wc -l)
790 $IP -6 route add 2001:30::$i \
795 # Expire route after $EXPIRE seconds
796 $IP -6 route add 2001:20::$i \
800 N_EXP_SLEEP=$($IP -6 route list |grep expires|wc -l)
811 log_test $ret 0 "ipv6 route garbage collection"
824 $IP -6 route add default dev dummy1
837 # Tests on route add and replace
871 printf "\nNo route entry found\n"
884 printf " Unexpected route entry. Have:\n"
894 # add route for a prefix, flushing any existing routes first
919 echo "Failed to add initial route for test."
924 # add initial route - used in replace route tests
994 # assumption is that basic add of a single path route works
1001 echo "IPv6 route add / append tests"
1003 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1006 log_test $? 2 "Attempt to add duplicate route - gw"
1008 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1011 log_test $? 2 "Attempt to add duplicate route - dev only"
1013 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1016 log_test $? 2 "Attempt to add duplicate route - reject route"
1018 # route append with same prefix adds a new route
1023 log_test $? 0 "Append nexthop to existing route - gw"
1028 log_test $? 0 "Add multipath route"
1032 log_test $? 2 "Attempt to add duplicate multipath route"
1034 # insert of a second route without append but different metric
1042 log_test $rc 0 "Route add with different metrics"
1050 log_test $rc 0 "Route delete with metric"
1076 # route replace fails - invalid nexthop
1088 # replace non-existent route
1093 log_test $? 2 "Single path - replace of non-existent route"
1122 # route replace fails - invalid nexthop 1
1128 # route replace fails - invalid nexthop 2
1134 # multipath non-existent route
1137 log_test $? 2 "Multipath - replace of non-existent route"
1143 echo "IPv6 route replace tests"
1152 echo "IPv6 route with dsfield tests"
1154 run_cmd "$IP -6 route flush 2001:db8:102::/64"
1157 run_cmd "$IP -6 route add 2001:db8:102::/64 dsfield 0x04 via 2001:db8:101::2"
1158 log_test $? 2 "Reject route with dsfield"
1188 echo "IPv6 prefix route tests"
1240 # verify prefix route removed on down
1249 log_test $rc 0 "Prefix route removed on link down"
1251 # verify prefix route re-inserted with assigned metric
1258 log_test $rc 0 "Prefix route with metric on link up"
1267 log_test $? 0 "Set metric with peer route on local side"
1269 log_test $? 0 "Set metric with peer route on peer side"
1303 log_test $rc 0 "Single path route with mtu metric"
1316 log_test $rc 0 "Multipath route via 2 single routes with mtu metric on first"
1318 # second route is coalesced to first to make a multipath route.
1327 log_test $rc 0 "Multipath route via 2 single routes with mtu metric on 2nd"
1344 log_test $rc 0 "Multipath route with mtu metric"
1348 log_test $? 0 "Using route with mtu metric"
1356 # add route for a prefix, flushing any existing routes first
1381 echo "Failed to add initial route for test."
1386 # add initial route - used in replace route tests
1406 # assumption is that basic add of a single path route works
1413 echo "IPv4 route add / append tests"
1415 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1418 log_test $? 2 "Attempt to add duplicate route - gw"
1420 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1423 log_test $? 2 "Attempt to add duplicate route - dev only"
1425 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1428 log_test $? 2 "Attempt to add duplicate route - reject route"
1431 # - adds a new route; does NOT convert existing route to ECMP
1437 # route append with same prefix adds a new route
1442 log_test $? 0 "Append nexthop to existing route - gw"
1447 log_test $? 0 "Append nexthop to existing route - dev only"
1452 log_test $? 0 "Append nexthop to existing route - reject route"
1458 log_test $? 0 "Append nexthop to existing reject route - gw"
1464 log_test $? 0 "Append nexthop to existing reject route - dev only"
1469 log_test $? 0 "add multipath route"
1473 log_test $? 2 "Attempt to add duplicate multipath route"
1475 # insert of a second route without append but different metric
1483 log_test $rc 0 "Route add with different metrics"
1491 log_test $rc 0 "Route delete with metric"
1515 log_test $? 0 "Single path with reject route"
1524 # route replace fails - invalid nexthop
1536 # replace non-existent route
1541 log_test $? 2 "Single path - replace of non-existent route"
1568 log_test $? 0 "Multipath with reject route"
1570 # route replace fails - invalid nexthop 1
1576 # route replace fails - invalid nexthop 2
1582 # multipath non-existent route
1585 log_test $? 2 "Multipath - replace of non-existent route"
1591 echo "IPv4 route replace tests"
1597 # checks that cached input route on VRF port is deleted
1609 run_cmd "ip route add 10.1.1.1/32 dev veth-outside table 1100"
1612 run_cmd "ip netns exec test-ns ip route add 10.0.0.1/32 dev veth-inside"
1613 run_cmd "ip netns exec test-ns ip route add default via 10.0.0.1"
1618 log_test $? 0 "Cached route removed from VRF port device"
1624 echo "IPv4 route with dsfield tests"
1626 run_cmd "$IP route flush 172.16.102.0/24"
1629 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x01 via 172.16.101.2"
1630 log_test $? 2 "Reject route with dsfield 0x01"
1632 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x02 via 172.16.101.2"
1633 log_test $? 2 "Reject route with dsfield 0x02"
1635 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x03 via 172.16.101.2"
1636 log_test $? 2 "Reject route with dsfield 0x03"
1638 # A generic route that doesn't take DSCP into account
1639 run_cmd "$IP route add 172.16.102.0/24 via 172.16.101.2"
1641 # A more specific route for DSCP 0x10
1642 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x10 via 172.16.103.2"
1644 # DSCP 0x10 should match the specific route, no matter the ECN bits
1645 $IP route get fibmatch 172.16.102.1 dsfield 0x10 | \
1647 log_test $? 0 "IPv4 route with DSCP and ECN:Not-ECT"
1649 $IP route get fibmatch 172.16.102.1 dsfield 0x11 | \
1651 log_test $? 0 "IPv4 route with DSCP and ECN:ECT(1)"
1653 $IP route get fibmatch 172.16.102.1 dsfield 0x12 | \
1655 log_test $? 0 "IPv4 route with DSCP and ECN:ECT(0)"
1657 $IP route get fibmatch 172.16.102.1 dsfield 0x13 | \
1659 log_test $? 0 "IPv4 route with DSCP and ECN:CE"
1661 # Unknown DSCP should match the generic route, no matter the ECN bits
1662 $IP route get fibmatch 172.16.102.1 dsfield 0x14 | \
1664 log_test $? 0 "IPv4 route with unknown DSCP and ECN:Not-ECT"
1666 $IP route get fibmatch 172.16.102.1 dsfield 0x15 | \
1668 log_test $? 0 "IPv4 route with unknown DSCP and ECN:ECT(1)"
1670 $IP route get fibmatch 172.16.102.1 dsfield 0x16 | \
1672 log_test $? 0 "IPv4 route with unknown DSCP and ECN:ECT(0)"
1674 $IP route get fibmatch 172.16.102.1 dsfield 0x17 | \
1676 log_test $? 0 "IPv4 route with unknown DSCP and ECN:CE"
1678 # Null DSCP should match the generic route, no matter the ECN bits
1679 $IP route get fibmatch 172.16.102.1 dsfield 0x00 | \
1681 log_test $? 0 "IPv4 route with no DSCP and ECN:Not-ECT"
1683 $IP route get fibmatch 172.16.102.1 dsfield 0x01 | \
1685 log_test $? 0 "IPv4 route with no DSCP and ECN:ECT(1)"
1687 $IP route get fibmatch 172.16.102.1 dsfield 0x02 | \
1689 log_test $? 0 "IPv4 route with no DSCP and ECN:ECT(0)"
1691 $IP route get fibmatch 172.16.102.1 dsfield 0x03 | \
1693 log_test $? 0 "IPv4 route with no DSCP and ECN:CE"
1713 echo "IPv4 prefix route tests"
1765 # verify prefix route removed on down
1773 log_test $rc 0 "Prefix route removed on link down"
1775 # verify prefix route re-inserted with assigned metric
1782 log_test $rc 0 "Prefix route with metric on link up"
1802 log_test $rc 0 "Set metric of address with peer route"
1810 log_test $rc 0 "Modify metric and peer address for peer route"
1822 echo "IPv4 route add / append tests"
1832 log_test $rc 0 "Single path route with mtu metric"
1841 log_test $rc 0 "Multipath route with mtu metric"
1845 log_test $? 0 "Using route with mtu metric"
1856 echo "IPv4 delete address route tests"
1877 $IP route add 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1878 $IP route add 172.16.106.0/24 dev lo src 172.16.104.12
1879 $IP route add table 0 172.16.107.0/24 via 172.16.104.2 src 172.16.104.13
1880 $IP route add vrf red 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1881 $IP route add vrf red 172.16.106.0/24 dev lo src 172.16.104.12
1884 # removing address from device in vrf should only remove route from vrf table
1889 log_test $? 1 "Route removed from VRF when source address deleted"
1892 log_test $? 0 "Route in default VRF not removed"
1895 $IP route add vrf red 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1899 log_test $? 1 "Route removed in default VRF when source address deleted"
1902 log_test $? 0 "Route in VRF is not removed by address delete"
1904 # removing address from device in vrf should only remove route from vrf
1910 log_test $? 1 "Route removed from VRF when source address deleted"
1913 log_test $? 0 "Route in default VRF not removed"
1916 $IP route add vrf red 172.16.106.0/24 dev lo src 172.16.104.12
1920 log_test $? 1 "Route removed in default VRF when source address deleted"
1923 log_test $? 0 "Route in VRF is not removed by address delete"
1925 # removing address from device in default vrf should remove route from
1926 # the default vrf even when route was inserted with a table ID of 0.
1931 log_test $? 1 "Route removed in default VRF when source address deleted"
1941 echo "IPv6 delete address route tests"
1979 $IP route add 2001:db8:110::/64 dev dummy3 src 2001:db8:101::10
1981 $IP route add 2001:db8:111::/64 dev dummy3 src 2001:db8:101::11
1983 $IP route add vrf red 2001:db8:110::/64 dev dummy6 src 2001:db8:101::10
1985 $IP route add vrf red 2001:db8:111::/64 dev dummy6 src 2001:db8:101::11
1987 $IP route add 2001:db8:112::/64 dev dummy3 src 2001:db8:101::12
1988 $IP route add vrf red 2001:db8:112::/64 dev dummy6 src 2001:db8:101::12
1990 $IP route add 2001:db8:113::/64 dev lo src 2001:db8:101::13
1991 $IP route add vrf red 2001:db8:113::/64 dev lo src 2001:db8:101::13
1993 $IP route add table 0 2001:db8:115::/64 via 2001:db8:101::2 src 2001:db8:101::15
1994 # Link local source route
1995 $IP route add 2001:db8:116::/64 dev dummy2 src fe80::1
1996 $IP route add 2001:db8:117::/64 dev dummy3 src fe80::1
2002 $IP -6 route show | grep -q "src 2001:db8:101::10 "
2008 $IP -6 route show | grep -q "src 2001:db8:101::11 "
2012 $IP -6 route show | grep -q "src 2001:db8:101::11 "
2018 $IP -6 route show vrf red | grep -q "src 2001:db8:101::10 "
2024 $IP -6 route show vrf red | grep -q "src 2001:db8:101::11 "
2028 $IP -6 route show vrf red | grep -q "src 2001:db8:101::11 "
2034 $IP -6 route show vrf red | grep -q "src 2001:db8:101::12 "
2036 $IP -6 route show | grep -q " src 2001:db8:101::12 "
2040 $IP route replace vrf red 2001:db8:112::/64 dev dummy6 src 2001:db8:101::12
2042 $IP -6 route show vrf red | grep -q "src 2001:db8:101::12 "
2044 $IP -6 route show | grep -q " src 2001:db8:101::12 "
2050 $IP -6 route show vrf red | grep -q "src 2001:db8:101::13 "
2052 $IP -6 route show | grep -q "src 2001:db8:101::13 "
2057 $IP -6 route show vrf red | grep -q "src 2001:db8:101::13 "
2059 $IP -6 route show | grep -q "src 2001:db8:101::13 "
2065 $IP -6 route show | grep -q "src 2001:db8:101::15"
2068 echo " Link local source route"
2070 $IP -6 route show | grep -q "2001:db8:116::/64 dev dummy2 src fe80::1"
2073 $IP -6 route show | grep -q "2001:db8:116::/64 dev dummy2 src fe80::1"
2075 $IP -6 route show | grep -q "2001:db8:117::/64 dev dummy3 src fe80::1"
2079 $IP -6 route show | grep -q "2001:db8:117::/64 dev dummy3 src fe80::1"
2093 echo "IPv4 route with IPv6 gateway tests"
2099 # single path route
2103 log_test $rc 0 "Single path route with IPv6 gateway"
2109 log_test $rc 0 "Single path route with IPv6 gateway - ping"
2113 log_test $rc 0 "Single path route delete"
2123 log_test $rc 0 "Multipath route add - v6 nexthop then v4"
2129 log_test $? 2 " Multipath route delete - nexthops in wrong order"
2132 log_test $? 0 " Multipath route delete exact match"
2139 log_test $rc 0 "Multipath route add - v4 nexthop then v6"
2145 log_test $? 2 " Multipath route delete - nexthops in wrong order"
2148 log_test $? 0 " Multipath route delete exact match"
2201 # Add a FIB rule and a route that will direct our connection to the
2204 $IP route add table 123 172.16.101.0/24 dev veth1
2206 # Add an unreachable route to the main table that will block our
2208 $IP route add unreachable 172.16.101.2/32
2233 $IP route del unreachable 172.16.101.2/32
2234 $IP route del table 123 172.16.101.0/24 dev veth1
2259 # Add a FIB rule and a route that will direct our connection to the
2262 $IP -6 route add table 123 2001:db8:101::/64 dev veth1
2264 # Add an unreachable route to the main table that will block our
2266 $IP -6 route add unreachable 2001:db8:101::2/128
2291 $IP -6 route del unreachable 2001:db8:101::2/128
2292 $IP -6 route del table 123 2001:db8:101::/64 dev veth1
2413 log_test $? 0 "Multipath route hit ratio ($ratio)"
2437 run_cmd "ip -n ns2 route add 203.0.113.0/24
2450 # Packets forwarded in a list using a multipath route must not reuse a
2485 run_cmd "ip -n ns2 -6 route add 2001:db8:301::/64
2495 # Packets forwarded in a list using a multipath route must not reuse a
2557 ip route help 2>&1 | grep -q fibmatch