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"
795 $NS_EXEC sysctl -wq net.ipv6.route.gc_interval=$EXPIRE
801 $NS_EXEC sysctl -wq net.ipv6.route.flush=1
805 # Expire route after $EXPIRE seconds
806 $IP -6 route add 2001:20::$i \
810 $NS_EXEC sysctl -wq net.ipv6.route.flush=1
811 check_rt_num 0 $($IP -6 route list |grep expires|wc -l)
812 log_test $ret 0 "ipv6 route garbage collection"
818 $IP -6 route add 2001:30::$i \
823 # Expire route after $EXPIRE seconds
824 $IP -6 route add 2001:20::$i \
829 check_rt_num 0 $($IP -6 route list |grep expires|wc -l)
830 log_test $ret 0 "ipv6 route garbage collection (with permanent routes)"
836 $IP -6 route add 2001:20::$i \
841 # Expire route after $EXPIRE seconds
842 $IP -6 route replace 2001:20::$i \
847 check_rt_num 0 $($IP -6 route list |grep expires|wc -l)
848 log_test $ret 0 "ipv6 route garbage collection (replace with expires)"
854 # Expire route after $EXPIRE seconds
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)
868 log_test $ret 0 "ipv6 route garbage collection (replace with permanent)"
892 # Send a RA message with a route from veth2 to veth1.
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)
905 log_test $ret 0 "ipv6 route garbage collection (RA message)"
920 $IP -6 route add default dev dummy1
933 # Tests on route add and replace
967 printf "\nNo route entry found\n"
980 printf " Unexpected route entry. Have:\n"
990 # add route for a prefix, flushing any existing routes first
1015 echo "Failed to add initial route for test."
1020 # add initial route - used in replace route tests
1088 # assumption is that basic add of a single path route works
1095 echo "IPv6 route add / append tests"
1097 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1100 log_test $? 2 "Attempt to add duplicate route - gw"
1102 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1105 log_test $? 2 "Attempt to add duplicate route - dev only"
1107 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1110 log_test $? 2 "Attempt to add duplicate route - reject route"
1112 # route append with same prefix adds a new route
1117 log_test $? 0 "Append nexthop to existing route - gw"
1122 log_test $? 0 "Add multipath route"
1126 log_test $? 2 "Attempt to add duplicate multipath route"
1128 # insert of a second route without append but different metric
1136 log_test $rc 0 "Route add with different metrics"
1144 log_test $rc 0 "Route delete with metric"
1170 # route replace fails - invalid nexthop
1182 # replace non-existent route
1187 log_test $? 2 "Single path - replace of non-existent route"
1216 # route replace fails - invalid nexthop 1
1222 # route replace fails - invalid nexthop 2
1228 # multipath non-existent route
1231 log_test $? 2 "Multipath - replace of non-existent route"
1237 echo "IPv6 route replace tests"
1246 echo "IPv6 route with dsfield tests"
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"
1252 log_test $? 2 "Reject route with dsfield"
1282 echo "IPv6 prefix route tests"
1334 # verify prefix route removed on down
1343 log_test $rc 0 "Prefix route removed on link down"
1345 # verify prefix route re-inserted with assigned metric
1352 log_test $rc 0 "Prefix route with metric on link up"
1361 log_test $? 0 "Set metric with peer route on local side"
1363 log_test $? 0 "Set metric with peer route on peer side"
1397 log_test $rc 0 "Single path route with mtu metric"
1410 log_test $rc 0 "Multipath route via 2 single routes with mtu metric on first"
1412 # second route is coalesced to first to make a multipath route.
1421 log_test $rc 0 "Multipath route via 2 single routes with mtu metric on 2nd"
1438 log_test $rc 0 "Multipath route with mtu metric"
1442 log_test $? 0 "Using route with mtu metric"
1450 # add route for a prefix, flushing any existing routes first
1475 echo "Failed to add initial route for test."
1480 # add initial route - used in replace route tests
1500 # assumption is that basic add of a single path route works
1507 echo "IPv4 route add / append tests"
1509 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1512 log_test $? 2 "Attempt to add duplicate route - gw"
1514 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1517 log_test $? 2 "Attempt to add duplicate route - dev only"
1519 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1522 log_test $? 2 "Attempt to add duplicate route - reject route"
1525 # - adds a new route; does NOT convert existing route to ECMP
1531 # route append with same prefix adds a new route
1536 log_test $? 0 "Append nexthop to existing route - gw"
1541 log_test $? 0 "Append nexthop to existing route - dev only"
1546 log_test $? 0 "Append nexthop to existing route - reject route"
1552 log_test $? 0 "Append nexthop to existing reject route - gw"
1558 log_test $? 0 "Append nexthop to existing reject route - dev only"
1563 log_test $? 0 "add multipath route"
1567 log_test $? 2 "Attempt to add duplicate multipath route"
1569 # insert of a second route without append but different metric
1577 log_test $rc 0 "Route add with different metrics"
1585 log_test $rc 0 "Route delete with metric"
1609 log_test $? 0 "Single path with reject route"
1618 # route replace fails - invalid nexthop
1630 # replace non-existent route
1635 log_test $? 2 "Single path - replace of non-existent route"
1662 log_test $? 0 "Multipath with reject route"
1664 # route replace fails - invalid nexthop 1
1670 # route replace fails - invalid nexthop 2
1676 # multipath non-existent route
1679 log_test $? 2 "Multipath - replace of non-existent route"
1685 echo "IPv4 route replace tests"
1691 # checks that cached input route on VRF port is deleted
1703 run_cmd "ip route add 10.1.1.1/32 dev veth-outside table 1100"
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"
1712 log_test $? 0 "Cached route removed from VRF port device"
1718 echo "IPv4 route with dsfield tests"
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"
1724 log_test $? 2 "Reject route with dsfield 0x01"
1726 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x02 via 172.16.101.2"
1727 log_test $? 2 "Reject route with dsfield 0x02"
1729 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x03 via 172.16.101.2"
1730 log_test $? 2 "Reject route with dsfield 0x03"
1732 # A generic route that doesn't take DSCP into account
1733 run_cmd "$IP route add 172.16.102.0/24 via 172.16.101.2"
1735 # A more specific route for DSCP 0x10
1736 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x10 via 172.16.103.2"
1738 # DSCP 0x10 should match the specific route, no matter the ECN bits
1739 $IP route get fibmatch 172.16.102.1 dsfield 0x10 | \
1741 log_test $? 0 "IPv4 route with DSCP and ECN:Not-ECT"
1743 $IP route get fibmatch 172.16.102.1 dsfield 0x11 | \
1745 log_test $? 0 "IPv4 route with DSCP and ECN:ECT(1)"
1747 $IP route get fibmatch 172.16.102.1 dsfield 0x12 | \
1749 log_test $? 0 "IPv4 route with DSCP and ECN:ECT(0)"
1751 $IP route get fibmatch 172.16.102.1 dsfield 0x13 | \
1753 log_test $? 0 "IPv4 route with DSCP and ECN:CE"
1755 # Unknown DSCP should match the generic route, no matter the ECN bits
1756 $IP route get fibmatch 172.16.102.1 dsfield 0x14 | \
1758 log_test $? 0 "IPv4 route with unknown DSCP and ECN:Not-ECT"
1760 $IP route get fibmatch 172.16.102.1 dsfield 0x15 | \
1762 log_test $? 0 "IPv4 route with unknown DSCP and ECN:ECT(1)"
1764 $IP route get fibmatch 172.16.102.1 dsfield 0x16 | \
1766 log_test $? 0 "IPv4 route with unknown DSCP and ECN:ECT(0)"
1768 $IP route get fibmatch 172.16.102.1 dsfield 0x17 | \
1770 log_test $? 0 "IPv4 route with unknown DSCP and ECN:CE"
1772 # Null DSCP should match the generic route, no matter the ECN bits
1773 $IP route get fibmatch 172.16.102.1 dsfield 0x00 | \
1775 log_test $? 0 "IPv4 route with no DSCP and ECN:Not-ECT"
1777 $IP route get fibmatch 172.16.102.1 dsfield 0x01 | \
1779 log_test $? 0 "IPv4 route with no DSCP and ECN:ECT(1)"
1781 $IP route get fibmatch 172.16.102.1 dsfield 0x02 | \
1783 log_test $? 0 "IPv4 route with no DSCP and ECN:ECT(0)"
1785 $IP route get fibmatch 172.16.102.1 dsfield 0x03 | \
1787 log_test $? 0 "IPv4 route with no DSCP and ECN:CE"
1807 echo "IPv4 prefix route tests"
1859 # verify prefix route removed on down
1867 log_test $rc 0 "Prefix route removed on link down"
1869 # verify prefix route re-inserted with assigned metric
1876 log_test $rc 0 "Prefix route with metric on link up"
1896 log_test $rc 0 "Set metric of address with peer route"
1904 log_test $rc 0 "Modify metric and peer address for peer route"
1916 echo "IPv4 route add / append tests"
1926 log_test $rc 0 "Single path route with mtu metric"
1935 log_test $rc 0 "Multipath route with mtu metric"
1939 log_test $? 0 "Using route with mtu metric"
1950 echo "IPv4 delete address route tests"
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
1978 # removing address from device in vrf should only remove route from vrf table
1983 log_test $? 1 "Route removed from VRF when source address deleted"
1986 log_test $? 0 "Route in default VRF not removed"
1989 $IP route add vrf red 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1993 log_test $? 1 "Route removed in default VRF when source address deleted"
1996 log_test $? 0 "Route in VRF is not removed by address delete"
1998 # removing address from device in vrf should only remove route from vrf
2004 log_test $? 1 "Route removed from VRF when source address deleted"
2007 log_test $? 0 "Route in default VRF not removed"
2010 $IP route add vrf red 172.16.106.0/24 dev lo src 172.16.104.12
2014 log_test $? 1 "Route removed in default VRF when source address deleted"
2017 log_test $? 0 "Route in VRF is not removed by address delete"
2019 # removing address from device in default vrf should remove route from
2020 # the default vrf even when route was inserted with a table ID of 0.
2025 log_test $? 1 "Route removed in default VRF when source address deleted"
2035 echo "IPv6 delete address route tests"
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
2088 # Link local source route
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
2096 $IP -6 route show | grep -q "src 2001:db8:101::10 "
2102 $IP -6 route show | grep -q "src 2001:db8:101::11 "
2106 $IP -6 route show | grep -q "src 2001:db8:101::11 "
2112 $IP -6 route show vrf red | grep -q "src 2001:db8:101::10 "
2118 $IP -6 route show vrf red | grep -q "src 2001:db8:101::11 "
2122 $IP -6 route show vrf red | grep -q "src 2001:db8:101::11 "
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 "
2134 $IP route replace vrf red 2001:db8:112::/64 dev dummy6 src 2001:db8:101::12
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 "
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 "
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 "
2159 $IP -6 route show | grep -q "src 2001:db8:101::15"
2162 echo " Link local source route"
2164 $IP -6 route show | grep -q "2001:db8:116::/64 dev dummy2 src fe80::1"
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"
2173 $IP -6 route show | grep -q "2001:db8:117::/64 dev dummy3 src fe80::1"
2187 echo "IPv4 route with IPv6 gateway tests"
2193 # single path route
2197 log_test $rc 0 "Single path route with IPv6 gateway"
2203 log_test $rc 0 "Single path route with IPv6 gateway - ping"
2207 log_test $rc 0 "Single path route delete"
2217 log_test $rc 0 "Multipath route add - v6 nexthop then v4"
2223 log_test $? 2 " Multipath route delete - nexthops in wrong order"
2226 log_test $? 0 " Multipath route delete exact match"
2233 log_test $rc 0 "Multipath route add - v4 nexthop then v6"
2239 log_test $? 2 " Multipath route delete - nexthops in wrong order"
2242 log_test $? 0 " Multipath route delete exact match"
2295 # Add a FIB rule and a route that will direct our connection to the
2298 $IP route add table 123 172.16.101.0/24 dev veth1
2300 # Add an unreachable route to the main table that will block our
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
2353 # Add a FIB rule and a route that will direct our connection to the
2356 $IP -6 route add table 123 2001:db8:101::/64 dev veth1
2358 # Add an unreachable route to the main table that will block our
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
2507 log_test $? 0 "Multipath route hit ratio ($ratio)"
2531 run_cmd "ip -n $ns2 route add 203.0.113.0/24
2544 # Packets forwarded in a list using a multipath route must not reuse a
2579 run_cmd "ip -n $ns2 -6 route add 2001:db8:301::/64
2589 # Packets forwarded in a list using a multipath route must not reuse a
2651 ip route help 2>&1 | grep -q fibmatch