Lines Matching full:route
100 echo "Single path route test"
105 $IP route get fibmatch 198.51.100.2 &> /dev/null
107 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
115 $IP route get fibmatch 198.51.100.2 &> /dev/null
116 log_test $? 2 "IPv4 fibmatch - no route"
117 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
118 log_test $? 2 "IPv6 fibmatch - no route"
127 echo "Multipath route test"
137 $IP route add 203.0.113.0/24 \
140 $IP -6 route add 2001:db8:3::/64 \
146 $IP route get fibmatch 203.0.113.1 &> /dev/null
148 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
156 $IP route get fibmatch 203.0.113.1 &> /dev/null
157 log_test $? 2 "IPv4 - multipath route removed on delete"
159 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
160 # In IPv6 we do not flush the entire multipath route.
168 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
169 log_test $? 2 "IPv6 - no route"
188 $IP route get fibmatch 198.51.100.2 &> /dev/null
190 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
197 echo " Route deleted on down"
198 $IP route get fibmatch 198.51.100.2 &> /dev/null
200 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
211 $IP route get fibmatch 203.0.113.1 \
214 $IP -6 route get fibmatch 2001:db8:3::1 \
218 $IP route get fibmatch 203.0.113.1 \
221 $IP -6 route get fibmatch 2001:db8:3::1 \
225 $IP route get fibmatch 203.0.113.1 | \
228 $IP -6 route get fibmatch 2001:db8:3::1 | \
232 $IP route get fibmatch 203.0.113.1 | \
235 $IP -6 route get fibmatch 2001:db8:3::1 | \
254 $IP route add 203.0.113.0/24 \
257 $IP -6 route add 2001:db8:3::/64 \
263 $IP route get fibmatch 203.0.113.1 &> /dev/null
266 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
289 $IP route get fibmatch 203.0.113.1 &> /dev/null
291 $IP -6 route get fibmatch 2001:db8:3::1 &> /dev/null
317 $IP route get fibmatch 198.51.100.1 &> /dev/null
319 $IP -6 route get fibmatch 2001:db8:1::1 &> /dev/null
322 $IP route get fibmatch 198.51.100.1 | \
325 $IP -6 route get fibmatch 2001:db8:1::1 | \
335 $IP route get fibmatch 198.51.100.1 &> /dev/null
337 $IP -6 route get fibmatch 2001:db8:1::1 &> /dev/null
340 $IP route get fibmatch 198.51.100.1 | \
343 $IP -6 route get fibmatch 2001:db8:1::1 | \
352 echo " Route to local address with carrier down"
353 $IP route get fibmatch 192.0.2.1 &> /dev/null
355 $IP -6 route get fibmatch 2001:db8:2::1 &> /dev/null
358 $IP route get fibmatch 192.0.2.1 | \
361 $IP -6 route get fibmatch 2001:db8:2::1 | \
373 echo "Single path route carrier test"
382 $IP route get fibmatch 198.51.100.2 &> /dev/null
384 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
387 $IP route get fibmatch 198.51.100.2 | \
390 $IP -6 route get fibmatch 2001:db8:1::2 | \
400 $IP route get fibmatch 198.51.100.2 &> /dev/null
402 $IP -6 route get fibmatch 2001:db8:1::2 &> /dev/null
405 $IP route get fibmatch 198.51.100.2 | \
408 $IP -6 route get fibmatch 2001:db8:1::2 | \
418 $IP route get fibmatch 192.0.2.2 &> /dev/null
420 $IP -6 route get fibmatch 2001:db8:2::2 &> /dev/null
423 $IP route get fibmatch 192.0.2.2 | \
426 $IP -6 route get fibmatch 2001:db8:2::2 | \
512 # run 'ip route add' with given spec
527 cmd="$IP route add vrf $vrf $pfx $gw $dev"
595 add_rt "VRF route, gateway can be local address in default VRF" 0 \
599 add_rt "VRF route, gateway can not be a local address" 2 \
601 add_rt "VRF route, gateway can not be a local addr with device" 2 \
628 $IP -4 route add vrf red unreachable default metric 4278198272
629 $IP -6 route add vrf red unreachable default metric 4278198272
666 $IP -6 route add default dev dummy1
679 # Tests on route add and replace
713 printf "\nNo route entry found\n"
726 printf " Unexpected route entry. Have:\n"
736 # add route for a prefix, flushing any existing routes first
761 echo "Failed to add initial route for test."
766 # add initial route - used in replace route tests
836 # assumption is that basic add of a single path route works
843 echo "IPv6 route add / append tests"
845 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
848 log_test $? 2 "Attempt to add duplicate route - gw"
850 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
853 log_test $? 2 "Attempt to add duplicate route - dev only"
855 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
858 log_test $? 2 "Attempt to add duplicate route - reject route"
860 # route append with same prefix adds a new route
865 log_test $? 0 "Append nexthop to existing route - gw"
870 log_test $? 0 "Add multipath route"
874 log_test $? 2 "Attempt to add duplicate multipath route"
876 # insert of a second route without append but different metric
884 log_test $rc 0 "Route add with different metrics"
892 log_test $rc 0 "Route delete with metric"
918 # route replace fails - invalid nexthop
930 # replace non-existent route
935 log_test $? 2 "Single path - replace of non-existent route"
964 # route replace fails - invalid nexthop 1
970 # route replace fails - invalid nexthop 2
976 # multipath non-existent route
979 log_test $? 2 "Multipath - replace of non-existent route"
985 echo "IPv6 route replace tests"
994 echo "IPv6 route with dsfield tests"
996 run_cmd "$IP -6 route flush 2001:db8:102::/64"
999 run_cmd "$IP -6 route add 2001:db8:102::/64 dsfield 0x04 via 2001:db8:101::2"
1000 log_test $? 2 "Reject route with dsfield"
1030 echo "IPv6 prefix route tests"
1082 # verify prefix route removed on down
1091 log_test $rc 0 "Prefix route removed on link down"
1093 # verify prefix route re-inserted with assigned metric
1100 log_test $rc 0 "Prefix route with metric on link up"
1109 log_test $? 0 "Set metric with peer route on local side"
1111 log_test $? 0 "Set metric with peer route on peer side"
1145 log_test $rc 0 "Single path route with mtu metric"
1158 log_test $rc 0 "Multipath route via 2 single routes with mtu metric on first"
1160 # second route is coalesced to first to make a multipath route.
1169 log_test $rc 0 "Multipath route via 2 single routes with mtu metric on 2nd"
1186 log_test $rc 0 "Multipath route with mtu metric"
1190 log_test $? 0 "Using route with mtu metric"
1198 # add route for a prefix, flushing any existing routes first
1223 echo "Failed to add initial route for test."
1228 # add initial route - used in replace route tests
1248 # assumption is that basic add of a single path route works
1255 echo "IPv4 route add / append tests"
1257 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1260 log_test $? 2 "Attempt to add duplicate route - gw"
1262 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1265 log_test $? 2 "Attempt to add duplicate route - dev only"
1267 # route add same prefix - fails with EEXISTS b/c ip adds NLM_F_EXCL
1270 log_test $? 2 "Attempt to add duplicate route - reject route"
1273 # - adds a new route; does NOT convert existing route to ECMP
1279 # route append with same prefix adds a new route
1284 log_test $? 0 "Append nexthop to existing route - gw"
1289 log_test $? 0 "Append nexthop to existing route - dev only"
1294 log_test $? 0 "Append nexthop to existing route - reject route"
1300 log_test $? 0 "Append nexthop to existing reject route - gw"
1306 log_test $? 0 "Append nexthop to existing reject route - dev only"
1311 log_test $? 0 "add multipath route"
1315 log_test $? 2 "Attempt to add duplicate multipath route"
1317 # insert of a second route without append but different metric
1325 log_test $rc 0 "Route add with different metrics"
1333 log_test $rc 0 "Route delete with metric"
1357 log_test $? 0 "Single path with reject route"
1366 # route replace fails - invalid nexthop
1378 # replace non-existent route
1383 log_test $? 2 "Single path - replace of non-existent route"
1410 log_test $? 0 "Multipath with reject route"
1412 # route replace fails - invalid nexthop 1
1418 # route replace fails - invalid nexthop 2
1424 # multipath non-existent route
1427 log_test $? 2 "Multipath - replace of non-existent route"
1433 echo "IPv4 route replace tests"
1439 # checks that cached input route on VRF port is deleted
1451 run_cmd "ip route add 10.1.1.1/32 dev veth-outside table 1100"
1454 run_cmd "ip netns exec test-ns ip route add 10.0.0.1/32 dev veth-inside"
1455 run_cmd "ip netns exec test-ns ip route add default via 10.0.0.1"
1460 log_test $? 0 "Cached route removed from VRF port device"
1466 echo "IPv4 route with dsfield tests"
1468 run_cmd "$IP route flush 172.16.102.0/24"
1471 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x01 via 172.16.101.2"
1472 log_test $? 2 "Reject route with dsfield 0x01"
1474 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x02 via 172.16.101.2"
1475 log_test $? 2 "Reject route with dsfield 0x02"
1477 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x03 via 172.16.101.2"
1478 log_test $? 2 "Reject route with dsfield 0x03"
1480 # A generic route that doesn't take DSCP into account
1481 run_cmd "$IP route add 172.16.102.0/24 via 172.16.101.2"
1483 # A more specific route for DSCP 0x10
1484 run_cmd "$IP route add 172.16.102.0/24 dsfield 0x10 via 172.16.103.2"
1486 # DSCP 0x10 should match the specific route, no matter the ECN bits
1487 $IP route get fibmatch 172.16.102.1 dsfield 0x10 | \
1489 log_test $? 0 "IPv4 route with DSCP and ECN:Not-ECT"
1491 $IP route get fibmatch 172.16.102.1 dsfield 0x11 | \
1493 log_test $? 0 "IPv4 route with DSCP and ECN:ECT(1)"
1495 $IP route get fibmatch 172.16.102.1 dsfield 0x12 | \
1497 log_test $? 0 "IPv4 route with DSCP and ECN:ECT(0)"
1499 $IP route get fibmatch 172.16.102.1 dsfield 0x13 | \
1501 log_test $? 0 "IPv4 route with DSCP and ECN:CE"
1503 # Unknown DSCP should match the generic route, no matter the ECN bits
1504 $IP route get fibmatch 172.16.102.1 dsfield 0x14 | \
1506 log_test $? 0 "IPv4 route with unknown DSCP and ECN:Not-ECT"
1508 $IP route get fibmatch 172.16.102.1 dsfield 0x15 | \
1510 log_test $? 0 "IPv4 route with unknown DSCP and ECN:ECT(1)"
1512 $IP route get fibmatch 172.16.102.1 dsfield 0x16 | \
1514 log_test $? 0 "IPv4 route with unknown DSCP and ECN:ECT(0)"
1516 $IP route get fibmatch 172.16.102.1 dsfield 0x17 | \
1518 log_test $? 0 "IPv4 route with unknown DSCP and ECN:CE"
1520 # Null DSCP should match the generic route, no matter the ECN bits
1521 $IP route get fibmatch 172.16.102.1 dsfield 0x00 | \
1523 log_test $? 0 "IPv4 route with no DSCP and ECN:Not-ECT"
1525 $IP route get fibmatch 172.16.102.1 dsfield 0x01 | \
1527 log_test $? 0 "IPv4 route with no DSCP and ECN:ECT(1)"
1529 $IP route get fibmatch 172.16.102.1 dsfield 0x02 | \
1531 log_test $? 0 "IPv4 route with no DSCP and ECN:ECT(0)"
1533 $IP route get fibmatch 172.16.102.1 dsfield 0x03 | \
1535 log_test $? 0 "IPv4 route with no DSCP and ECN:CE"
1555 echo "IPv4 prefix route tests"
1607 # verify prefix route removed on down
1615 log_test $rc 0 "Prefix route removed on link down"
1617 # verify prefix route re-inserted with assigned metric
1624 log_test $rc 0 "Prefix route with metric on link up"
1644 log_test $rc 0 "Set metric of address with peer route"
1652 log_test $rc 0 "Modify metric and peer address for peer route"
1664 echo "IPv4 route add / append tests"
1674 log_test $rc 0 "Single path route with mtu metric"
1683 log_test $rc 0 "Multipath route with mtu metric"
1687 log_test $? 0 "Using route with mtu metric"
1698 echo "IPv4 delete address route tests"
1719 $IP route add 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1720 $IP route add 172.16.106.0/24 dev lo src 172.16.104.12
1721 $IP route add table 0 172.16.107.0/24 via 172.16.104.2 src 172.16.104.13
1722 $IP route add vrf red 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1723 $IP route add vrf red 172.16.106.0/24 dev lo src 172.16.104.12
1726 # removing address from device in vrf should only remove route from vrf table
1731 log_test $? 1 "Route removed from VRF when source address deleted"
1734 log_test $? 0 "Route in default VRF not removed"
1737 $IP route add vrf red 172.16.105.0/24 via 172.16.104.2 src 172.16.104.11
1741 log_test $? 1 "Route removed in default VRF when source address deleted"
1744 log_test $? 0 "Route in VRF is not removed by address delete"
1746 # removing address from device in vrf should only remove route from vrf
1752 log_test $? 1 "Route removed from VRF when source address deleted"
1755 log_test $? 0 "Route in default VRF not removed"
1758 $IP route add vrf red 172.16.106.0/24 dev lo src 172.16.104.12
1762 log_test $? 1 "Route removed in default VRF when source address deleted"
1765 log_test $? 0 "Route in VRF is not removed by address delete"
1767 # removing address from device in default vrf should remove route from
1768 # the default vrf even when route was inserted with a table ID of 0.
1773 log_test $? 1 "Route removed in default VRF when source address deleted"
1786 echo "IPv4 route with IPv6 gateway tests"
1792 # single path route
1796 log_test $rc 0 "Single path route with IPv6 gateway"
1802 log_test $rc 0 "Single path route with IPv6 gateway - ping"
1806 log_test $rc 0 "Single path route delete"
1816 log_test $rc 0 "Multipath route add - v6 nexthop then v4"
1822 log_test $? 2 " Multipath route delete - nexthops in wrong order"
1825 log_test $? 0 " Multipath route delete exact match"
1832 log_test $rc 0 "Multipath route add - v4 nexthop then v6"
1838 log_test $? 2 " Multipath route delete - nexthops in wrong order"
1841 log_test $? 0 " Multipath route delete exact match"
1894 # Add a FIB rule and a route that will direct our connection to the
1897 $IP route add table 123 172.16.101.0/24 dev veth1
1899 # Add an unreachable route to the main table that will block our
1901 $IP route add unreachable 172.16.101.2/32
1926 $IP route del unreachable 172.16.101.2/32
1927 $IP route del table 123 172.16.101.0/24 dev veth1
1952 # Add a FIB rule and a route that will direct our connection to the
1955 $IP -6 route add table 123 2001:db8:101::/64 dev veth1
1957 # Add an unreachable route to the main table that will block our
1959 $IP -6 route add unreachable 2001:db8:101::2/128
1984 $IP -6 route del unreachable 2001:db8:101::2/128
1985 $IP -6 route del table 123 2001:db8:101::/64 dev veth1
2095 ip route help 2>&1 | grep -q fibmatch