Command Line Reference
IP Unicast Routing
Static Route-configuration
11 min
static route configuration static route configuration show ip route show ip route \[command] show ip route \[summary|connected|static|bgp|ospf|isis|kernel| a b c d/m | a b c d |vrf{all|string}|json] \[purpose] display all ipv4 routes \[parameter] true 140,521 left #4283c7 unhandled content type left #4283c7 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type \[view] system view \[use cases] sonic# show ip route connected codes k kernel route, c connected, s static, r rip, o ospf, i is is, b bgp, e eigrp, n nhrp, t table, v vnc, v vnc direct, a babel, d sharp, f pbr, f openfabric, \> selected route, fib route, q queued, r rejected, b backup c> 10 0 0 0/24 is directly connected, ethernet112, 00 22 20 c> 10 1 0 103/32 is directly connected, loopback0, 20 16 20 c> 10 250 0 0/24 is directly connected, eth0, 20 16 40 c> 11 11 10 0/24 is directly connected, vlan10, 20 16 10 c> 112 0 0 0/24 is directly connected, ethernet112, 00 22 20 c> 122 0 0 0/24 is directly connected, vlan100, 20 16 10 show ip protocol \[vrf {all|string}] show ip protocol \[vrf {all|string}] \[command] show ip protocol \[purpose] display ipv4 protocol information \[parameter] true 127,534 left #4283c7 unhandled content type left #4283c7 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type \[view] system view \[use cases] sonic# show ip protocol protocol route map \ system none kernel none connected none static none rip none ripng none ospf none ospf6 none isis none bgp rm set src pim none eigrp none nhrp none hsls none olsr none table none ldp none vnc none vnc direct none vnc rn none bgp direct none bgp direct to nve groups none babel none sharp none pbr none bfd none wildcard none any none show ipv6 route show ipv6 route \[command] show ipv6 route \[summary|connected|static|bgp|ospf6|isis|kernel| x\ x x \ x /m | x\ x x \ x |vrf{all|string}|json] \[purpose] show ipv6 routing table \[parameter] true 139,522 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type \[view] system view \[use cases] sonic# show ipv6 route codes k kernel route, c connected, s static, r ripng, o ospfv3, i is is, b bgp, n nhrp, t table, v vnc, v vnc direct, a babel, d sharp, f pbr, f openfabric, \> selected route, fib route, q queued, r rejected, b backup b> /0 \[20/0] via fe80 1a17 25ff\ fe37 6508, ethernet50, weight 1, 02 54 43 via fe80 1a17 25ff\ fe37 6722, ethernet49, weight 1, 02 54 43 show ipv6 protocol \[vrf {all|string}] show ipv6 protocol \[vrf {all|string}] \[command] show ipv6 protocol \[purpose] display ipv6 protocol information \[parameter] true 139,522 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type \[view] system view \[use cases] sonic# show ipv6 protocol vrf default protocol route map \ system none kernel none connected none static rm set src6 rip none ripng none ospf none ospf6 none isis none bgp rm set src6 pim none eigrp none nhrp none hsls none olsr none table none ldp none vnc none vnc direct none vnc rn none bgp direct none bgp direct to nve groups none babel none sharp none pbr none bfd none openfabric none vrrp none nhg none srte none wildcard none any none ip route a b c d{/m|a b c d} ip route a b c d{/m|a b c d} \[command] ip route a b c d {/m|a b c d} { a b c d |null0|ethernet interface num |vlan vlan id |link aggregation lag id |vxlan vni vni }\[option] ip route a b c d {/m|a b c d} {reject|blackhole} \[tag tag id | distance |label label id |table table id ] ip route a b c d {/m|a b c d} gre gre id no ip route a b c d {/m|a b c d} { a b c d |null0|ethernet interface num |vlan vlan id |link aggregation lag id |vxlan vni vni }\[option] \[purpose] configure ipv4 static routes \[parameter] true 139,522 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type option options are as follows true 139,522 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type \[view] system configuration view \[use cases] sonic# configure terminal sonic(config)# ip route 20 0 0 0/24 10 0 0 57 ipv6 route x\ x x\ x{/m|x\ x x\ x} ipv6 route x\ x x\ x{/m|x\ x x\ x} \[command] ipv6 route x\ x x \ x {/m|x\ x x \ x } \[from x\ x x \ x /m ] { x\ x x \ x |null0|ethernet interface num |vlan vlan id |link aggregation lag id |vxlan vni vni }\[option] ipv6 route x\ x x \ x {/m|x\ x x \ x } {reject|blackhole}\[tag tag id | distance |label label id |table table id ] ipv6 route x\ x x \ x {/m|x\ x x \ x } gre gre id no ipv6 route x\ x x \ x {/m|x\ x x \ x } \[from x\ x x \ x /m ] { x\ x x \ x |null0|ethernet interface num |vlan vlan id |link aggregation lag id |vxlan vni vni }\[option] \[purpose] configure ipv6 static routes \[parameter] true 139,522 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type option options are as follows true 139,522 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left #d8e5f5 1 1 unhandled content type left 1 1 unhandled content type left 1 1 unhandled content type \[view] system configuration view \[use cases] sonic# configure terminal sonic(config)# ipv6 route 2022 2000/64 1000 1
