IP Unicast Routing
Static Route Configuration
Section titled “Static Route Configuration”show ip route
Section titled “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]
Parameter | Description |
---|---|
summary | Display routes summary |
connected | Display directly connected routes |
static | Display static routes |
bgp | Display bgp routes |
ospf | Display ospf routes |
isis | Display isis routes |
<A.B.C.D/M> | IP prefix |
<A.B.C.D> | Network |
[View]
System view
[Use Cases]
sonic# show ip route connectedCodes: 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 - backupC>* 10.0.0.0/24 is directly connected, Ethernet112, 00:22:20C>* 10.1.0.103/32 is directly connected, Loopback0, 20:16:20C>* 10.250.0.0/24 is directly connected, eth0, 20:16:40C>* 11.11.10.0/24 is directly connected, Vlan10, 20:16:10C>* 112.0.0.0/24 is directly connected, Ethernet112, 00:22:20C>* 122.0.0.0/24 is directly connected, Vlan100, 20:16:10
show ip protocol
Section titled “show ip protocol”[Command]
show ip protocol [vrf {all| String }]
[Purpose]
Display IPv4 protocol information
[Parameter]
Parameter | Description |
---|---|
vrf | Display IPv4 protocol information under the specified VRF |
[View]
System view
[Use Cases]
sonic# show ip protocolProtocol : route-map------------------------system : nonekernel : noneconnected : nonestatic : nonerip : noneripng : noneospf : noneospf6 : noneisis : nonebgp : RM_SET_SRCpim : noneeigrp : nonenhrp : nonehsls : noneolsr : nonetable : noneldp : nonevnc : nonevnc-direct : nonevnc-rn : nonebgp-direct : nonebgp-direct-to-nve-groups : nonebabel : nonesharp : nonepbr : nonebfd : nonewildcard : noneany : none
show ipv6 route
Section titled “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]
Parameter | Description |
---|---|
summary | Show route summary |
connected | Show directly connected routes |
static | Display static routes |
bgp | Show BGP routes |
ospf6 | Display OSPF6 routes |
isis | Show ISIS routes |
kernel | Show kernel routes |
X:X::X:X/M | IPv6 prefix / |
X:X::X:X | Network |
vrf | Display the routes under the specified VRF |
json | Display routes in json format |
[View]
System view
[Use Cases]
sonic# show ipv6 routeCodes: 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 - backupB>* ::/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]
Section titled “show ipv6 protocol [vrf]”[Command]
show ipv6 protocol [vrf {all| String }]
[Purpose]
Display IPv6 protocol information
[Parameter]
Parameter | Description |
---|---|
vrf | Display IPv6 protocol information under the specified VRF |
[View]
System view
[Use Cases]
sonic# show ipv6 protocolVRF: defaultProtocol : route-map-------------------------------------system : nonekernel : noneconnected : nonestatic : RM_SET_SRC6rip : noneripng : noneospf : noneospf6 : noneisis : nonebgp : RM_SET_SRC6pim : noneeigrp : nonenhrp : nonehsls : noneolsr : nonetable : noneldp : nonevnc : nonevnc-direct : nonevnc-rn : nonebgp-direct : nonebgp-direct-to-nve-groups : nonebabel : nonesharp : nonepbr : nonebfd : noneopenfabric : nonevrrp : nonenhg : nonesrte : nonewildcard : noneany : none
ip route
Section titled “ip route”[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 |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 valn_id |link-aggregation lag_id |vxlan-vni}[OPTION]
[Purpose]
Configure IPv4 static routes
[Parameter]
Parameter | Description |
---|---|
A.B.C.D/M | Destination IP address of the route |
A.B.C.D | Routing the IP address of the next hop |
Null0 | No outgoing interface specified |
interface_num | Specify the outgoing interface as a physical port, the range of interface id 0~54 |
vlan_id | Specify the outgoing interface as a VLAN port, specify VLAN id, range 1~4094 |
lag_id | Specify the outgoing interface as the aggregation port |
VNI | Direct vxlan-vni value |
OPTION options are as follows:
Parameter | Description |
---|---|
tag | Specify the tag value of the route, range 1~4294967295 |
distance | Specify the metric value of the route, in the range 1~255 |
label | Specify the label value of the route, ranging from 16 to 1048575, separated by ”/“ |
table | Specify the table value of this route, range 1~4294967295 |
nexthop-vrf | Specify the VRF for the next hop of this route |
color | Specify the color value of this route, range 1~4294967295 |
bfd | Enable the BFD detection function for this route |
multihop | Set BFD’s multihop mode |
local-address | Set local-address in multihop mode of BFD, A.B.C.D |
reject | Specify the route as reject type |
blackhole | Specify the route as a blackhole route |
[View]
System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# ip route 20.0.0.0/24 10.0.0.57
ipv6 route
Section titled “ipv6 route”[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}[OPTION]
ipv6 route X:X::X:X { /M|X:X::X:X } {reject|blackhole}[tag tag_id |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}[OPTION]
[Purpose]
Configure IPv6 static routes
[Parameter]
Parameter | Description |
---|---|
X:X::X:X/M | Destination IPv6 address of the route |
X:X::X:X | Routing the next-hop IPv6 address |
from | Specify the source address of the route |
X:X::X:X/M | Specify the route address prefix |
Null0 | No outgoing interface specified |
ethernet | Specify the outgoing interface as a physical port |
interface_num | The range of interface ID 0~54 |
vlan | Specify the outgoing interface as a VLAN port |
vlan_id | Specify VLAN ID, range 1~4094 |
link-aggregation | Specify the outgoing interface as the aggregation port |
lag_id | Specify LAG ID |
vxlan-vni | Direct VNI value |
VNI | VNI range 1~16777215 |
OPTIONoptions are as follows:
Parameter | Description |
---|---|
tag | Specify the tag value of the route, range 1~4294967295 |
distance | Specify the metric value of the route, in the range 1~255 |
label | Specify the label value of the route, ranging from 16 to 1048575, separated by ”/“ |
table | Specify the table value of this route, range 1~4294967295 |
nexthop-vrf | Specify the VRF for the next hop of this route |
color | Specify the color value of this route, range 1~4294967295 |
bfd | Enable the BFD detection function for this route |
multihop | Set BFD’s multihop mode |
local-address | Set local-address in multihop mode of BFD, A.B.C.D |
reject | Specify the route as reject type |
blackhole | Specify the route as a blackhole route |
gre_id | Specify the route out interface as GRE |
[View]
System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# ipv6 route 2022::2000/64 1000::1
BGP Configuration
Section titled “BGP Configuration”show bgp peer-group
Section titled “show bgp peer-group”[Command]
show bgp peer-group
[Purpose]
This command displays configured BGP peer-groups
[View]
System view
[Use Cases]
sonic# show bgp peer-groupBGP peer-group PEER_V4_EBGP Peer-group type is external Configured address-families: IPv4 Unicast; Peer-group members: 30.11.13.9 Established 30.11.13.137 ActiveBGP peer-group PEER_V4_IBGP Peer-group type is external Configured address-families: IPv4 Unicast;BGP peer-group PEER_V4_INT Peer-group type is external Configured address-families: IPv4 Unicast;BGP peer-group PEER_V6_EBGP Peer-group type is external Configured address-families: IPv4 Unicast; Peer-group members: 2022::9300 Active 2022::9310 EstablishedBGP peer-group PEER_V6_IBGP Peer-group type is external Configured address-families: IPv4 Unicast;BGP peer-group PEER_V6_INT Peer-group type is external Configured address-families: IPv4 Unicast;
show ip bgp
Section titled “show ip bgp”[Command]
show ip bgp {view[all| view_name ] | [vrf [all| vrf_name ]]}
[Purpose]
Display the routing table of BGP view or VRF
[Parameter]
Parameter | Description |
---|---|
view | specify view |
view_name | the name of view |
vrf | specify VRF |
vrf_name | the name of VRF |
[View]
System view
[Use Cases]
sonic# show ip bgp vrf allInstance default:BGP table version is 2375, local router ID is 30.11.0.84, vrf id 0Default local pref 100, local AS 65100Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, i internal, r RIB-failure, S Stale, R RemovedNexthop codes: @NNN nexthop's vrf id, < announce-nh-selfOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path*> 0.0.0.0/0 30.11.13.9 0 65101 4200000001 i
show ip bgp neighbors
Section titled “show ip bgp neighbors”[Command]
show ip bgp neighbors
[Purpose]
Display the details of BGP neighbors
[View]
System view
[Use Cases]
sonic# show ip bgp neighborsBGP neighbor is 1.1.1.2, remote AS 65100, local AS 65200, external link BGP version 4, remote router ID 2.1.1.2, local router ID 192.168.15.48 BGP state = Established, up for 02:34:12 Last read 00:00:09, Last write 00:00:12 Hold time is 90, keepalive interval is 30 seconds Neighbor capabilities: 4 Byte AS: advertised AddPath: IPv4 Unicast: RX advertised IPv4 Unicast Route refresh: advertised Address Family IPv4 Unicast: advertised and received Hostname Capability: advertised (name: sonic,domain name: n/a) not received Graceful Restart Capability: advertised Graceful restart information: Local GR Mode: Helper* Remote GR Mode: Disable R bit: False Timers: Configured Restart Time(sec): 120 Received Restart Time(sec): 0 Message statistics: Inq depth is 0 Outq depth is 0 Sent Rcvd Opens: 3 3 Notifications: 0 4 Updates: 2 6 Keepalives: 338 337 Route Refresh: 0 0 Capability: 0 0 Total: 343 350 Minimum time between advertisement runs is 0 seconds For address family: IPv4 Unicast Update group 3, subgroup 3 Packet Queue length 0 Community attribute sent to this neighbor(all) 25 accepted prefixes Connections established 3; dropped 2 Last reset 02:34:17, No AFI/SAFI activated for peerLocal host: 1.1.1.1, Local port: 179Foreign host: 1.1.1.2, Foreign port: 1051Nexthop: 1.1.1.1Nexthop global: fe80::211:24ff:fe1a:1b61Nexthop local: fe80::211:24ff:fe1a:1b61BGP connection: shared networkBGP Connect Retry Timer in Seconds: 120Estimated round trip time: 1 msRead thread: on Write thread: on FD used: 27
show ip bgp
Section titled “show ip bgp”[Command]
show ip bgp
[Purpose]
Display all route information received from BGP neighbors
[View]
System view
[Use Cases]
sonic# show ip bgpInstance default:BGP table version is 3, local router ID is 10.1.1.138, vrf id 0Default local pref 100, local AS 65001Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, i internal, r RIB-failure, S Stale, R RemovedNexthop codes: @NNN nexthop's vrf id, < announce-nh-selfOrigin codes: i - IGP, e - EGP, ? - incompleteRPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path*> 10.1.1.138/32 0.0.0.0 0 32768 i*> 10.1.1.139/32 10.1.1.2 0 0 65002 i*> 10.1.1.216/32 10.1.1.2 0 65002 65003 i
show ip bgp statistics
Section titled “show ip bgp statistics”[Command]
show ip bgp statistics
[Purpose]
Display BGP routing-related statistics
[View]
System view
[Use Cases]
sonic# show ip bgp statisticsBGP IPv4 Unicast RIB statistics (VRF default)Total Advertisements : 25Total Prefixes : 25Average prefix length : 19.20Unaggregateable prefixes : 25Maximum aggregateable prefixes: 0BGP Aggregate advertisements : 0Address space advertised : 985600 % announced : 0.02 /8 equivalent : 0.06 /24 equivalent : 3850.00Advertisements with paths : 25Longest AS-Path (hops) : 1Average AS-Path length (hops) : 1.00Largest AS-Path (bytes) : 6Average AS-Path size (bytes) : 6.00Highest public ASN : 0
show bgp neighbors log-info
Section titled “show bgp neighbors log-info”[Command]
show bgp neighbors log-info
[Purpose]
Display the BGP neighbor status information.
[View]
System view
[Usage Scenario] Using this command, you can sequentially view the BGP neighbor’s re-establishment time, the last Errordown time, the reason for the Errordown, and the last establishment time. The reasons for Errordown include Admin. Shutdown (BGP session down), BFD down received (BFD session down), Interface down (interface down), Notification sent (Cease/Other Configuration Change [BGP session information changed] | Hold Timer Expired [BGP message timeout]), Notification received (Cease/Unspecific [BGP session termination] | Cease/Peer De-configured [peer BGP neighbor removed]), etc.
[Use Cases]
sonic(config-router)# do show bgp neighbors log-info--------------------------------------------------BGP neighbor is 1.1.1.2Date/Time : 2024-12-25 02:32:31Status : UpDate/Time : 2024-12-25 02:32:01Status : DownDown reason : Notification sent (Cease/Other Configuration Change)Date/Time : 2024-12-25 02:30:09Status : Up
router bgp
Section titled “router bgp”[Command]
router bgp AS [view view_name |vrf vrf_name ]
no router bgp AS [view view_name |vrf vrf_name ]
[Purpose]
Enable a BGP protocol process with the specified AS number
[Parameter]
Parameter | Description |
---|---|
AS | AS number(1~4294967295) or ASN format as dot notation(0..65535).(0..65535) |
view_name | specify the view name |
vrf_name | specify the VRF name |
[View]
System configuration view
[Notes] When VRF_name is not specified, the BGP protocol process belongs to the default VRF. When expressing ASN in dot notation, the decimal ASN 65538 is equivalent to the dot notation 1.2.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)#
bgp router-id A.B.C.D
Section titled “bgp router-id A.B.C.D”[Command]
bgp router-id A.B.C.D
no bgp router-id A.B.C.D
[Purpose]
This command specifies the router-ID
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | configured router identifier |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp router-id 1.1.1.1
bgp cluster-id A.B.C.D
Section titled “bgp cluster-id A.B.C.D”[Command]
bgp cluster-id A.B.C.D
no bgp cluster-id A.B.C.D
[Purpose]
Configure the cluster ID for the route reflector
[View]
BGP configuration view
[Usage Scenario] When multiple route reflectors exist within a cluster, it is necessary to configure the same cluster ID to identify that these reflectors belong to the same cluster
[Use Cases]
sonic(config)# router bgp 65100sonic(config-router)# bgp cluster-id 10.1.1.10
bgp bestpath
Section titled “bgp bestpath”[Command]
bgp bestpath [as-path {confed | ignore | multipath-relax}
no bgp bestpath [as-path {confed | ignore | multipath-relax}
[Purpose]
Specify the bestpath decision method for BGP
[Parameter]
Parameter | Description |
---|---|
confed | Specifies that BGP considers AS path length and content when selecting the best route |
ignore | Ignore the attributes when specifying bgp bestpath decision method multipath-relax. This command specifies that BGP decision process should consider paths of equal AS_PATH length candidates for multipath computation. Without the knob, the entire AS_PATH must match for multipath computation |
multipath-relax | Ensure that when comparing routes where both are equal on most metrics, including local-pref, AS_PATH length, IGP cost, MED, that the tie is broken based on router-ID |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp bestpath as-path ignore
bgp bestpath compare-routerid
Section titled “bgp bestpath compare-routerid”[Command]
bgp bestpath compare-routerid
no bgp bestpath compare-routerid
[Purpose]
Configure BGP to ignore Router ID when selecting the best route
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp bestpath as-path compare-routerid
bgp bestpath bandwidth
Section titled “bgp bestpath bandwidth”[Command]
bgp bestpath bandwidth {default-weight-for-missing|ignore|skip-missing}
no bgp bestpath bandwidth {default-weight-for-missing|ignore|skip-missing}
[Purpose]
Configure BGP’s treatment of bandwidth when selecting the best path
[Parameter]
Parameter | Description |
---|---|
default-weight-for-missing | When a route does not carry a bandwidth parameter, the default action is to assign a weight of 1 |
ignore | Ignore the bandwidth value in the route |
skip-missing | Discard routes that do not carry a bandwidth parameter |
[View]
BGP configuration view
[Use Cases]
sonic(config)# router bgp 65100sonic(config-router)# bgp bestpath bandwidth default-weight-for-missing
bgp ebgp-requires-policy
Section titled “bgp ebgp-requires-policy”[Command]
bgp ebgp-requires-policy
no bgp ebgp-requires-policy
[Purpose]
This command requires incoming and outgoing filters to be applied for EBGP sessions
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp ebgp-requires-policy
bgp graceful-restart restart-time
Section titled “bgp graceful-restart restart-time”[Command]
bgp graceful-restart restart-time delay
no bgp graceful-restart restart-time delay
[Purpose]
Set the maximum waiting time for the remote end to wait for the successful reconstruction of the local BGP neighbor
[Parameter]
Parameter | Description |
---|---|
delay | Range value: 1-4094, unit: s |
[View]
BGP configuration view
[Usage Scenario] After executing this command, when the remote device detects that the BGP peer established with the local device is in a Down state, it triggers the BGP session to enter Graceful Restart mode. During this time, the device can continue to use previously learned routing information without waiting for the BGP session to be reestablished. If the maximum waiting time is exceeded without a successful reconnection, the device exits the Graceful Restart process and withdraws routes.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp graceful-restart restart-time 200
bgp graceful-restart rib-stale-time
Section titled “bgp graceful-restart rib-stale-time”[Command]
bgp graceful-restart rib-stale-time delay
no bgp graceful-restart rib-stale-time delay
[Purpose]
Configure the maximum waiting time for the local end to wait for the End-Of-RIB marker from the remote end
[Parameter]
Parameter | Description |
---|---|
delay | Range value: 1-3600, unit: s |
[View]
BGP configuration view
[Usage Scenario] After the local end and remote end rebuild the BGP session, the local end should receive the End-Of-RIB marker from the remote end within the time set by this command. If the End-Of-RIB marker is not received within the specified time, the local end will exit the Graceful Restart process and withdraw routes.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp graceful-restart rib-stale-time 20
bgp shutdown
Section titled “bgp shutdown”[Command]
bgp shutdown [message String ]
no bgp shutdown [message String ]
[Purpose]
Administrative shutdown of all peers of a BGP instance
[Parameter]
Parameter | Description |
---|---|
string | An optional shutdown message MSG can be specified. |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp shutdown message testing
bgp network import-check
Section titled “bgp network import-check”[Command]
bgp network import-check
no bgp network import-check
[Purpose]
Check for the networks existence in RIB
[View]
BGP configuration view
[Usage Scenario] This configuration modifies the behavior of the network statement. If you have this configured the underlying network must exist in the rib. If you have the [no] form configured then BGP will not check for the networks existence in the rib. For versions 7.3 and before frr defaults for datacenter were the network must exist, traditional did not check for existence. For versions 7.4 and beyond both traditional and datacenter the network must exist.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp network import-check
bgp update-delay
Section titled “bgp update-delay”[Command]
bgp update-delay MAX-DELAY [ ESTABLISH-WAIT ]
no bgp update-delay MAX-DELAY [ ESTABLISH-WAIT ]
[Purpose]
Configuring a global delay for sending Update messages
[Parameter]
Parameter | Description |
---|---|
MAX-DELAY | Max delay in seconds (0..3600) |
ESTABLISH-WAIT | Establish wait in seconds (1..3600) |
[View]
System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# bgp update-delay 2 2
update-delay
Section titled “update-delay”[Command]
update-delay MAX-DELAY
no update-delay MAX-DELAY
[Purpose]
This command is used to delay the advertisement of BGP routes after a BGP process is restarted.
[Parameter]
Parameter | Description |
---|---|
MAX-DELAY | Range value: 0-3600, unit: s |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# update-delay 2
distance
Section titled “distance”[Command]
distance ebpg_distance ibgp_distance local_distance
distance distance A.B.C.D/M [ip-prefix-name]
no distance ebpg_distance ibgp_distance local_distance
no distance distance A.B.C.D/M [ip-prefix-name]
[Purpose]
Modify the administrative distance for the route
[Parameter]
Parameter | Description |
---|---|
ebpg_distance | Modify the administrative distance of EBGP routes, the value range: 1-255 |
ibgp_distance | Modify the administrative distance of IBGP routes, the value range is 1-255 |
local_distance | Change the administrative distance of the local route, the value range is 1-255 |
distance | Sets the administrative distance for a particular route |
A.B.C.D/M | IP-prefix |
ip-prefix-name | The name of ip-prefix list |
[View]
BGP configuration view
[Usage Scenario] If the system has a static route configured from the kernel, it has a distance of 0. In some cases, it might be useful to override the route. E.g.: Kernel has a statically configured default route, and you received another default route from the BGP and want to install it to be preferred over the static route. In such a case, user can set a higher distance from the kernel. By default, the administrative distance for EBGP routes is 200, the administrative distance for IBGP routes is 20, and the administrative distance for local routes is 1.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# distance 20 0.0.0.0/0
redistribute
Section titled “redistribute”[Command]
redistribute [babel|connected|eigrp|isis|kernel|openfabric|ospf|ospf6|rip|ripng|sharp|static|table|vnc|vnc-direct] [metric metric_id ] [route-map String ]
no redistribute [babel|connected|eigrp|isis|kernel|openfabric|ospf|ospf6|rip|ripng|sharp|static|table|vnc|vnc-direct] [metric metric_id ] [route-map String ]
[Purpose]
Redistribute routes from other protocols into BGP
[Parameter]
Parameter | Description |
---|---|
metric_id | Set the metric for route |
route-map String | Apply a route-map |
[View]
Address-family view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# redistribute ospf metric 200
bgp listen range
Section titled “bgp listen range”[Command]
bgp listen range { A.B.C.D/M | X:X::X:X/M } peer-group name
no bgp listen range { A.B.C.D/M | X:X::X:X/M } peer-group name
[Purpose]
Allow establishing BGP neighbor relationships with all IP addresses within the specified address range
[Parameter]
Parameter | Description |
---|---|
A.B.C.D/M X:X::X:X/M | IP range |
name | Peer group name |
[View]
BGP configuration view
[Use Cases]
sonic(config)# router bgp 65100sonic(config-router)# neighbor TEST peer-groupsonic(config-router)# neighbor TEST remote-as externalsonic(config-router)# bgp listen range 10.111.1.0/24 peer-group TEST
bgp listen limit
Section titled “bgp listen limit”[Command]
bgp listen limit neighor_number
no bgp listen limit neighor_number
[Purpose]
Define the maximum number of peers accepted for one BGP instance
[Parameter]
Parameter | Description |
---|---|
neighbor_number | Configure Dynamic Neighbors listen limit value (1..5000) |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp listen limit 20
bgp default ipv4-unicast
Section titled “bgp default ipv4-unicast”[Command]
bgp default ipv4-unicast
no bgp default ipv4-unicast
[Purpose]
IPv4 unicast address families for all neighbors are enabled by default
[View]
BGP configuration view
[Notes] By default, all neighbors do not enable the IPv4 unicast address family and require manual configuration to set their state to Active. After configuring the bgp default ipv4-unicast command, the created BGP peer automatically enables the IPv4 unicast address family by default.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp default ipv4-unicast
bgp default local-preference
Section titled “bgp default local-preference”[Command]
bgp default local-preference value
no bgp default local-preference value
[Purpose]
configuring the default local preference for BGP
[View]
BGP configuration view
[Notes] By default, the default local priority is 100.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp default local-preference 100
bgp default shutdown
Section titled “bgp default shutdown”[Command]
bgp default shutdown
no bgp default shutdown
[Purpose]
Set the default state of the newly configured peer to shutdown
[View]
BGP configuration view
[Notes] After configuring this command, all newly added BGP peers will require manual configuration of the no shutdown command to be used properly.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp default shutdown
bgp route-reflector allow-outbound-policy
Section titled “bgp route-reflector allow-outbound-policy”[Command]
bgp route-reflector allow-outbound-policy
no bgp route-reflector allow-outbound-policy
[Purpose]
Allowing route policies to affect reflected routes
[View]
BGP configuration view
[Usage Scenario] By default, policies that modify route attributes configured in a route-map do not affect routes that are reflected by route reflectors. Enabling this feature allows route attributes to be modified and take effect on all reflected routes.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp route-reflector allow-outbound-policy
bgp fast-external-failover
Section titled “bgp fast-external-failover”[Command]
bgp route-reflector allow-outbound-policy
no bgp route-reflector allow-outbound-policy
[Purpose]
Enable BGP to immediately close the EBGP peer when there is link instability.
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# bgp fast-external-failover
aggregate-address
Section titled “aggregate-address”[Command]
aggregate-address ip-address { mask-length | mask } [as-set|summary-only|route-map String |origin{incomplete|igp|egp}]
no aggregate-address ip-address { mask-length | mask } [as-set|summary-only|route-map String |origin{incomplete|igp|egp}]
[Purpose]
This command specifies an aggregate address
[Parameter]
Parameter | Description |
---|---|
ip-address | Specifies an IP address of the summarized route. Theaddress is in dotted decimal notation |
mask | IP address mask, the address is in dotted decimal natation |
mask-length | Length of the IP address mask |
as-set | Include AS-set in the generated routes |
summary-only | Announce only the aggregated route |
route-map String | Apply a route-map for an aggregated prefix |
origin{incomplete|igp|egp} | Specify ORIGIN for an aggregated prefix |
[View]
IP Address-family View
[Usage Scenario] This command can be used to aggregate and advertise routes from the local routing table. To ensure that the aggregated routes have loop prevention, you can use the “as-set” keyword to create an aggregate route that inherits the Origin, AS_Path, Community, and large-community attributes from the specific routes. By configuring “summary-only,” you can suppress all the detailed routes included in the aggregate route, only announcing the aggregate route. This helps reduce the routing load on BGP peers.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv6 unicastsonic(config-router-af)# aggregate-address 100::1/64
network
Section titled “network”[Command]
network ip-address { mask-length | mask } [ route-map string ]
no network *ip-address { mask-length | mask } [ route-map string ]
[Purpose]
This command adds the announcement network.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | IP address, the address is in dotted decimal natation |
mask | IP address mask, the address is in dotted decimal natation |
mask-length | Length of the IP address mask |
route-map string | Apply a route-map for an aggregated prefix |
[View]
IP address-family view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# network 1.1.1.0/24
neighbor graceful-restart
Section titled “neighbor graceful-restart”[Command]
neighbor { A.B.C.D | X:X::X:X | String } {graceful-restart|graceful-restart-disable|graceful-restart-helper}
no neighbor { A.B.C.D | X:X::X:X | String } {graceful-restart|graceful-restart-disable|graceful-restart-helper}
[Purpose]
This command will enable BGP graceful restart functionality.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
gracefule-restart | Graceful Restart command for a neighbor |
gracefule-restart-disable | Graceful Restart Disable command for a neighbor |
gracefule-restart-helper | Graceful Restart Helper command for a neighbor |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 graceful-restart
neighbor advertisement-interval
Section titled “neighbor advertisement-interval”[Command]
neighbor { A.B.C.D | X:X::X:X | String } advertisement-interval internal
no neighbor { A.B.C.D | X:X::X:X | String } advertisement-interval internal
[Purpose]
Configure the time interval for a peer to send route prefix update messages
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
internal | The range of value: 0-600, default value is: 0 |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 advertisement-interval 2
neighbor bfd
Section titled “neighbor bfd”[Command]
neighbor { A.B.C.D | X:X::X:X | String } bfd [date-plane]
[Purpose]
Enable BFD functionality for a specific peer
[Parameter]
Parameter | Description |
---|---|
date-plane | Specify that locally generated BFD packets are processed by the hardware |
[View]
BGP configuration view
[Usage Scenario] By default, when BFD functionality is enabled, both the reception and transmission of BFD packets on the device are processed by the CPU. If the device is running multiple network protocols and the CPU is relatively busy, it may lead to inaccurate BFD detection results due to CPU processing delays. Enabling this feature ensures that BFD packets generated locally by the device are processed by the hardware, reducing the performance load on the CPU
[Use Cases]
sonic(config) router bgp 65100sonic(config-router)# neighbor 44.1.3.1 remote-as externalsonic(config-router)# neighbor 44.1.3.1 bfd data-plane
neighbor capability extended-nexthop
Section titled “neighbor capability extended-nexthop”[Command]
neighbor { A.B.C.D | X:X::X:X | String } capability extended-nexthop
no neighbor { A.B.C.D | X:X::X:X | String } capability extended-nexthop
[Purpose]
Allow BGP to negotiate extended next-hop capability with its peers
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
[View]
BGP configuration view
[Notes] Allow bgp to negotiate the extended-nexthop capability with it’s peer. If user is peering over a IPv6 LL address then this capability is turned on automatically. If user is peering over a IPv6 Global Address then turning on this command will allow BGP to install IPv4 routes with IPv6 nexthops if you do not have IPv4 configured on interfaces.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 capability extended-nexthop
neighbor capability dynamic
Section titled “neighbor capability dynamic”[Command]
neighbor { A.B.C.D | X:X::X:X | String } capability dynamic
no neighbor { A.B.C.D | X:X::X:X | String } capability dynamic
[Purpose]
Allow bgp to negotiate the extended-nexthop capability with it’s peer.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
[View]
BGP configuration view
[Notes] Dynamic Capability defines a new BGP message (CAPABILITY) that can be used to set/unset BGP capabilities without bringing down a BGP session. This includes changing graceful-restart (LLGR also) timers, enabling/disabling add-path, and other supported capabilities.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 capability dynamic
neighbor description
Section titled “neighbor description”[Command]
neighbor { A.B.C.D | X:X::X:X | String } description String
no neighbor { A.B.C.D | X:X::X:X | String } description String
[Purpose]
Set description of the peer.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
String | Describing this neighbor |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 description test
neighbor disable-connected-check
Section titled “neighbor disable-connected-check”[Command]
neighbor { A.B.C.D | X:X::X:X | String } disable-connected-check
no neighbor { A.B.C.D | X:X::X:X | String } disable-connected-check
[Purpose]
Allow peerings between directly connected EBGP peers using loopback addresses.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 disable-connected-check
neighbor ebgp-multihop
Section titled “neighbor ebgp-multihop”[Command]
neighbor { A.B.C.D | X:X::X:X | String } ebgp-multihop count
no neighbor { A.B.C.D | X:X::X:X | String } ebgp- multihop count
[Purpose]
Specifying ebgp-multihop allows sessions with eBGP neighbors to establish when they are multiple hops away
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
count | Maximum hop count (1..255) |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 ebgp-multihop 2
neighbor interface
Section titled “neighbor interface”[Command]
neighbor { A.B.C.D | X:X::X:X | String } interface interface_name
no neighbor { A.B.C.D | X:X::X:X | String } interface interface_name
[Purpose]
When you connect to a BGP peer over an IPv6 link-local address, you have to specify the IFNAME of the interface used for the connection.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Interface name or neighbor tag |
interface_name | Interface name |
[View]
BGP configuration view
[Usage Scenario] When you connect to a BGP peer over an IPv6 link-local address, you have to specify the IFNAME of the interface used for the connection. To specify IPv4 session addresses, see the neighbor PEER update-source command below
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 interface Ethernet49
neighbor local-as
Section titled “neighbor local-as”[Command]
neighbor { A.B.C.D | X:X::X:X | String } local-as ASN [no-prepend] [replace-as]
no neighbor { A.B.C.D | X:X::X:X | String } local-as ASN [no-prepend] [replace-as]
[Purpose]
Specify an alternate AS for this BGP process when interacting with the specified peer
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Interface name or neighbor tag |
ASN | AS number |
[View]
BGP configuration view
[Usage Scenario] Specify an alternate AS for this BGP process when interacting with the specified peer. With no modifiers, the specified local-as is prepended to the received AS_PATH when receiving routing updates from the peer, and prepended to the outgoing AS_PATH (after the process local AS) when transmitting local routes to the peer. If the no-prepend attribute is specified, then the supplied local-as is not prepended to the received AS_PATH. If the replace-as attribute is specified, then only the supplied local-as is prepended to the AS_PATH when transmitting local-route updates to this peer.
[Notes] Note that replace-as can only be specified if no-prepend is.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 local-as 123 no-prepend replace-as
neighbor password
Section titled “neighbor password”[Command]
neighbor { A.B.C.D | X:X::X:X | String } password PASSWORD
neighbor { A.B.C.D | X:X::X:X | String } password PASSOWRD
[Purpose]
Set a MD5 password to be used with the tcp socket that is being used to connect to the remote peer
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | IPeer-group name |
PASSWORD | The password |
[View]
BGP configuration view
[Usage Scenario] To enhance the security of BGP connections, MD5 authentication can be used during the establishment of TCP connections. When the passwords at both ends of the BGP neighbors do not match, the BGP neighbor establishment will fail.
[Notes] It is important to note that the key will be displayed in ciphertext, meaning that the password will not be visible in plain text.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 password test1234
neighbor port
Section titled “neighbor port”[Command]
neighbor { A.B.C.D | X:X::X:X | String } port PORT
no neighbor { A.B.C.D | X:X::X:X | String } port PORT
[Purpose]
Specify the L4-port to use for the BGP session to this neighbor
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
PORT | TCP port number (0..65535) |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 port 234
neighbor remote-as
Section titled “neighbor remote-as”[Command]
neighbor { A.B.C.D | X:X::X:X | String } remote-as [ ASN |internal|external]
no neighbor { A.B.C.D | X:X::X:X | String } remote-as [ ASN |internal|external]
[Purpose]
Create a new neighbor whose remote-as is ASN
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
ASN | AS number |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 remote-as 65101sonic(config-router)# neighbor 1.1.1.1 remote-as external
neighbor peer-group
Section titled “neighbor peer-group”[Command]
neighbor peer-group-name peer-group
no neighbor peer-group-name peer-group
[Purpose]
Create a peer group
[View]
BGP configuration view
[Usage Scenario] In large-scale BGP networks, the number of peers can be substantial, and many of these peers share similar policies. Configuring these peers can be repetitive, but using peer groups can simplify the configuration process. When a user wants to apply the same configuration to several peers, they can create a peer group, configure it accordingly, and then add the peers to that group. This way, all peers within the group inherit the group’s configuration.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor PEER_V4_EBGP peer-group
neighbor peer-group
Section titled “neighbor peer-group”[Command]
neighbor { A.B.C.D | X:X::X:X | String } peer-group NAME
no neighbor { A.B.C.D | X:X::X:X | String } peer-group NAME
[Purpose]
This command bind specific peer to peer group
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
NAME | peer-group name |
[View]
BGP configuration view
[Usage Scenario] A peer group is a collection of peers with similar policies or attributes. When a peer joins a peer group, the configuration settings for that peer group apply to all members within the group. In situations where there are a significant number of peers with identical configurations in the network, configuring peer groups can streamline the setup process.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 peer-group PEER_V4_EBGP
neighbor update-source
Section titled “neighbor update-source”[Command]
neighbor { A.B.C.D | X:X::X:X | String } update-source { A.B.C.D | X:X::X:X | String }
no neighbor { A.B.C.D | X:X::X:X | String } update-source { A.B.C.D | X:X::X:X | String }
[Purpose]
Specify the IPv4 source address to use for the BGP session to this neighbor
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
[View]
BGP configuration view
[Usage Scenario] Specify the IPv4 source address to use for the BGP session to this neighbor, may be specified as either an IPv4 address directly or as an interface name.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 update-source Ethernet49
neighbor activate
Section titled “neighbor activate”[Command]
neighbor { A.B.C.D | X:X::X:X | String } activate
no neighbor { A.B.C.D | X:X::X:X | String } activate
[Purpose]
Enable a specific BGP peer
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | IPv4 address |
X:X::X:X | IPv6 address |
[View]
IP Address-family view
[Notes] By default, only the IPv4 unicast address family is announced to all neighbors. Using the no bgp default ipv4-unicast configuration overrides this default so that all address families need to be enabled explicitly
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# network 1.1.1.1 activate
neighbor allowas-in
Section titled “neighbor allowas-in”[Command]
neighbor { A.B.C.D | X:X::X:X | String } allowas-in [ number |origin]
no neighbor { A.B.C.D | X:X::X:X | String } allowas-in [ number |origin]
[Purpose]
This command accepts incoming routes with AS paths that have the same value as the current system’s AS
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Interface name or neighbor tag |
number | Number of occurrences of AS number (1..10) |
[View]
IP address-family view
[Usage Scenario] Normally, BGP determines the presence of loops by checking for the presence of the same AS number in the AS_PATH attribute. This command allows you to configure the maximum number of times the local AS number is allowed to repeat, meeting the requirements of special scenarios。
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# neighbor 1.1.1.1 allowas-in 2
neighbor as-override
Section titled “neighbor as-override”[Command]
neighbor { A.B.C.D | X:X::X:X | String } as-override
no neighbor { A.B.C.D | X:X::X:X | String } as-override
[Purpose]
Override AS number of the originating router with the local AS number
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Interface name or neighbor tag |
[View]
IP address-family view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# neighbor 1.1.1.1 as-override
neighbor attribute-unchanged
Section titled “neighbor attribute-unchanged”[Command]
neighbor { A.B.C.D | X:X::X:X | String }attribute-unchanged [{as-path|next-hop|med}]
no neighbor { A.B.C.D | X:X::X:X | String } attribute-unchanged [{as-path|next-hop|med}]
[Purpose]
Preserve the next hop when advertising routes to a specified EBGP peer
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer group name |
[View]
IP address-family view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# neighbor 1.1.1.1 attribute-unchanged as-path
neighbor default-originate
Section titled “neighbor default-originate”[Command]
neighbor { A.B.C.D | X:X::X:X | String } default-originate [route-map WORD ]
no neighbor { A.B.C.D | X:X::X:X | String } default-originate [route- map WORD ]
[Purpose]
Advertise a default route to a specified peer
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
WORD | Route-map name |
[View]
IP address-family view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# neighbor 1.1.1.1 default-originate route-map test
neighbor next-hop-self
Section titled “neighbor next-hop-self”[Command]
neighbor { A.B.C.D | X:X::X:X | String } next-hop-self [force]
no neighbor { A.B.C.D | X:X::X:X | String } next-hop-self [force]
[Purpose]
When announcing routes to IBGP peers or peer groups, set the next hop attribute to the local IP address
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Interface name or neighbor tag |
Force | If the optional keyword force is specified, the modification is done also for routes learned via IBGP |
[View]
IP address-family view
[Usage Scenario] By default, when a device learns routes from its EBGP neighbors and forwards them to its IBGP neighbors, it does not modify the next-hop IP address of the routes. As a result, the next hop of the route remains the Neighbor address of the EBGP neighbor. When IBGP neighbors receive these routes, they become unusable because the next hop is unreachable. To avoid this situation, you can resolve it by configuring the “next-hop-self” command.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# neighbor 1.1.1.1 next-hop-self force
neighbor prefix-list
Section titled “neighbor prefix-list”[Command]
neighbor { A.B.C.D | X:X::X:X | String } prefix-list NAME [in|out]
no neighbor { A.B.C.D | X:X::X:X | String } prefix-list NAME [in|out]
[Purpose]
Apply a prefix-list on the neighbor
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Interface name or neighbor tag |
NAME | prefix-list name |
[View]
IP address-family view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# neighbor 1.1.1.1 prefix-list test in
neighbor route-reflector-client
Section titled “neighbor route-reflector-client”[Command]
neighbor { A.B.C.D | X:X::X:X | String } route-reflector-client
no neighbor { A.B.C.D | X:X::X:X | String } route-reflector-client
[Purpose]
Configure the current device as a route reflector when establishing a BGP connection with the specified neighbor
[View]
IP address-family view
[Usage Scenario] To ensure connectivity between IBGP peers, it’s necessary to establish full mesh connections between IBGP peers. However, when there are many IBGP peers, this consumes significant network and CPU resources. Utilizing route reflectors can address this issue by allowing BGP routers to establish connections only with a few route reflectors instead of all other routers.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# neighbor 1.1.1.1 route-reflector-client
neighbor route-map
Section titled “neighbor route-map”[Command]
neighbor { A.B.C.D|X:X::X:X | String } route-map NAME [in|out]
no neighbor { A.B.C.D | X:X::X:X | String } route-map NAME [in|out]
[Purpose]
Apply a route-map on the neighbor
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
NAME | route-map name |
[View]
IP address-family view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# neighbor 1.1.1.1 route-map test in
neighbor send-community
Section titled “neighbor send-community”[Command]
neighbor { A.B.C.D | X:X::X:X | String } send-community [both|all|extended|standard|large]
no neighbor { A.B.C.D | X:X::X:X | String } send- community [both|all|extended|standard|large]
[Purpose]
Set the route’community for the neighbor.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Peer-group name |
both | Send both standard and extended community attributes |
all | Send both standard, extended and large community attributes |
extended | Send extended community attributes |
standard | Send standard community attributes |
large | Send large community attributes |
[View]
IP address-family view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# neighbor 1.1.1.1 send-community extended
neighbor shutdown
Section titled “neighbor shutdown”[Command]
neighbor { A.B.C.D | X:X::X:X | String } shutdown [[message MSG ] |[rtt rtt [count count ]]]
no neighbor { A.B.C.D | X:X::X:X | String } shutdown [[message MSG ] ||[rtt rtt [count count ]]]
[Purpose]
Shutdown the peer.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Interface name or neighbor tag |
MSG | Shutdown message |
rtt | Round-trip-time in milliseconds (1..65535) |
count | Specify the number of keepalives before shutdown |
[View]
BGP configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 shutdown message testing
neighbor ttl-security hops
Section titled “neighbor ttl-security hops”[Command]
neighbor { A.B.C.D | X:X::X:X | String } ttl-security hops NUMBER
no neighbor { A.B.C.D | X:X::X:X | String } ttl-security hops NUMBER
[Purpose]
This command enforces Generalized TTL Security Mechanism (GTSM), as specified in RFC 5082.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Interface name or neighbor tag |
NUMBER | Number of hops to BGP peer (1..254) |
[View]
BGP configuration view
[Notes] With this command, only neighbors that are the specified number of hops away will be allowed to become neighbors. This command is mutually exclusive with ebgp-multihop.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor 1.1.1.1 ttl-security hops 2
neighbor weight
Section titled “neighbor weight”[Command]
neighbor { A.B.C.D | X:X::X:X | String } weight WEIGHT
no neighbor { A.B.C.D | X:X::X:X | String } weight WEIGHT
[Purpose]
This command specifies a default weight value for the neighbor’s routes.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Neighbor address |
X:X::X:X | Neighbor IPv6 address |
String | Interface name or neighbor tag |
WEIGHT | Weight (0..65535) |
[View]
IP address-family view
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# address-family ipv4 unicastsonic(config-router-af)# neighbor 1.1.1.1 weight 2
neighbor interface
Section titled “neighbor interface”[Command]
neighbor { ethernet | link-aggregation | vlan } ID interface
no neighbor { ethernet | link-aggregation | vlan } ID interface
[Purpose]
Establish BGP connections using the interface’s IPv6 link-local address.
[Parameter]
Parameter | Description |
---|---|
ID | interface id/link-aggregation id/ vlan id |
[View]
BGP config view、IP address-family view
[Notes]
To use this command, first enable ipv6 use-link-local
on the relevant interface. Configuring a BGP peer this way is equivalent to using the neighbor [ip-address]
command and supports all the same command-line options.
[Use Cases]
sonic# configure terminalsonic(config)# router bgp 65100sonic(config-router)# neighbor ethernet 1 interface remote-as 200sonic(config-router-af)# address-family ipv4 unicastsonic(config-router-af)# neighbor ethernet 1 activate
OSPFv2 Configuration
Section titled “OSPFv2 Configuration”show ip ospf
Section titled “show ip ospf”[Command]
show ip ospf [vrf NAME |all] [json]
[Purpose]
Display OSPF details
[View]
System view
[Use Cases]
sonic# show ip ospf vrf all json{ "ospfInstance":2, "1":{ "vrfName":"1", "vrfId":138, "routerId":"2.2.2.1", "tosRoutesOnly":true, "rfc2328Conform":true, "spfScheduleDelayMsecs":0, "holdtimeMinMsecs":50, "holdtimeMaxMsecs":5000, "holdtimeMultplier":1, "spfLastExecutedMsecs":167987, "spfLastDurationMsecs":0, "lsaMinIntervalMsecs":5000, "lsaMinArrivalMsecs":1000, "writeMultiplier":20, "refreshTimerMsecs":10000, "lsaExternalCounter":0, "lsaExternalChecksum":0, "lsaAsopaqueCounter":0, "lsaAsOpaqueChecksum":0, "attachedAreaCounter":1, "areas":{ "3.1.1.1":{ "shortcuttingMode":"Default", "areaIfTotalCounter":1, "areaIfActiveCounter":1, "nbrFullAdjacentCounter":1, "authentication":"authenticationNone", "virtualAdjacenciesPassingCounter":0, "spfExecutedCounter":8, "lsaNumber":3, "lsaRouterNumber":2, "lsaRouterChecksum":74376, "lsaNetworkNumber":1, "lsaNetworkChecksum":45432, "lsaSummaryNumber":0, "lsaSummaryChecksum":0, "lsaAsbrNumber":0, "lsaAsbrChecksum":0, "lsaNssaNumber":0, "lsaNssaChecksum":0, "lsaOpaqueLinkNumber":0, "lsaOpaqueLinkChecksum":0, "lsaOpaqueAreaNumber":0, "lsaOpaqueAreaChecksum":0 } } }
show ip ospf interface
Section titled “show ip ospf interface”[Command]
show ip ospf [vrf NAME |all] interface[ethernet interface_name |vlan vlan_id |link-aggregation lag_id ]
[Purpose]
Show state and configuration of OSPF the specified interface, or all interfaces if no interface is given.
[Parameter]
Parameter | Description |
---|---|
interface_name | Ethernet interface name (0..54) |
vlan_id | VLAN id (1..4094) |
lag_id | Link-aggregation interface number |
[View]
System view
[Use Cases]
sonic# show ip ospf vrf 1 interface vlan 20OSPF Instance: 2VRF Name: 1Vlan20 is up ifindex 113, MTU 9216 bytes, BW 10 Mbit <UP,BROADCAST,RUNNING,ALLMULTI,MULTICAST> Internet Address 20.1.1.1/24, Broadcast 20.1.1.255, Area 3.1.1.1 MTU mismatch detection: enabled Router ID 2.2.2.1, Network Type BROADCAST, Cost: 10000 Transmit Delay is 1 sec, State Backup, Priority 1 Designated Router (ID) 2.2.2.2 Interface Address 20.1.1.2/24 Backup Designated Router (ID) 2.2.2.1, Interface Address 20.1.1.1 Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5 Hello due in 3.869s Neighbor Count is 1, Adjacent neighbor count is 1
show ip ospf neighbor
Section titled “show ip ospf neighbor”[Command]
show ip ospf [vrf NAME |all] neighbor [ethernet interface_name |vlan vlan_id |link-aggregation lag_id | A.B.C.D ][detail][all][json]
[Purpose]
Display lsa information of LSDB. Json o/p of this command covers base route information i.e all LSAs except opaque lsa info
[Parameter]
Parameter | Description |
---|---|
interface_name | Ethernet interface name (0..54) |
vlan_id | VLAN id (1..4094) |
lag_id | Link-aggregation interface number |
A.B.C.D | IP address |
[View]
System view
[Use Cases]
sonic# show ip ospf vrf all neighborOSPF Instance: 2VRF Name: 1Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL2.2.2.2 1 Full/DR 14m07s 32.466s 20.1.1.2 Vlan20:20.1.1.1 0 0 0
show ip ospf database {max-age|self-originate}
Section titled “show ip ospf database {max-age|self-originate}”[Command]
show ip ospf [vrf { NAME |all| instance }] database max-age {max- age|self-originate}
[Purpose]
Show the OSPF database summary.
[Parameter]
Parameter | Description |
---|---|
NAME | VRF name |
instance | Instance ID (1..65535) |
[View]
System view
[Use Cases]
sonic# show ip ospf vrf all database max-age
show ip ospf database {opaque-link|opaque-area|opaque-external}
Section titled “show ip ospf database {opaque-link|opaque-area|opaque-external}”[Command]
show ip ospf [vrf { NAME |all| instance }] database{ opaque-link|opaque-area|opaque-external} [ A.B.C.D ][adv-router A.B.C.D ][self-originate]
[Purpose]
Show opaque LSA from the database.
[Parameter]
Parameter | Description |
---|---|
NAME | VRF name |
instance | Instance ID (1..65535) |
A.B.C.D | IP address |
[View]
System view
[Use Cases]
sonic# show ip ospf database opaque-link
show ip ospf route
Section titled “show ip ospf route”[Command]
show ip ospf [vrf NAME |all] route [json]
[Purpose]
Show the OSPF routing table, as determined by the most recent SPF calculation..
[View]
System view
[Use Cases]
sonic# show ip ospf vrf all routeOSPF Instance: 2VRF Name: 1============ OSPF network routing table ============N 20.1.1.0/24 [10000] area: 3.1.1.1 directly attached to Vlan20============ OSPF router routing table ========================= OSPF external routing table ===========
show ip ospf router-info
Section titled “show ip ospf router-info”[Command]
show ip ospf router-info [pce]
[Purpose]
Show router capabilities flag
[View]
System view
[Use Cases]
sonic# show ip ospf router-info pce
router ospf
Section titled “router ospf”[Command]
router ospf [instance id ] [vrf NAME ]
no router ospf [instance id ]
[Purpose]
Enable or disable the OSPF process
[Parameter]
Parameter | Description |
---|---|
NAME | VRF name |
instance id | OSPF instance id, the range of value: 1-65535 |
[Usage Scenario] OSPF supports multiple instances, allowing a single router to run several independent OSPF instances that do not interfere with one another. These instances operate independently, and route exchanges between different OSPF instances are analogous to route exchanges between different routing protocols. Each router interface can belong to only one OSPF process.
[Notes] OSPF supports up to 10 instances on a single router.
[View]
System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)#
ospf router-id
Section titled “ospf router-id”[Command]
ospf router-id A.B.C.D
no ospf router-id A.B.C.D
[Purpose]
This sets the router-ID of the OSPF process.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | OSPF router-id in IP address format |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# ospf router-id 1.1.1.1
ospf rfc1583 compatibility
Section titled “ospf rfc1583 compatibility”[Command]
ospf rfc1583compatibility
no ospf rfc1583compatibility
[Purpose]
RFC 2328, the successor to RFC 1583, suggests according to section G.2 (changes) in section 16.4 a change to the path preference algorithm that prevents possible routing loops that were possible in the old version of OSPFv2. More specifically it demands that inter-area paths and intra-area backbone path are now of equal preference but still both preferred to external paths.
[View]
OSPF view
[Notes] This command disables OPSF rfc1583compatibility.
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# ospf rfc1583compatibility
network area
Section titled “network area”[Command]
network A.B.C.D/M area { A.B.C.D | area_id }
no network A.B.C.D/M area { A.B.C.D | area_id }
[Purpose]
This command specifies the OSPF enabled interface(s).
[Parameter]
Parameter | Description |
---|---|
A.B.C.D/M | network address |
A.B.C.D | OSPF router-id |
area_id | area_id |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# network 1.1.1.1/24 area 11
area range A.B.C.D/M
Section titled “area range A.B.C.D/M”[Command]
area { A.B.C.D | area_id } range A.B.C.D/M [advertise [cost metric ]]
no area { A.B.C.D | area_id } range A.B.C.D/M [advertise [cost metric ]]
[Purpose]
Summarize intra area paths from specified area into one Type-3 summary-LSA announced to other areas.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D/M | network address |
A.B.C.D | ospf router-id |
area_id | AREA ID |
metric | advertised metric for this range (0..16777215) |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# area 1.1.1.1 range 1.1.1.1/32 advertise cost 100
area range
Section titled “area range”[Command]
area { A.B.C.D | area_id } range A.B.C.D/M {substitute A.B.C.D/M |cost metric }
no area { A.B.C.D | area_id } range A.B.C.D/M {substitute A.B.C.D/M |cost metric }
[Purpose]
Substitute summarized prefix with another prefix
[Parameter]
Parameter | Description |
---|---|
A.B.C.D/M | network address |
area_id | AREA ID |
metric | advertised metric for this range (0..16777215) |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# area 1.1.1.1 range 1.1.1.1/32 advertise cost 100
[Command]
area { A.B.C.D | area_id } {stub|nssa} [no-summary]
no area { A.B.C.D | area_id } {stub|nssa} [no-summary]
[Purpose]
Prevents an OSPF ABR from injecting inter-area summaries into the specified stub area
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | OSPF router-id |
area_id | area_id |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# area 1.1.1.1 stub no-summary
ip ospf area
Section titled “ip ospf area”[Command]
ip ospf area [instance ID ] { A.B.C.D | area_id } [ A.B.C.D ]
no ip ospf area [instance ID ] { A.B.C.D | area_id } [ A.B.C.D ]
[Purpose]
Enable OSPF on the interface, optionally restricted to just the IP address given by ADDR, putting it in the AREA area.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | OSPF router-id |
area_id | area_id |
A.B.C.D | Address of interface |
instance ID | OSPF instance ID |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf area 1.1.1.1 2.2.2.2
ip ospf authentication-key
Section titled “ip ospf authentication-key”[Command]
ip ospf authentication-key KEY [ A.B.C.D ]
no ip ospf authentication-key KEY [ A.B.C.D ]
[Purpose]
Set OSPF authentication key to a simple password. After setting AUTH_KEY, all OSPF packets are authenticated. AUTH_KEY has length up to 8 chars.
[Parameter]
Parameter | Description |
---|---|
KEY | The OSPF password (key) |
A.B.C.D | Address of interface |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf authentication-key test123 1.1.1.1
ip ospf authentication
Section titled “ip ospf authentication”[Command]
ip ospf authentication [message-digest] [ A.B.C.D ]
no ip ospf authentication [message-digest] [ A.B.C.D ]
[Purpose]
Specify that MD5 HMAC authentication must be used on this interface
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | Address of interface |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf authentication message-digest 1.1.1.1
ip ospf message-digest-key
Section titled “ip ospf message-digest-key”[Command]
ip ospf message-digest-key KEY_ID md5 MD5 [ A.B.C.D ]
no ip ospf message-digest-key KEY_ID md5 MD5 [ A.B.C.D ]
[Purpose]
Set OSPF authentication key to a cryptographic password. The cryptographic algorithm is MD5.
[Parameter]
Parameter | Description |
---|---|
KEY_ID | Key ID (1..255) |
MD5 | Use MD5 algorithm |
A.B.C.D | Address of interface |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf message-digest-key 2 md5 s 1.1.1.1
ip ospf cost
Section titled “ip ospf cost”[Command]
ip ospf cost COST [ A.B.C.D ]
no ip ospf cost COST [ A.B.C.D ]
[Purpose]
Set link cost for the specified interface.
[Parameter]
Parameter | Description |
---|---|
COST | Cost (1..65535) |
A.B.C.D | Address of interface |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf cost 12
ip ospf dead-interval
Section titled “ip ospf dead-interval”[Command]
ip ospf dead-interval { interval |minimal hello-multiplier number } [ A.B.C.D ]
no ip ospf dead-interval { interval |minimal hello-multiplier number } [ A.B.C.D ]
[Purpose]
Set interface’s router dead interval. Default value is 40.
[Parameter]
Parameter | Description |
---|---|
interval | Seconds (1..65535) |
number | Number of Hellos to send each second (1..10) |
A.B.C.D | Address of interface |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf dead-interval 2 1.1.1.1
ip ospf hello-interval
Section titled “ip ospf hello-interval”[Command]
ip ospf hello-interval interval [A.B.C.D ]
no ip ospf hello-interval interval [ A.B.C.D ]
[Purpose]
Set interface’s hello interval. Default 10.
[Parameter]
Parameter | Description |
---|---|
Interval | Seconds (1..65535) |
A.B.C.D | Address of interface |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf hello-interval 2 1.1.1.1
ip ospf network
Section titled “ip ospf network”[Command]
ip ospf network {broadcast|non-broadcast|point-to-multipoint|point-to-point}
no ip ospf network {broadcast|non-broadcast|point-to- multipoint|point-to-point}
[Purpose]
Set explicitly network type for specified interface.
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf network broadcast
ip ospf priority
Section titled “ip ospf priority”[Command]
ip ospf priority priority [A.B.C.D ]
no ip ospf priority priority [ A.B.C.D ]
[Purpose]
Set router priority integer value.
[Parameter]
Parameter | Description |
---|---|
priority | Priority (0..255) |
A.B.C.D | Address of interface |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf priority 12
ip ospf retransmit-interval
Section titled “ip ospf retransmit-interval”[Command]
ip ospf retransmit-interval interval [ A.B.C.D ]
no ip ospf retransmit-interval interval [ A.B.C.D ]
[Purpose]
Set number of seconds for RxmtInterval timer value
[Parameter]
Parameter | Description |
---|---|
interval | Seconds (1..65535) |
A.B.C.D | Address of interface |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf retransmit-interval 2
ip ospf transmit-delay
Section titled “ip ospf transmit-delay”[Command]
ip ospf transmit-delay interval [ A.B.C.D ]
no ip ospf transmit-delay interval [ A.B.C.D ]
[Purpose]
Set number of seconds for InfTransDelay value.
[Parameter]
Parameter | Description |
---|---|
interval | Seconds (1..65535) |
A.B.C.D | Address of interface |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf retransmit-interval 2
ip ospf mtu-ignore
Section titled “ip ospf mtu-ignore”[Command]
ip ospf mtu-ignore
no ip ospf mtu-ignore
[Purpose]
Ignore MTU when establish OSPF
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf mtu-ignore
redistribute
Section titled “redistribute”[Command]
redistribute {babel|bgp|connected|eigrp|isis|kernel|openfabric|ospf|rip|sharp|static|table} [metric-type metric_type ] [metric metric ] [route-map route_map ]
no redistribute {babel|bgp|connected|eigrp|isis|kernel|openfabric|ospf|rip|sharp|static|table} [metric-type metric_type ] [metric metric ] [route-map route_map ]
[Purpose]
Redistribute routes of the specified protocol or kind into OSPF, with the metric type and metric set if specified, filtering the routes using the given route-map if specified.
[Parameter]
Parameter | Description |
---|---|
metric_type | Set OSPF External Type 1/2 metrics (1..2) |
metric | OSPF default metric (0..16777214) |
route_map | Pointer to route-map entries |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# redistribute static metric-type 1 metric 2 route-map test
default-information originate
Section titled “default-information originate”[Command]
default-information originate [always] [metric-type metric_type ][metric metric ] [route-map route_map ]
no default-information originate [always] [metric-type metric_type ][metric metric ] [route-map route_map ]
[Purpose]
Originate an AS-External (type-5) LSA describing a default route into all external-routing capable areas, of the specified metric and metric type. If the ‘always’ keyword is given then the default is always advertised, even when there is no default present in the routing table.
[Parameter]
Parameter | Description |
---|---|
metric_type | Set OSPF External Type 1/2 metrics (1..2) |
metric | OSPF default metric (0..16777214) |
route_map | Pointer to route-map entries |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# default-information originate always
distribute-list
Section titled “distribute-list”[Command]
distribute-list String out {babel|bgp|connected|eigrp|isis|kernel|openfabric|ospf|rip|sharp|static|table}
no distribute-list String out{ babel|bgp|connected|eigrp|isis|kernel|openfabric|ospf|rip|sharp|static|table}
[Purpose]
Apply the access-list filter, NAME, to redistributed routes of the given type before allowing the routes to be redistributed into OSPF
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# distribute-list test out static
default-metric
Section titled “default-metric”[Command]
default-metric metric
no default-metric metric
[Purpose]
Set default metric
[Parameter]
Parameter | Description |
---|---|
metric | OSPF default metric (0..16777214) |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# default-metric 2
distance
Section titled “distance”[Command]
distance [ospf {intra-area|inter-area|external}] distance
no distance [ospf {intra-area|inter-area|external}] distance
[Purpose]
Set OSPF distance
[Parameter]
Parameter | Description |
---|---|
distance | Distance for external routes (1..255) |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# distance ospf external 2
OSPFv3 Configuration
Section titled “OSPFv3 Configuration”show ipv6 ospf6
Section titled “show ipv6 ospf6”[Command]
show ipv6 ospf6
[Purpose]
Display OSPFv3 details
[View]
System view
[Use Cases]
sonic# show ipv6 ospf6
show ipv6 ospf6 database
Section titled “show ipv6 ospf6 database”[Command]
show ipv6 ospf6 database [detail|dump|internal]
show ipv6 ospf6 database [router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix][detail|dump|internal]
[Purpose]
This command shows LSAs present in the LSDB.
[View]
System view
[Use Cases]
sonic# show ipv6 ospf6 database detail
show ipv6 ospf6 database adv-router
Section titled “show ipv6 ospf6 database adv-router”[Command]
show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D
[Purpose]
The LSAs additinally can also be filtered with the linkstate-id and advertising-router fields
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | IP address |
[View]
System view
[Use Cases]
sonic# show ipv6 ospf6 database network adv-router 1.1.1.1 linkstate-id 1.1.1.1
show ipv6 ospf6 database self-originated
Section titled “show ipv6 ospf6 database self-originated”[Command]
show ipv6 ospf6 database self-originated
[Purpose]
This command is used to filter the LSAs which are originated by the present router.
[View]
System view
[Use Cases]
sonic# show ipv6 ospf6 database self-originated
show ipv6 ospf6 interface
Section titled “show ipv6 ospf6 interface”[Command]
show ipv6 ospf6 interface [ethernet interface_name |vlan vlan_id |link- aggregation lag_id ]
[Purpose]
To see OSPF interface configuration like costs.
[Parameter]
Parameter | Description |
---|---|
interface_name | Ethernet interface name (0..54) |
vlan_id | VLAN id (1..4094) |
lag_id | Link-aggregation interface number |
[View]
System view
[Use Cases]
sonic# show ipv6 ospf6 interface ethernet 1
show ipv6 ospf6 neighbor
Section titled “show ipv6 ospf6 neighbor”[Command]
show ipv6 ospf6 neighbor
[Purpose]
Show state and chosen (backup) DR of neighbor.
[View]
System view
[Use Cases]
sonic# show ipv6 ospf6 neighbor
show ipv6 ospf6 interface traffic
Section titled “show ipv6 ospf6 interface traffic”[Command]
show ipv6 ospf6 interface traffic
[Purpose]
Show counts of different packets that have been received and transmitted by the interfaces
[View]
System view
[Use Cases]
sonic# show ipv6 ospf6 interface traffic
show ipv6 route ospf6
Section titled “show ipv6 route ospf6”[Command]
show ipv6 route ospf6
[Purpose]
This command shows internal routing table
[View]
System view
[Use Cases]
sonic# show ipv6 route ospf6
show ipv6 ospf6 redistribute
Section titled “show ipv6 ospf6 redistribute”[Command]
show ipv6 ospf6 redistribute
[Purpose]
Show the routes which are redistributed by the router.
[View]
System view
[Use Cases]
sonic# show ipv6 ospf6 redistribute
show ipv6 ospf6 route
Section titled “show ipv6 ospf6 route”[Command]
show ipv6 ospf6 route X:X::X:X/M match [detail]
[Purpose]
The additional match option will match the given address to the destination of the routes, and return the result accordingly.
[View]
System view
[Use Cases]
sonic# show ipv6 ospf6 route 1::1/64 match detail
show ipv6 ospf6 interface prefix
Section titled “show ipv6 ospf6 interface prefix”[Command]
show ipv6 ospf6 interface [ethernet interface_name |vlan vlan_id |link- aggregation lag_id ] prefix [detail|X:X::X:X | X:X::X:X/M [match|detail]]
[Purpose]
This command shows the prefixes present in the interface routing table. Interface name can also be given.
[Parameter]
Parameter | Description |
---|---|
interface_name | Ethernet interface name (0..54) |
vlan_id | VLAN id (1..4094) |
lag_id | Link-aggregation interface number |
[View]
System view
[Use Cases]
sonic# show ipv6 ospf6 interface ethernet 1 prefix 1::1/64 match
ospf6 router-id
Section titled “ospf6 router-id”[Command]
ospf6 router-id A.B.C.D
[Purpose]
This sets the router-ID of the OSPF6 process..
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | OSPF6 router-id in IP address format |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospf6sonic(config-router)# ospf6 router-id 1.1.1.1
timers throttle spf
Section titled “timers throttle spf”[Command]
timers throttle spf delay_time init_hold_time max_hold_time
no timers throttle spf delay_time init_hold_time max_hold_time
[Purpose]
This command sets the initial delay, the initial-holdtime and the maximum-holdtime.
[Parameter]
Parameter | Description |
---|---|
delay_time | time (msec) (0..600000)) |
init_hold_time | inital time (msec) (0..600000)) |
max_hold_time | maxtime (msec) (0..600000)) |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospf6sonic(config-router)# timers throttle spf 1 2 3
auto-cost reference-bandwidth
Section titled “auto-cost reference-bandwidth”[Command]
auto-cost reference-bandwidth bandwidth
no auto-cost reference-bandwidth bandwidth
[Purpose]
This command configures the auto-cost reference broadband for OSPFv3.
[Parameter]
Parameter | Description |
---|---|
bandwidth | The reference bandwidth in terms of Mbits per second (1..4294967) |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospf6sonic(config-router)# auto-cost reference-bandwidth 2
[Command]
area { A.B.C.D | area_id } range X:X::X:X/M [advertise| not-advertise |cost metric ]
no area { A.B.C.D | area_id } range X:X::X:X/M [advertise| not-advertise |cost metric ]
[Purpose]
Summarize a group of internal subnets into a single Inter-Area-Prefix LSA. This command can only be used at the area boundary (ABR router)
[Parameter]
Parameter | Description |
---|---|
X:X::X:X/M | IPv6 prefix |
A.B.C.D | OSPF router-id |
metric | advertised metric for this range (0..16777215) |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospf6sonic(config-router)# area 1.1.1.1 range 1::1/64 advertise
ipv6 ospf6 cost
Section titled “ipv6 ospf6 cost”[Command]
ipv6 ospf6 cost COST
no ipv6 ospf6 cost COST
[Purpose]
Set link cost for the specified interface.
[Parameter]
Parameter | Description |
---|---|
COST | Cost (1..65535) |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ipv6 ospf6 cost 12
ipv6 ospf6 hello-interval
Section titled “ipv6 ospf6 hello-interval”[Command]
ipv6 ospf6 hello-interval interval [ A.B.C.D ]
no ipv6 ospf6 hello-interval interval [ A.B.C.D ]
[Purpose]
Sets interface’s hello interval. Default value is 10
[Parameter]
Parameter | Description |
---|---|
interval | Seconds (1..65535) |
A.B.C.D | Address of interface |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ip ospf hello-interval 2 1.1.1.1
ipv6 ospf6 dead-interval
Section titled “ipv6 ospf6 dead-interval”[Command]
ipv6 ospf6 dead-interval interval
no ipv6 ospf6 dead-interval interval
[Purpose]
Set interface’s router dead Interval. Default value is 40.
[Parameter]
Parameter | Description |
---|---|
interval | Seconds (1..65535) |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ipv6 ospf6 dead-interval 2
ipv6 ospf6 transmit-delay
Section titled “ipv6 ospf6 transmit-delay”[Command]
ipv6 ospf6 transmit-delay interval
no ipv6 ospf6 transmit-delay interval
[Purpose]
Set number of seconds for infTransDelay value.
[Parameter]
Parameter | Description |
---|---|
interval | Seconds (1..65535) |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ipv6 ospf6 retransmit-interval 2
ipv6 ospf6 priority
Section titled “ipv6 ospf6 priority”[Command]
ipv6 ospf6 priority priority
no ipv6 ospf6 priority priority
[Purpose]
Set router priority integer value.
[Parameter]
Parameter | Description |
---|---|
priority | Priority (0..255) |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ipv6 ospf6 priority 12
ipv6 ospf6 retransmit-interval
Section titled “ipv6 ospf6 retransmit-interval”[Command]
ipv6 ospf6 retransmit-interval interval
no ipv6 ospf6 retransmit-interval interval
[Purpose]
Set number of seconds for rxmtInterval timer value
[Parameter]
Parameter | Description |
---|---|
interval | Seconds (1..65535) |
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ipv6 ospf6 retransmit-interval 2
ipv6 ospf6 network {broadcast|point-to-point}
Section titled “ipv6 ospf6 network {broadcast|point-to-point}”[Command]
ipv6 ospf6 network {broadcast|point-to-point}
no ipv6 ospf6 network {broadcast|point-to-point}
[Purpose]
Set explicitly network type for specified interface
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ipv6 ospf6 network broadcast
ipv6 ospf6 mtu-ignore
Section titled “ipv6 ospf6 mtu-ignore”[Command]
ipv6 ospf6 mtu-ignore
no ipv6 ospf6 mtu-ignore
[Purpose]
Ignore MTU when establish OSPFv3.
[View]
Interface view
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 49sonic(config-if-49)# ipv6 ospf6 mtu-ignore
redistribute
Section titled “redistribute”[Command]
redistribute {babel|bgp|connected|eigrp|isis|kernel|openfabric|ospf|rip|sharp|static|table} [route-map route_map ]
no redistribute {babel|bgp|connected|eigrp|isis|kernel|openfabric|ospf|rip|sharp|static|table} [route-map route_map ]
[Purpose]
Redistribute routes of the specified protocol or kind into OSPFv3, with the metric type and metric set if specified, filtering the routes using the given route-map if specified.
[Parameter]
Parameter | Description |
---|---|
route_map | Pointer to route-map entries |
[View]
OSPF view
[Use Cases]
sonic# configure terminalsonic(config)# router ospf6sonic(config-router)# redistribute static route-map test
Route Map
Section titled “Route Map”show route-map
Section titled “show route-map”[Command]
show route-map WORD
[Purpose]
Display data about each daemons knowledge of individual route-maps
[Parameter]
Parameter | Description |
---|---|
WORD | route-map name |
[View]
System view
[Use Cases]
sonic# show route-map
clear route-map counters
Section titled “clear route-map counters”[Command]
clear route-map counters WORD
[Purpose]
Clear counters that are being stored about the route-map utilization so that subsuquent show commands will indicate since the last clear
[Parameter]
Parameter | Description |
---|---|
WORD | route-map name |
[View]
System view
[Use Cases]
sonic# clear route-map counters
show ip prefix-list
Section titled “show ip prefix-list”[Command]
show ip prefix-list {detail|summary| NAME }
[Purpose]
Display the IP prefix list
[View]
System view
[Use Cases]
sonic# show ip prefix-list summaryPrefix-list with the last deletion/insertion: testZEBRA: ip prefix-list test: count: 1, range entries: 0, sequences: 1 - 1Prefix-list with the last deletion/insertion: testOSPF: ip prefix-list test: count: 1, range entries: 0, sequences: 1 - 1Prefix-list with the last deletion/insertion: testBGP: ip prefix-list test: count: 1, range entries: 0, sequences: 1 - 1Prefix-list with the last deletion/insertion: testISIS: ip prefix-list test: count: 1, range entries: 0, sequences: 1 - 1
bgp as-path access-list
Section titled “bgp as-path access-list”[Command]
bgp as-path access-list WORD {permit|deny} LINE
no bgp as-path access-list WORD {permit|deny} LINE
[Purpose]
Configure route filtering policies based on AS path lists
[Parameter]
Parameter | Description |
---|---|
WORD | Access-list name |
LINE | Regular-expression (1234567890_^|[, {}() ]$*+.?-\) to match the BGP AS paths |
[View]
System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# bgp as-path access-list s permit 66
bgp large-community-list
Section titled “bgp large-community-list”[Command]
bgp large-community-list {standard|expanded} NAME {permit|deny} LARGE-COMMUNITY
no bgp large-community-list {standard|expanded} NAME {permit|deny} LARGE-COMMUNITY
[Purpose]
This command defines a new standard large-community-list
[Parameter]
Parameter | Description |
---|---|
Standard | Standard community list |
Expanded | Expanded community list |
NAME | Community list name |
LARGE-COMMUNITY | large community in ‘aa:bb:cc’ format |
[View]
System configuration view
[Notes] When filtering BGP large community attributes, you can configure multiple filter criteria within the same entry. The relationship between filter criteria is “AND,” which means all filter criteria must be matched for the rule to be considered a match. For example, with the command “bgp large-community-list standard test 10 permit 100:1:1 200:1:1 300:1:1,” the rule will be considered a match only when all three large community values (100:1:1, 200:1:1, and 300:1:1) are simultaneously present. Within a single list, multiple rules have an “OR” relationship. For example, with the commands “bgp large-community-list standard test 10 permit 100:1:1” and “bgp large-community-list standard test 20 permit 200:1:1,” when searching for rules within the “test” group, matching either 100:1:1 or 200:1:1 will be considered a match.
[Use Cases]
sonic# configure terminalsonic(config)# bgp large-community-list standard as permit aa:bb:cc
route-map
Section titled “route-map”[Command]
route-map WORD {permit|deny} ORDER
no route-map WORD {permit|deny} ORDER
[Purpose]
Configure the order’th entry in route-map-name with Match Policy of either permit or deny
[Parameter]
Parameter | Description |
---|---|
WORD | route-map name |
ORDER | Sequence to insert to/delete from existing route-map entry (1..65535) |
[Notes] This command unconfigures the order entry in the routing table name.
[View]
System configuration view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233
ip prefix
Section titled “ip prefix”[Command]
ip prefix NAME
no ip prefix NAME [seq number ] {permit|deny} {any| A.B.C.D/M {ge|le} length }
[Purpose]
Configures an IP prefix list or one entry in the IP prefix list
[Parameter]
Parameter | Description |
---|---|
NAME | Specifies the name of an IP prefix list |
number | Specifies the sequence number of the entry in the IP prefix list. The value is an integer ranging from 1 to 4294967295, By default, the sequence number increases with a step of 5 according to the configuration order, and the first number is 1 |
permit | Specifies the matching mode of the IP prefix list as permit. In permit mode, if the IP address to be filtered is in the defined prefix range, the IP address matches the route-policy and no longer matches against the next entry. Otherwise, the IP address continues to match against the next entry |
deny | Specifies the matching mode of the IP prefix list as deny. In deny mode, if the IP address to be filtered is in the defined prefix range, the IP address fails to match the route-policy and cannot match against the next entry. Otherwise, the IP address continues to match against the next entry |
any | All IP address |
A.B.C.D/ | Specifies the IP address |
ge length | Specifies the minimum value of the mask length range |
le length | Specifies the maximum value of the mask length range |
[Notes] An IP prefix list can be used as a filter or as filtering conditions of a route-map The matching principle of table entries in the address prefix list is: match according to the ordinal ID from smallest to largest, and no other table entries will be matched after the filtered route hits a certain table entry, and the route that cannot match any table entry is deemed to have failed the filter and will not enter any subsequent processing
[View]
System config view
[Use Cases]
sonic(config)# ip prefix-list test permit 1.1.1.0/24 ge 32
match {ip|ipv6} address
Section titled “match {ip|ipv6} address”[Command]
match {ip|ipv6} address {prefix-len LENGTH |prefix-list PREFIX-LIST-NAME }
no match {ip|ipv6} address {prefix-len LENGTH |prefix-list PREFIX-LIST-NAME }
[Purpose]
Matches the specified prefix-list
[Parameter]
Parameter | Description |
---|---|
LENGTH | Match prefix length of IP address |
PREFIX-LIST-NAME | Match entries of prefix-lists |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match ip address prefix-list test
match {ip|ipv6} next-hop
Section titled “match {ip|ipv6} next-hop”[Command]
match {ip|ipv6} next-hop {prefix-len LENGTH |prefix-list PREFIX-LIST-NAME |address{ A.B.C.D | X:X::X:X }|type blackhole}
no match {ip|ipv6} next-hop {prefix-len LENGTH |prefix-list PREFIX-LISTNAME |address{ A.B.C.D | X:X::X:X }|type blackhole}
[Purpose]
Match the next-hop
[Parameter]
Parameter | Description |
---|---|
LENGTH | Match prefix length of IP address |
PREFIX-LIST-NAME | Match entries of prefix-lists |
A.B.C.D | IP address of next-hop |
X:X::X:X | IPv6 address of next-hop |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match ip next-hop type blackhole
match as-path
Section titled “match as-path”[Command]
match as-path String
no match as-path String
[Purpose]
Matches the specified as_path.
[Parameter]
Parameter | Description |
---|---|
String | AS path access-list name |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match as-path test
match metric
Section titled “match metric”[Command]
match metric metric
no match metric metric
[Purpose]
Matches the specified metric.
[Parameter]
Parameter | Description |
---|---|
METRIC | value (0..4294967295) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match metric 12
match tag
Section titled “match tag”[Command]
match tag TAG
no match tag TAG
[Purpose]
Matches the specified tag value associated with the route.
[Parameter]
Parameter | Description |
---|---|
TAG | Tag value (1..4294967295) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match tag 12
match local-preference
Section titled “match local-preference”[Command]
match local-preference metric
no match local-preference metric
[Purpose]
Matches the specified local-preference.
[Parameter]
Parameter | Description |
---|---|
METRIC | Metric value (0..4294967295) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match local-preference 12
match community
Section titled “match community”[Command]
match community COMMUNITY-LIST
no math community COMMUNITY-LIST
[Purpose]
Matches the specified community_list.
[Parameter]
Parameter | Description |
---|---|
COMMUNITY-LIST | Community-list name |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match community test
match peer
Section titled “match peer”[Command]
match peer { A.B.C.D | X:X::X:X | INTERACE_NAME }
no match peer { A.B.C.D | X:X::X:X | INTERACE_NAME }
[Purpose]
This is a BGP specific match command. Matches the peer ipv6 address if the neighbor was specified in this manner.
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | IP address of peer |
X:X::X:X | IPv6 address of peer |
INTERACE_NAME | Interface name of peer |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match peer 1.1.1.1
match peer local
Section titled “match peer local”[Command]
match peer local
no match peer local
[Purpose]
Matches the peer static or redistributed routes.
[Notes] This command unmatches peer-to-peer static or redistributed routes.
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match peer local
match source-protocol
Section titled “match source-protocol”[Command]
match source-protocol {kernel|connected|static|rip|ripng|ospf|ospf6|isis|bgp|eigrp|nhrp|table|vnc|babel|sharp|openfabric}
no match source-protocol {kernel|connected|static|rip|ripng|ospf|ospf6|isis|bgp|eigrp|nhrp|table|vnc|babel|sharp|openfabric}
[Purpose]
This is a ZEBRA specific match command. Matches the originating protocol specified.
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match source-protocol static l
match source-instance
Section titled “match source-instance”[Command]
match source-instance INSTANCE
no match source-instance INSTANCE
[Purpose]
This is a ZEBRA specific match command.
[Parameter]
Parameter | Description |
---|---|
INSTANCE | The instance number (0..255) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# match source-instance 2
set tag
Section titled “set tag”[Command]
set tag TAG
no set tag TAG
[Purpose]
Set a tag on the matched route.
[Parameter]
Parameter | Description |
---|---|
TAG | Tag value (1..4294967295) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set tag 12
set ip next-hop
Section titled “set ip next-hop”[Command]
set ip next-hop A.B.C.D
no set ip next-hop A.B.C.D
[Purpose]
Set the BGP nexthop address
[Parameter]
Parameter | Description |
---|---|
A.B.C.D | IP address |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set ip next-hop 1.1.1.1
set ip next-hop peer-address
Section titled “set ip next-hop peer-address”[Command]
set ip next-hop peer-address
no set ip next-hop peer-address
[Purpose]
Set the BGP nexthop address to the address of the peer
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set ip next-hop peer-address
set ip next-hop unchanged
Section titled “set ip next-hop unchanged”[Command]
set ip next-hop unchanged
no set ip next-hop unchanged
[Purpose]
Set the route-map as unchanged
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set ip next-hop unchanged
set ipv6 next-hop peer-address
Section titled “set ipv6 next-hop peer-address”[Command]
set ipv6 next-hop peer-address
no set ipv6 next-hop peer-address
[Purpose]
Set the BGP nexthop address to the address of the peer.
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set ipv6 next-hop peer-address
set ipv6 next-hop prefer-global
Section titled “set ipv6 next-hop prefer-global”[Command]
set ipv6 next-hop prefer-global
no set ipv6 next-hop prefer-global
[Purpose]
For Incoming and Import Route-maps if we receive a v6 global and v6 LL address for the route, then prefer to use the global address as the nexthop.
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set ipv6 next-hop prefer-global
set ipv6 next-hop global
Section titled “set ipv6 next-hop global”[Command]
set ipv6 next-hop global X:X::X:X
no set ipv6 next-hop global X:X::X:X
[Purpose]
Set the next-hop to the specified IPV6_ADDRESS for both incoming and outgoing route-maps.
[Parameter]
Parameter | Description |
---|---|
X:X::X:X | IPv6 address of next hop |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set ipv6 next-hop global 100::1
set ipv6 next-hop local
Section titled “set ipv6 next-hop local”[Command]
set ipv6 next-hop local X:X::X:X
no set ipv6 next-hop local X:X::X:X
[Purpose]
Set the BGP-4+ link local IPv6 nexthop address.
[Parameter]
Parameter | Description |
---|---|
X:X::X:X | IPv6 address of next hop |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set ipv6 next-hop local 100::1
set local-preference
Section titled “set local-preference”[Command]
set local-preference PREFERENCE
no set local-preference PREFERENCE
[Purpose]
Subtract the BGP local preference.
[Parameter]
Parameter | Description |
---|---|
PREFERENCE | Preference value (0-4294967295) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set local-preference 12
set distance
Section titled “set distance”[Command]
set distance DISTANCE
no set distance DISTANCE
[Purpose]
Set the administrative distance
[Parameter]
Parameter | Description |
---|---|
DISTANCE | Distance value (0..255) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set distance 12
set weight
Section titled “set weight”[Command]
set weight WEIGHT
no set weight WEIGHT
[Purpose]
Set the route’s weight.
[Parameter]
Parameter | Description |
---|---|
WEIGHT | value (0..4294967295) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set weight 12
set metric
Section titled “set metric”[Command]
set metric { metric |rtt|+rtt|-rtt>}
no set metric { metric |rtt|+rtt|-rtt>}
[Purpose]
Set the BGP attribute MED to a specific value.
[Parameter]
Parameter | Description |
---|---|
METRIC | 2147483647..2147483647 |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set metric 12
set as-path prepend
Section titled “set as-path prepend”[Command]
set as-path prepend [ AS_PATH* ] [last-as NUMBER ]
no set as-path prepend [ AS_PATH ] [last-as NUMBER ]
[Purpose]
Set the BGP AS path to prepend.
[Parameter]
Parameter | Description |
---|---|
AS_PATH | AS number (1..4294967295) |
NUMBER | Number of times to insert (1..10) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set as-path prepend 12
set as-path exclude
Section titled “set as-path exclude”[Command]
set as-path exclude [ AS_NUMBER ]
no set as-path exclude [ AS_NUMBER ]
[Purpose]
Drop AS-NUMBER from the BGP AS path.
[Parameter]
Parameter | Description |
---|---|
AS_NUMBER | AS number (1..4294967295) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set as-path exclude 12
set community
Section titled “set community”[Command]
set community [ COMMUNITY ]
no set community [ COMMUNITY ]
[Purpose]
Set the BGP community attribute.
[Parameter]
Parameter | Description |
---|---|
COMMUNITY | Community number in AA:NN format (where AA and NN are (0-65535)) or local-AS |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set community 12
set origin {egp|igp|incomplete}
Section titled “set origin {egp|igp|incomplete}”[Command]
set origin {egp|igp|incomplete}
no set origin {egp|igp|incomplete}
[Purpose]
Set BGP route origin.
[Notes] This command cancels the BGP route origin setting.
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set origin igp
set table
Section titled “set table”[Command]
set table TABLEID
no set table TABLEID
[Purpose]
Set the BGP table to a given table identifier.
[Parameter]
Parameter | Description |
---|---|
TABLEID | Kernel routing table id (1..4294967295) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set table 12
set sr-te color
Section titled “set sr-te color”[Command]
set sr-te color COLOR
no set sr-te color COLOR
[Purpose]
Set the color of a SR-TE Policy to be applied to a learned route.
[Parameter]
Parameter | Description |
---|---|
COLOR | Color of the SR-TE Policies to match with (1..4294967295) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# set sr-te color 12
on-match
Section titled “on-match”[Command]
on-match {goto NUMBER |next}
no on-match {goto NUMBER |next}
[Purpose]
Proceed on to the next entry in the route-map
[Parameter]
Parameter | Description |
---|---|
NUMBER | Number (1..65535)) |
[View]
Route-map view
[Use Cases]
sonic# clear route-map counterssonic(config)# route-map test permit 233sonic(config-route-map)# on-match next
set src
Section titled “set src”[Command]
set src ip_address
[Purpose]
Set the preferred source address for matching routes when installing in the kernel
[Parameter]
Parameter | Description |
---|---|
ip_address | IPv4/IPv6 address |
[View]
Route-map view
[Use Cases]
sonic(config)# route-map RM_SET_SRC permit 10sonic(config-route-map)# set src 30.11.0.48
ip protocol
Section titled “ip protocol”[Command]
ip protocol protocol route-map routemap
[Purpose]
Filter which routes will install in the kernel
[Parameter]
Parameter | Description |
---|---|
protocol | kernel/connected/static/rip/ospf/isis/bgp/any |
routemap | router map name |
[View]
System configuration view
[Use Cases]
sonic(config)# ip protocol bgp route-map RM_SET_SRC
Policy Route Configuration
Section titled “Policy Route Configuration”show pbr interface
Section titled “show pbr interface”[Command]
show pbr interface [ interface-name ]
[Purpose]
View the binding relationship between interfaces and policy routes
[View]
System view
[Use Cases]
sonic# show pbr interface Ethernet30Ethernet30(38) with pbr-policy TEST
show pbr map [map-name]
Section titled “show pbr map [map-name]”[Command]
show pbr map [map-name]
[Purpose]
Display the configured policy routes
[View]
System view
[Use Cases]
sonic# show pbr mappbr-map TEST valid: no Seq: 10 rule: 309 Installed: no Reason: Invalid NH SRC Match: 10.255.255.0/30 nexthop 10.254.254.1 Installed: no Tableid: 10000
show pbr nexthop-groups
Section titled “show pbr nexthop-groups”[Command]
show pbr nexthop-groups
[Purpose]
Displays the next address group for the policy route
[View]
System view
[Use Cases]
sonic# show pbr nexthop-groupsNexthop-Group: TEST Table: 10001 Valid: 1 Installed: 1 Valid: 0 nexthop Ethernet32 Valid: 1 nexthop Ethernet31
pbr-map
Section titled “pbr-map”[Command]
pbr-map NAME seq number
no pbr-map NAME [seq number ]
[Purpose]
Create a policy route and enter the view
[Parameter]
Parameter | Description |
---|---|
name | Specify the policy name |
number | Policy ID, value range: 1-700, the lower the number, the higher the priority |
[View]
System configuration view
[Use Cases]
sonic(config)# pbr-map TEST seq 10sonic(config-pbr-map)#
[Command]
match {dst-ip ip-address |dst-port port |ip-protocol protocol |src-ip ip-address |src-port port }
no match {dst-ip ip-address |dst-port port |ip-protocol protocol |src-ip ip-address |src-port port }
[Purpose]
Create match conditions for policy routing
[Parameter]
Parameter | Description |
---|---|
dst-ip | Match the destination IP address of the packet |
dst-port | Match the destination port of the packet |
ip-protocol | Match the protocol type of the packet |
src-ip | Match the source IP address of the packet |
src-port | Match the source port of the packet |
[View]
Policy route view
[Use Cases]
sonic(config)# pbr-map TEST seq 10sonic(config-pbr-map)# match src-ip 1.1.1.0/24
[Command]
set {nexthop ip-address |nexthop-group NAME }
no set {nexthop ip-address |nexthop-group NAME }
[Purpose]
Configure an action of redirecting packets to a next-hop IP address
[Parameter]
Parameter | Description |
---|---|
nexthop ip-address | Nexthop ip address |
nexthop-group name | Nexthop group name |
[View]
Policy route view
[Notes] The redirect nexthop command allows user to specify a maximum of 4 next-hop IP addresses. If multiple next-hop IP addresses are configured, the device redirects packets in active/standby mode. The device determines the primary link and backup links according to the sequence in which next-hop IP addresses were configured. The next-hop IP address that was configured first has the highest priority and this next hop is used as the primary path. Other next hops are used as backup paths. When the primary link becomes Down, a next hop with higher priority is used as the primary path.
[Use Cases]
sonic(config)# nexthop-group TESTsonic(config-pbr-map)# set nexthop 1.1.1.0/24
nexthop-group
Section titled “nexthop-group”[Command]
nexthop-group NAME
no nexthop-group NAME
[Purpose]
Create a next-hop address group and enter the view
[View]
System configuration view
[Use Cases]
sonic(config)# nexthop-group TESTsonic(config-nh-group)#
nexthop
Section titled “nexthop”[Command]
nexthop ip_address
no nexthop ip_address
[Purpose]
Configure the member addresses in the next-hop address group
[View]
Nexthop group view
[Notes] If multiple next-hop IP addresses are specified, the device redirects packets in ECMP load balancing mode
[Use Cases]
sonic(config)# nexthop-group TESTsonic(config-nh-group)# nexthop 1.1.1.0/24sonic(config-nh-group)# nexthop 1.1.2.0/24
pbr-policy
Section titled “pbr-policy”[Command]
pbr-policy NAME
no pbr-policy NAME
[Purpose]
Bind the policy route to the specified interface
[View]
Interface view
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# pbr-policy TEST
show vrf brief
Section titled “show vrf brief”[Command]
show vrf brief
[Purpose]
Display vrf-related configuration information
[View]
System view
[Use Cases]
sonic# show vrf brief+------------+-------+-----------+| vrf name | vni | src_mac |+============+=======+===========+| 100 | | |+------------+-------+-----------+| 101 | | |+------------+-------+-----------+| 200 | 2000 | |+------------+-------+-----------+
vrf mgmt
Section titled “vrf mgmt”[Command]
vrf mgmt
[Purpose]
Configure management port VRF
[View]
System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# interface mgmt 0sonic(config-mgmt-0)# vrf mgmt
vrf vrfname
Section titled “vrf vrfname”[Command]
vrf vrfname
[Purpose]
Add VRF
[Parameter]
Parameter | Description |
---|---|
vrfname | VRF name, length 1-11 |
[View]
System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# vrf 123
ip route
Section titled “ip route”[Command]
ip route A.B.C.D/M A.B.C.D
[Purpose]
Add VRF routes
[Parameter]
Parameter | Description |
---|---|
A.B.C.D/M | IP address |
A.B.C.D | IP address |
[View]
VRF View
[Use Cases]
sonic# configure terminalsonic(config)# vrf 123sonic(config-vrf)# ip route 10.0.0.0/24 20.0.0.2