Command Line Reference
Layer 3 Configuration
Basic Routing
21 min
route view route view table 1 route view table 1 route view command purpose show { ip | v6 } route \[ summary | connected | static | bgp | ospf | isis | ip address ] display ipv4/ipv6 route info show { ip | ipv6 } protocol display ipv4/ipv6 protocol info show pbr interface \[ ethernet interface name |link aggregation lag id ] \[ json ] display pbr binding info show pbr map \[ pbr map name | json | detail ] display pbr policy info show pbr nexthop groups \[ next group name | json ] display pbr next hop info show {ip|v6} route \[summary|connected|static|bgp|ospf|isis| show {ip|v6} route \[summary|connected|static|bgp|ospf|isis| ip address ] \[command] show { ip | ipv6 } route \[ summary | connected | static | bgp | ospf | isis | ip address ] \[purpose] display ipv4/ipv6 route info \[parameters] parameter description ip address ipv4 or ipv6 address \[view] privileged user 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|ipv6} protocol show {ip|ipv6} protocol \[command] show { ip | ipv6 } protocol \[purpose] display ipv4/ipv6 protocol info \[view] privileged user 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 pbr interface \[ethernet show pbr interface \[ethernet interface name |link aggregation lag id ] \[json] \[command] show pbr interface \[ ethernet interface name | link aggregation lag id ] \[ json ] \[purpose] display pbr binding info \[parameters] parameter description interface name interface name(eg 0/1) lag id lag id, the range is from 1 to 9999 \[view] privileged user view \[use cases] sonic# show pbr interface ethernet 0/0 ethernet 0/0(15) with pbr policy yd1 show pbr map \[pbr map name|json|detail] show pbr map \[pbr map name|json|detail] \[command] show pbr map \[ pbr map name | json | detail ] \[purpose] display pbr policy info \[parameters] parameter description pbr map name pbr map name \[view] privileged user view \[use cases] sonic# show pbr map yd1 pbr map yd1 valid yes seq 1 rule 300 installed yes reason valid src match 100 0 0 2/32 nexthop 102 0 0 2 installed yes tableid 10002 show pbr nexthop groups \[next group name|json] show pbr nexthop groups \[next group name|json] \[command] show pbr nexthop groups \[ next group name | json ] \[purpose] display pbr next hop info \[parameters] parameter description next group name next hop group name \[view] privileged user view \[use cases] sonic# show pbr nexthop groups yd nexthop group yd table 10000 valid 1 installed 1 valid 1 nexthop 102 0 0 2 valid 1 nexthop 103 0 0 2 route config route config table 2 route config table 2 route config command purpose ip route a b c d/m { a b c d | interface type interface name }\[ distance ]\[ description description ] \[ track track id ] \[ bfd ] \[ nexthop vrf vrf ] configure ipv4 static routes ipv6 route x\ x x\ x/m { x\ x x\ x | interface type interface name }\[ distance ]\[ description description ] \[ track track id ] \[ bfd ] \[ nexthop vrf vrf ] configure ipv6 static routes pbr map pbr map name seq seq num create pbr policy and enter the pbr map configuration view match { dst ip dip | dst port dport | ip protocol ip protocol | src ip sip | src port sport } configure pbr policy match fields set { nexthop { a b c d | x\ x x\ x }| nexthop group next group name } configure pbr policy actions nexthop group next group name create a next hop group and enter the next hop group configuration mode nexthop { a b c d | x\ x x\ x } configure the next hop pbr policy pbr map name bind pbr policy ip route ip route a b c d/m { a b c d | interface type interface name } \[options] \[command] ip route a b c d/m { a b c d | interface type interface name }\[ distance ]\[ description description ] \[ track track id ] \[ bfd ] \[ nexthop vrf vrf ] \[purpose] configure ipv4 static routes \[parameters] parameter description a b c d/m specify the destination network segment for routing a b c d specify the ip address of next hop of the route interface type the next hop interface type optional parameters include ethernet, vlan, and link aggregation interface name next hop interface name distance static route distance value,range from 1 255 default value 1 description specify the description for the route in string form track id track id, range from \[1,4294967295] bfd configure static route and bfd linkage vrf name of the vrf where the next hop interface resides \[view] global configuration view / vrf configuration view \[notes] run command no ip route a b c d/m { a b c d | interface type interface name }\[ distance ]\[ description description ] \[ track track id ] \[ bfd ] \[ nexthop vrf vrf ] to delete static routes configuration \[use cases] sonic# configure terminal sonic(config)# ip route 20 0 0 0/24 10 0 0 57 description test ipv6 route ipv6 route x\ x x\ x/m { x\ x x\ x | interface type interface name } \[options] \[options] \[command] ipv6 route x\ x x\ x/m { x\ x x\ x | interface type interface name }\[ distance ]\[ description description ] \[ track track id ] \[ bfd ] \[ nexthop vrf vrf ] \[purpose] configure ipv6 static routes \[parameters] parameter description x\ x x\ x/m specify the destination network segment for routing x\ x x\ x specify the ip address of next hop of the route interface type the next hop interface type optional parameters include ethernet, vlan, and link aggregation interface name next hop interface name distance static route distance value,range from 1 255 default value 1 description specify the description for the route in string form track id track id, range from \[1,4294967295] bfd configure static route and bfd linkage vrf name of the vrf where the next hop interface resides \[view] global configuration view / vrf configuration view \[notes] run command no ipv6 route x\ x x\ x/m { x\ x x\ x | interface type interface name }\[ distance ]\[ description description ] \[ track track id ] \[ bfd ] \[ nexthop vrf vrf ] to delete static routes configuration \[use cases] sonic# configure terminal sonic(config)# ipv6 route 2001 2/96 2002 1 track 1 pbr map pbr map pbr map name seq seq num \[command] pbr map pbr map name seq seq num \[purpose] create pbr policy and enter the pbr map configuration view \[parameters] parameter description pbr map name pbr map name seq num sequence number, range from 1 to 700 \[view] global configuration view \[notes] run command no pbr map pbr map name \[ seq seq num ] to delete pbr policy configuration \[use cases] sonic(config)# pbr map pbrmap1 seq 1 sonic(config pbr map)# match { dst ip match { dst ip dip |dst port dport |ip protocol ip protocol |src ip sip |src port sport } \[command] match { dst ip dip | dst port dport | ip protocol ip protocol | src ip sip | src port sport } \[purpose] configure pbr policy match fields \[parameters] parameter description dip destination ip, a b c d/m or x\ x x\ x/m dst port destination port number, range from 1 to 65535 ip protocol tcp/udp sip source ip, a b c d/m or x\ x x\ x/m sport source port number, range from 1 to 65535 \[view] pbr map configuration view \[notes] run command no match { dst ip dip | dst port dport | ip protocol ip protocol | src ip sip | src port sport } to delete pbr policy match fields \[use cases] sonic(config)# pbr map pbrmap1 seq 1 sonic(config pbr map)# match src ip 1 2 1 1/32 sonic(config pbr map)# set {nexthop { set {nexthop { a b c d | x\ x x\ x }|nexthop group next group name } \[command] set { nexthop { a b c d | x\ x x\ x }| nexthop group next group name } \[purpose] configure pbr policy actions \[parameters] parameter description a b c d | x\ x x\ x next hop ip next group name nexthop group name \[view] pbr map configuration view \[notes] run command no set { nexthop { a b c d | x\ x x\ x }| nexthop group next group name } to delete pbr policy actions \[use cases] sonic(config)# pbr map pbrmap1 seq 1 sonic(config pbr map)# set nexthop 83 0 0 1 sonic(config pbr map)# nexthop group nexthop group next group name \[command] nexthop group next group name \[purpose] create a next hop group and enter the next hop group configuration mode \[parameters] parameter description next group name nexthop group name \[view] global configuration view \[notes] run command no nexthop group next group name to delete the next hop group configuration \[use cases] sonic(config)# nexthop group nextgroup1 sonic(config nh group)# nexthop { nexthop { a b c d | x\ x x\ x } \[command] nexthop { a b c d | x\ x x \ x} \[purpose] configure the next hop \[parameters] parameter description a b c d | x\ x x \ x next hop ip \[view] nexthop group configuration view \[notes] run command no nexthop { a b c d | x\ x x \ x} to delete the next hop configuration \[use cases] sonic(config)# nexthop group nextgroup1 sonic(config nh group)# nexthop 82 0 0 1 sonic(config nh group)# pbr policy pbr policy pbr map name \[command] pbr policy pbr map name \[purpose] bind pbr policy \[parameters] parameter description pbr map name pbr map name \[view] physical interface/lagif configuration view \[notes] run command no pbr policy pbr map name to delete binding pbr policy configuration \[use cases] sonic(config)# interface ethernet 0/0 sonic(config if 0/0)# pbr policy pbrmap1 sonic(config if 0/0)#
