跳转到内容
Ask AI

Static Route-configuration

此内容尚不支持你的语言。

[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]

ParameterDescription
A.B.C.D/MIP prefix /
A.B.C.DNetwork

[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

[Command] show ip protocol

[Purpose] Display IPv4 protocol information

[Parameter]

ParameterDescription
vrfDisplay IPv4 protocol information under the specified VRF

[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

[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]

ParameterDescription
summaryShow route summary
connectedShow directly connected routes
staticDisplay static routes
bgpShow BGP routes
ospf6Display OSPF6 routes
isisShow ISIS routes
kernelShow kernel routes
X:X::X:X/MIPv6 prefix /
X:X::X:XNetwork
vrfDisplay the routes under the specified VRF
jsonDisplay routes in json format

[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

[Command] show ipv6 protocol

[Purpose] Display IPv6 protocol information

[Parameter]

ParameterDescription
vrfDisplay IPv6 protocol information under the specified VRF

[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

[Command] ip routeA.B.C.D**{/M|A.B.C.D} {A.B.C.D|Null0|ethernetinterface_num|vlanvlan_id|link-aggregationlag_id|vxlan-vniVNI}[OPTION]*** ip routeA.B.C.D**{/M|A.B.C.D} {reject|blackhole} [tagtag_id|distance|labellabel_id|tabletable_id]*** ip routeA.B.C.D**{/M|A.B.C.D} gregre_id no ip route*A.B.C.D*****{/M|A.B.C.D} {A.B.C.D|Null0|ethernetinterface_num|vlanvlan_id|link-aggregationlag_id|vxlan-vniVNI}[OPTION]***

[Purpose] Configure IPv4 static routes

[Parameter]

ParameterDescription
A.B.C.D/MDestination IP address of the route
A.B.C.DRouting the IP address of the next hop
Null0No outgoing interface specified
ethernetSpecify the outgoing interface as a physical port
interface_numThe range of interface id 0~54
vlanSpecify the outgoing interface as a VLAN port
vlan_idSpecify VLAN id, range 1~4094
link-aggregationSpecify the outgoing interface as the aggregation port
lag_idSpecify lag_id
vrfDisplay the routes under the specified VRF
vxlan-vniDirect vxlan-vni value
VNIVNI range 1~16777215

OPTION options are as follows:

ParameterDescription
tagSpecify the tag value of the route, range 1~4294967295
distanceSpecify the metric value of the route, in the range 1~255
labelSpecify the label value of the route, ranging from 16 to 1048575, separated by ”/“
tableSpecify the table value of this route, range 1~4294967295
nexthop-vrfSpecify the VRF for the next hop of this route
colorSpecify the color value of this route, range 1~4294967295
bfdEnable the BFD detection function for this route
multihopSet BFD’s multihop mode
local-addressSet local-address in multihop mode of BFD, A.B.C.D
rejectSpecify the route as reject type
blackholeSpecify the route as a blackhole route
greSpecify the routing out interface as GRE
gre_idSpecify GRE id range, 0~323

[View] System configuration view

[Use Cases]

sonic# configure terminal
sonic(config)# ip route 20.0.0.0/24 10.0.0.57

[Command] ipv6 routeX:X::X:X {/M|X:X::X:X } [fromX:X::X:X***/M*****] {X:X::X:X |Null0|ethernetinterface_num*****|vlanvlan_id|link-aggregationlag_id|vxlan-vniVNI}[OPTION]*** ipv6 routeX:X::X*:X {/M|X:X::X:X } {reject|blackhole}[tagtag_id**|distance|labellabel_id|tabletable_id]*** ipv6 routeX:X::X:X {/M|X:X::X:X } gregre_id no ipv6 routeX:X::X:X {/M|X:X::X:X } [fromX:X::X:X***/M*****] {X:X::X:X |Null0|ethernet*interface_num*****|vlanvlan_id|link-aggregationlag_id|vxlan-vniVNI}[OPTION]***

[Purpose] Configure IPv6 static routes

[Parameter]

ParameterDescription
X:X::X:X/MDestination IPv6 address of the route
X:X::X:XRouting the next-hop IPv6 address
fromSpecify the source address of the route
X:X::X:X/MSpecify the route address prefix
Null0No outgoing interface specified
ethernetSpecify the outgoing interface as a physical port
interface_numThe range of interface ID 0~54
vlanSpecify the outgoing interface as a VLAN port
vlan_idSpecify VLAN ID, range 1~4094
link-aggregationSpecify the outgoing interface as the aggregation port
lag_idSpecify LAG ID
vxlan-vniDirect VNI value
VNIVNI range 1~16777215

OPTION options are as follows:

ParameterDescription
tagSpecify the tag value of the route, range 1~4294967295
distanceSpecify the metric value of the route, in the range 1~255
labelSpecify the label value of the route, ranging from 16 to 1048575, separated by ”/“
tableSpecify the table value of this route, range 1~4294967295
nexthop-vrfSpecify the VRF for the next hop of this route
colorSpecify the color value of this route, range 1~4294967295
bfdEnable the BFD detection function for this route
multihopSet BFD’s multihop mode
local-addressSet local-address in multihop mode of BFD, A.B.C.D
rejectSpecify the route as reject type
blackholeSpecify the route as a blackhole route
greSpecify the route out interface as GRE
gre_idSpecify GRE id range, 0~323

[View] System configuration view

[Use Cases]

sonic# configure terminal
sonic(config)# ipv6 route 2022::2000/64 1000::1