跳转到内容
Ask AI

BGP

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

Table 1 BGP View

CommandPurpose
show ip bgp neighbors [A.B.C.D|X:X::X:X [OPTIONs]]Display information of BGP neighbors.
show ip bgp [A.B.C.D/M|A.B.C.D|X:X::X:X/M|X:X::X:X]Display network information of BGP neighbors.
show ip bgp summary[established|failed|json]Display summary of BGP neighbor status.
show ip bgp community-list {community_list_number|community_name}Display information of BGP community-list.
show ip bgp [vrf all|vrf_name]Display information of BGP.
show bgp peer-groupDisplay detailed information on BGP peer groups.
show ip bgp statisticsDisplay BGP RIB advertisement statistics.

show ip bgp neighbors [A.B.C.D|X:X::X:X [OPTIONs]]

Section titled “show ip bgp neighbors [A.B.C.D|X:X::X:X [OPTIONs]]”

[Command]

show ip bgp neighbors [A.B.C.D|X:X::X:X [OPTIONs]]

[Purpose]

Display information of BGP neighbors.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor to display information about.
X:X::X:XIPv6 neighbor to display information about.

[Options]

OptionDescription
routesDisplay routes learned from neighbor.
advertised-routesDisplay the routes advertised to a BGP neighbor.
received-routesDisplay the received routes from neighbor.
prefix-countsDisplay detailed prefix count information.
filtered-routesDisplay the filtered routes received from neighbor.
bestpath-routesDisplay the routes selected by best path.
receivedDisplay information received from a BGP neighbor.
flap-statisticsDisplay flap statistics of the routes learned from neighbor.
dampened-routesDisplay the dampened routes received from neighbor.
jsonJavaScript Object Notation.

[View]

Privileged User View

[Use Cases]

sonic# show ip bgp neighbors 10.0.0.1
BGP neighbor is 10.0.0.1, remote AS 65100, local AS 65100, internal link
Hostname: leaf-103
BGP version 4, remote router ID 10.1.0.103, local router ID 10.1.0.221
BGP state = Established, up for 00:11:35
Last read 00:00:35, Last write 00:00:35
Hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
4 Byte AS: advertised and received
AddPath:
IPv4 Unicast: RX advertised IPv4 Unicast and received
Route refresh: advertised and received(old & new)
Address Family IPv4 Unicast: advertised and received
Hostname Capability: advertised (name: sonic,domain name: n/a) received (name: leaf-103,domain name: n/a)
Graceful Restart Capability: advertised and received
Remote Restart timer is 120 seconds
Address families by peer:
none
Graceful restart information:
End-of-RIB send: IPv4 Unicast
End-of-RIB received: IPv4 Unicast
Local GR Mode: Helper*
Remote GR Mode: Helper
R bit: False
Timers:
Configured Restart Time(sec): 120
Received Restart Time(sec): 120
IPv4 Unicast:
F bit: False
End-of-RIB sent: Yes
End-of-RIB sent after update: Yes
End-of-RIB received: Yes
Timers:
Configured Stale Path Time(sec): 360
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 8 7
Notifications: 2 10
Updates: 2 14
Keepalives: 34 30
Route Refresh: 0 0
Capability: 0 0
Total: 46 61
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
Update group 7, subgroup 4
Packet Queue length 0
Community attribute sent to this neighbor(all)
7 accepted prefixes
Connections established 2; dropped 1
Last reset 00:11:37, No AFI/SAFI activated for peer
Local host: 10.0.0.2, Local port: 179
Foreign host: 10.0.0.1, Foreign port: 37052
Nexthop: 10.0.0.2
Nexthop global: fe80::1a17:25ff:fe37:6736
Nexthop local: fe80::1a17:25ff:fe37:6736
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Estimated round trip time: 1 ms
Read thread: on Write thread: on FD used: 24

show ip bgp [A.B.C.D/M|A.B.C.D|X:X::X:X/M|X:X::X:X]

Section titled “show ip bgp [A.B.C.D/M|A.B.C.D|X:X::X:X/M|X:X::X:X]”

[Command]

show ipbgp [A.B.C.D/M|A.B.C.D|X:X::X:X/M|X:X::X:X]

[Purpose]

Display network information of BGP neighbors.

[Parameters]

ParameterDescription
A.B.C.D/MIPv4 prefix.
A.B.C.DIPv4 network in the BGP routing table to display.
X:X::X:X/MIPv6 prefix.
X:X::X:XIPv6 network in the BGP routing table to display.

[View]

Privileged User View

[Use Cases]

sonic# show ip bgp
BGP table version is 1282, local router ID is 10.1.0.32, vrf id 0
Default local pref 100, local AS 65100
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*= 192.177.0.0/25 10.0.0.59 0 64600 65534 64618 65100 ?
*> 10.0.0.57 0 64600 65534 64618 65100 ?
*= 192.177.0.128/25 10.0.0.59 0 64600 65534 64618 65100 ?
*> 10.0.0.57 0 64600 65534 64618 65100 ?
Display ed 2 routes and 1282 total paths

show ip bgp summary [established|failed|json]

Section titled “show ip bgp summary [established|failed|json]”

[Command]

show ip bgp summary [established|failed|json]

[Purpose]

Display summary of BGP neighbor status.

[View]

Privileged User View

[Use Cases]

sonic# show ip bgp summary
IPv4 Unicast Summary:
BGP router identifier 10.1.0.32, local AS number 65100 vrf-id 0
BGP table version 14084
RIB entries 1287, using 231 KiB of memory
Peers 2, using 41 KiB of memory
Peer groups 6, using 384 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd NeighborName
10.0.0.57 4 64600 5593 7340 0 0 0 02:57:22 640 ARISTA01T1
10.0.0.59 4 64600 5599 7118 0 0 0 02:57:17 640 ARISTA02T1
Total number of neighbors 2

show ip bgp community-list {community_list_number|community_name}

Section titled “show ip bgp community-list {community_list_number|community_name}”

[Command]

show ip bgp community-list {community_list_number|community_name}

[Purpose]

Display information of BGP community-list.

[Parameters]

ParameterDescription
community_list_numberCommunity-list number, range from 1 to 500.
community_nameCommunity name.

[View]

Privileged User View

[Use Cases]

sonic# show ip bgp community-list

[Command]

show ip bgp [vrf all|vrf_name]

[Purpose]

Display information of BGP.

[Parameters]

ParameterDescription
allAll Views/VRFs.
vrf_nameSpecify the VRF name, the default VRF is default.

[View]

Privileged User View

[Use Cases]

sonic# show ip bgp vrf all
Instance default:
BGP table version is 2375, local router ID is 30.11.0.84, vrf id 0
Default local pref 100, local AS 65100
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin 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

[Command]

show bgp peer-group

[Purpose]

Display detailed information on BGP peer groups.

[View]

Privileged User View

[Use Cases]

sonic# show bgp peer-group
BGP peer-group PEER_V4_EBGP
Peer-group type is external
Configured address-families: IPv4 Unicast; L2VPN EVPN;
Peer-group members:
30.11.122.1 Active
30.11.122.137 Active
BGP peer-group PEER_V6_EBGP
Peer-group type is external
Configured address-families: IPv6 Unicast; L2VPN EVPN;
Peer-group members:
2022::2222 Active
2022::2224 Active

[Command]

show ip bgp statistics

[Purpose]

Display BGP RIB advertisement statistics.

[View]

Privileged User View

[Use Cases]

sonic# show ip bgp statistics
BGP IPv4 Unicast RIB statistics (VRF default)
Total Advertisements : 25
Total Prefixes : 25
Average prefix length : 19.20
Unaggregateable prefixes : 25
Maximum aggregateable prefixes: 0
BGP Aggregate advertisements : 0
Address space advertised : 985600
% announced : 0.02
/8 equivalent : 0.06
/24 equivalent : 3850.00
Advertisements with paths : 25
Longest AS-Path (hops) : 1
Average AS-Path length (hops) : 1.00
Largest AS-Path (bytes) : 6
Average AS-Path size (bytes) : 6.00
Highest public ASN : 0

Table 2 BGP Config

CommandPurpose
bgp as-path access-list list_name {permit|deny} LINEAdd a BGP autonomous system path filter.
bgp community-list community_list_number [standard|expanded] [seq seq-num] {permit|deny} AA:NNAdd a community list entry.
bgp extcommunity-list excommunity_list_number [standard|expanded] [seq seq-num] {permit|deny} LINEAdd an extended community list entry.
router bgp AS-number [vrf vrf_name]Enter BGP Configuration View.
address-family{ipv4|ipv6|l2vpn}unicastEnter Address Family command mode.
aggregate-address {A.B.C.D A.B.C.D|A.B.C.D/M} [as-set|summary-only|route-map route-map]Configure BGP aggregate entries.
bgp always-compare-medAllow comparing MED from different neighbors.
bgp bestpath[as-path{confed|ignore|multipath-relax}|compare-routerid]Change the default bestpath selection.
bgp ebgp-requires-policyRequire in and out policy for eBGP peers (RFC8212).
bgp graceful-restartGlobal Graceful Restart command.
bgp router-id A.B.C.DOverride configured router identifier.
bgp route-reflector allow-outbound-policyAllow modifications made by out route-map and enable RR(route-reflector).
bgp network import-checkCheck BGP network route exists in IGP.
bgp shutdown [message string]Administrative shutdown of the BGP instance.
distance {bgp external-distance internal-distance local-distance|administrative-distance A.B.C.D/M}Define an administrative distance.
neighbor {A.B.C.D|X:X::X:X|String} advertisement-interval internalSet the minimum interval between sending BGP routing updates.
neighbor {A.B.C.D|X:X::X:X|String} bfdEnable BFD support.
neighbor {A.B.C.D|X:X::X:X|String} description descriptionAllow EBGP neighbors not on directly connected networks.
neighbor {A.B.C.D|X:X::X:X|String} ebgp-multihop countAllow EBGP neighbors not on directly connected networks.
neighbor {A.B.C.D|X:X::X:X|String} password passwordSet a password for BGP neighbor.
neighbor {A.B.C.D|X:X::X:X|String} peer-group peer-groupSet to be the member of a peer-group.
neighbor {A.B.C.D|X:X::X:X|String} remote-as AS-numberSpecify a BGP neighbor.
neighbor {A.B.C.D|X:X::X:X|String} shutdownAdministratively shut down this neighbor.
neighbor {A.B.C.D|X:X::X:X|String} update-source {A.B.C.D|X:X::X:X|String}Specify the source of routing updates.
neighbor peer-group peer-groupAdd a peer-group.
update-delay max-delayForce initial delay for best-path and updates.
network {A.B.C.D/M|A.B.C.D [mask A.B.C.D]} [route-map route-map]Specify a network to announce via BGP.
neighbor {A.B.C.D|X:X::X:X|String} activateEnable the address family for this neighbor.
neighbor {A.B.C.D|X:X::X:X|String} allowas-in [number|origin]Accept as-path with my AS present in it.
neighbor {A.B.C.D|X:X::X:X|String} as-overrideOverride ASNs in outbound updates if as-path equals remote-as.
neighbor {A.B.C.D|X:X::X:X|String} default-originate [route-map route-map]Originate default route to this neighbor.
neighbor {A.B.C.D|X:X::X:X|String} next-hop-self [force]Disable the next hop calculation for this neighbor.
neighbor {A.B.C.D|X:X::X:X|String} prefix-list list_name {in|out}Filter updates to/from this neighbor.
neighbor {peer-group|A.B.C.D|X:X::X:X|String} route-map route-map {in|out}Apply route map to neighbor.
redistribute src_protocol [metric metric_value|route-map route-map]Redistribute information from another routing protocol.

bgp as-path access-list list_name {permit|deny} LINE

Section titled “bgp as-path access-list list_name {permit|deny} LINE”

[Command]

bgp as-path access-list list_name {permit|deny} LINE

[Purpose]

Add a BGP autonomous system path filter.

[Parameters]

ParameterDescription
list_nameRegular expression access list name.
LINEA regular-expression (1234567890_^|[, {}() ]$*+.?-\) to match the BGP AS paths.

[View]

Global Configuration View

[Notes]

Run command no bgp as-path access-list list_name {permit|deny} LINE to delete AS path filter.

[Use Cases]

sonic# configure terminal
sonic(config)# bgp as-path access-list test permit 66

bgp community-list community_list_number [standard|expanded] [seq seq-num] {permit|deny} AA:NN

Section titled “bgp community-list community_list_number [standard|expanded] [seq seq-num] {permit|deny} AA:NN”

[Command]

bgp community-list community_list_number [standard|expanded] [seq seq-num] {permit|deny} AA:NN

[Purpose]

Add a community list entry.

[Parameters]

ParameterDescription
community_list_numberCommunity-list number, range from 1 to 500. 1-99 as standard and 100-500 as expanded.
standardAdd a standard community-list entry.
expandedAdd an expanded community-list entry.
seq-numSequence number of an entry, range from 1 to 4294967295.
AA:NNCommunity number in AA:NN format (where AA and NN are (0-65535)) or local-AS|no-advertise|no-export|internet|graceful-shutdown|accept-own-nexthop|accept-own|route-filter-translated-v4|route-filter-v4|route-filter-translated-v6|route-filter-v6|llgr-stale|no-llgr|blackhole|no-peer or additive

[View]

Global Configuration View

[Notes]

Run command no bgp community-list community_list_number [standard|expanded] [seq seq-num] {permit|deny} *AA:NN * to delete BGP community-list. When seq is not specified, it is started from 5, and the increment interval is 5.

[Use Cases]

sonic# configure terminal
sonic(config)# bgp community-list standard 10 permit 12:13

bgp extcommunity-list excommunity_list_number [standard|expanded] [seq seq-num] {permit|deny} LINE

Section titled “bgp extcommunity-list excommunity_list_number [standard|expanded] [seq seq-num] {permit|deny} LINE”

[Command]

bgp extcommunity-list excommunity_list_number [standard|expanded] [seq seq-num] {permit|deny} LINE

[Purpose]

Add an extended community list entry.

[Parameters]

ParameterDescription
excommunity_list_numberExcommunity-list number, range from 1 to 500. 1-99 as standard and 100-500 as expanded.
standardSpecify standard extcommunity-list.
expandedSpecify expanded extcommunity-list.
seq-numSequence number of an entry, range from 1 to 4294967295.
LINEExtended community attribute in ‘rt aa:nn_or_IPaddr:nn’ OR ‘soo aa:nn_or_IPaddr:nn’ format.

[View]

Global Configuration View

[Notes]

Run command no bgp extcommunity-list excommunity_list_number [standard|expanded] [seq seq-num] {permit|deny} LINE to delete extended community list.

[Use Cases]

sonic# configure terminal
sonic(config)# bgp extcommunity-list standard TEST permit aa

[Command]

router bgp AS-number [vrf vrf_name]

[Purpose]

Global Configuration View

[Parameters]

ParameterDescription
AS-numberRange from 1 to 4294967295, the default AS is 65100.
vrf_nameVRF name, default VRF if not specified.

[View]

BGP Configuration View

[Notes]

BGP views use the core instance (i.e., the default VRF) to communicate with peers. Run command no router bgp AS-number to delete configured BGP local AS number.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)#

[Command]

address-family {ipv4|ipv6|l2vpn} unicast

[Purpose]

Enter Address Family command mode.

[View]

BGP Configuration View

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)#

aggregate-address {A.B.C.D A.B.C.D|A.B.C.D/M} [as-set|summary-only|route-map route-map]

Section titled “aggregate-address {A.B.C.D A.B.C.D|A.B.C.D/M} [as-set|summary-only|route-map route-map]”

[Command]

aggregate-address {A.B.C.D A.B.C.D|A.B.C.D/M} [as-set|summary-only|route-map route-map]

[Purpose]

Configure BGP aggregate entries.

[Parameters]

ParameterDescription
A.B.C.DAggregate address.
A.B.C.DAggregate mask.
A.B.C.D/MAggregate prefix.
as-setGenerate AS set path information.
summary-onlyFilter more specific routes from updates.
route-mapApply route map to aggregate network.

[View]

BGP Configuration View/BGP IPv4 Unicast Address-family View

[Notes]

Run command no aggregate-address {A.B.C.D A.B.C.D|A.B.C.D/M} [as-set|summary-only|route-map route-map] to delete BGP aggregate configuration.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65200
sonic(config-router)# aggregate-address 100.1.1.0/24 as-set
sonic(config-router)# aggregate-address 110.1.1.0/19 summary-only

[Command]

bgp always-compare-med

[Purpose]

Allow comparing MED from different neighbors.

[View]

BGP Configuration View

[Notes]

This command is mainly applied to control the MED attribute to change the routing policy of BGP. It allows BGP to compare the MED attribute values of routes from different AS. If there are multiple valid routes to reach the same destination address, the route with smaller MED parameter can be selected as the final route actually in use. Run command no bgp always-compare-med to disable BGP always-compare-med.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# bgp always-compare-med

bgp bestpath [as-path {confed|ignore|multipath-relax}|compare-routerid]

Section titled “bgp bestpath [as-path {confed|ignore|multipath-relax}|compare-routerid]”

[Command]

**bgp bestpath ** [as-path {confed|ignore|multipath-relax}|compare-routerid]

[Purpose]

Change the default bestpath selection.

[Parameters]

ParameterDescription
confedCompare path lengths including confederation sets & sequences in selecting a route.
ignoreIgnore as-path length in selecting a route.
multipath-relaxAllow load sharing across routes that have different AS paths (but same length)
compare-routeridCompare router-id for identical EBGP paths.

[View]

BGP Configuration View

[Notes]

AS-Path relax is a routing-level switch that determines how the same route from different AS domains is handled.

  • When is enabled, the next hop of the same route from different AS domains will be an ECMP group.
  • When this is disabled, only one of the routes will be selected for forwarding. Run command **no bgp bestpath ** [as-path {confed | ignore | multipath-relax}|compare-routerid] to delete BGP bestpath selection.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# bgp bestpath as-path ignore

[Command]

bgp ebgp-requires-policy

[Purpose]

Require in and out policy for eBGP peers (RFC8212).

[View]

BGP Configuration View

[Notes]

This command requires that there must be a routing policy applied to the EBGP session, if there is not, no routes will be accepted or announced, and is on by default. In practice, we usually use no bgp ebgp-requires-policy command to disable the feature above.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# no bgp ebgp-requires-policy

[Command]

bgp graceful-restart [preserve-fw-state|restart-time restart-time|rib-stale-time rib-stale-time|select-defer-time select-defer-time|stalepath-time stalepath-time]

[Purpose]

Global Graceful Restart command.

[Parameters]

ParameterDescription
preserve-fw-stateSets F-bit indication that fib is preserved while doing Graceful Restart.
restart-timeSet the time to wait to delete stale routes before a BGP open message is received in seconds. Range from 1 to 4095.
rib-stale-timeSpecify the stale route removal timer in rib in seconds. Range from 1 to 3600.
select-defer-timeSet the time to defer the BGP route selection after restart in seconds. Range from 0 to 3600.
statlepath-timeSet the max time to hold onto restarting peer’s stale paths in seconds. Range from 1 to 4095.

[View]

BGP Configuration View

[Notes]

Run command no bgp graceful-restart [preserve-fw-state|restart-time delay |rib-stale-time delay |select-defer-time delay |stalepath-time delay ] to disable Graceful Restart.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# bgp graceful-restart restart-time 200

[Command]

bgp router-id A.B.C.D

[Purpose]

Override configured router identifier.

[Parameters]

ParameterDescription
A.B.C.DBGP Route ID

[View]

BGP Configuration View

[Notes]

This command is optional. Use Loopback0 IP as the router ID by default. Run command no bgp router-id A.B.C.D to delete BGP Route ID.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# bgp router-id 1.1.1.1

[Command]

bgp route-reflector allow-outbound-policy

[Purpose]

Allow modifications made by out route-map and enable RR(route-reflector).

[View]

BGP Configuration View

[Notes]

Run command no bgp route-reflector allow-outbound-policy to disable RR.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# bgp route-reflector allow-outbound-policy

[Command]

bgp network import-check

[Purpose]

Check BGP network route exists in IGP.

[View]

BGP Configuration View

[Notes]

Run command no bgp network import-check to disable check.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# bgp network import-check

[Command]

bgp shutdown [message string]

[Purpose]

Administrative shutdown of the BGP instance.

[Parameters]

ParameterDescription
stringAdd a shutdown message (RFC 8203)

[View]

BGP Configuration View

[Notes]

Run command no bgp shutdown [message string] Startup all BGP sessions.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# bgp shutdown

distance {bgp external-distance internal-distance local-distance|administrative-distance A.B.C.D/M}

Section titled “distance {bgp external-distance internal-distance local-distance|administrative-distance A.B.C.D/M}”

[Command]

distance {bgp external-distance internal-distance local-distance|administrative-distance A.B.C.D/M}

[Purpose]

Define an administrative distance.

[Parameters]

ParameterDescription
external-distanceDistance for routes external to the AS, range from 1 to 255.
internal-distanceDistance for routes internal to the AS, range from 1 to 255.
local-distanceDistance for local routes, range from 1 to 255.
administrative-distance A.B.C.D/MAdministrative distance, range from 1 to 255.

[View]

BGP Configuration View

[Notes]

Run command no distance to delete distance configuration.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# distance 123 1.1.1.1/32

neighbor {A.B.C.D|X:X::X:X|String} advertisement-interval internal

Section titled “neighbor {A.B.C.D|X:X::X:X|String} advertisement-interval internal”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} advertisement-interval internal

[Purpose]

Set the minimum interval between sending BGP routing updates.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
internalTime in seconds, range from 0 to 600.

[View]

BGP Configuration View

[Notes]

Run command no neighbor {A.B.C.D|X:X::X:X|String} advertisement-interval internal to delete configuration.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# neighbor 1.1.1.1 advertisement-interval 2

[Command]

neighbor {A.B.C.D|X:X::X:X|String} bfd

[Purpose]

Enable BFD support.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.

[View]

BGP Configuration View

[Notes]

Run command no neighbor {A.B.C.D|X:X::X:X|String} bfd to disable BFD support.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# neighbor 10.0.0.1 bfd

neighbor {A.B.C.D|X:X::X:X|String} description description

Section titled “neighbor {A.B.C.D|X:X::X:X|String} description description”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} description description

[Purpose]

Set neighbor specific description.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
descriptionSpecify the description for the BGP neighbor in string form.

[View]

BGP Configuration View

[Notes]

Run command no neighbor {A.B.C.D|X:X::X:X|String} description description to delete description.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# neighbor 1.1.1.1 description test

neighbor {A.B.C.D|X:X::X:X|String} ebgp-multihop count

Section titled “neighbor {A.B.C.D|X:X::X:X|String} ebgp-multihop count”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} ebgp-multihop count

[Purpose]

Allow EBGP neighbors not on directly connected networks.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
countMaximum hop count, the range is [1,255]

[View]

BGP Configuration View

[Notes]

This feature must be enabled when using a Loopback interface to configure BGP neighbors. The normal maximum hop count is configured as 255. Run command no neighbor {A.B.C.D|X:X::X:X|String} ebgp-multihop count to disable this feature.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# neighbor 1.1.1.1 ebgp-multihop 2

neighbor {A.B.C.D|X:X::X:X|String} password password

Section titled “neighbor {A.B.C.D|X:X::X:X|String} password password”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} password password

[Purpose]

Set a password for BGP neighbor.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
passwordThe password.

[View]

BGP Configuration View

[Notes]

This command sets an MD5 password for the BGP neighbor to connect to the remote peer’s TCP socket. Run command no neighbor {A.B.C.D|X:X::X:X|String} password password to delete the password.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# neighbor 1.1.1.1 password test1234

neighbor {A.B.C.D|X:X::X:X|String} peer-group peer-group

Section titled “neighbor {A.B.C.D|X:X::X:X|String} peer-group peer-group”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} peer-group peer-group

[Purpose]

Set to be the member of a peer-group.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
peer-groupPeer-group name.

[View]

BGP Configuration View

[Notes]

Run command no neighbor {A.B.C.D|X:X::X:X|String} peer-group peer-group to unbind.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# neighbor 1.1.1.1 peer-group PEER_V4_EBGP

neighbor {A.B.C.D|X:X::X:X|String} remote-as AS-number

Section titled “neighbor {A.B.C.D|X:X::X:X|String} remote-as AS-number”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} remote-as AS-number

[Purpose]

Specify a BGP neighbor.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
AS-numberRange from 1 to 4294967295.

[View]

BGP Configuration View

[Notes]

Run command no neighbor {A.B.C.D|X:X::X:X|String} remote-as AS-number to delete the neighbor.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# neighbor 10.0.0.1 remote-as 65200

neighbor {A.B.C.D|X:X::X:X|String} shutdown

Section titled “neighbor {A.B.C.D|X:X::X:X|String} shutdown”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} shutdown

[Purpose]

Administratively shut down this neighbor.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.

[View]

BGP Configuration View

[Notes]

Run command no neighbor {A.B.C.D|X:X::X:X|String} shutdown to administratively startup this neighbor.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# neighbor 1.1.1.1 shutdown

neighbor {A.B.C.D|X:X::X:X|String} update-source {A.B.C.D|X:X::X:X|String}

Section titled “neighbor {A.B.C.D|X:X::X:X|String} update-source {A.B.C.D|X:X::X:X|String}”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} update-source {A.B.C.D|X:X::X:X|String}

[Purpose]

Specify the source of routing updates.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.

[View]

BGP Configuration View

[Notes]

When using a Loopback interface to configure a BGP neighbor you must set the source to the Loopback interface. Run command no neighbor {A.B.C.D|X:X::X:X|String} update-source {A.B.C.D|X:X::X:X|String} to delete the source of routing updates.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# neighbor 1.1.1.1 update-source Ethernet49

[Command]

neighbor peer-group peer-group

[Purpose]

Add a peer-group.

[Parameters]

ParameterDescription
peer-groupPeer-group name.

[View]

BGP Configuration View

[Notes]

Run command no neighbor peer-group peer-group to delete this peer-group.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# neighbor PEER_V4_EBGP peer-group

[Command]

update-delay max-delay

[Purpose]

Force initial delay for best-path and updates.

[Parameters]

ParameterDescription
max-delayMax delay in seconds, range from 0 to 3600.

[View]

BGP Configuration View

[Notes]

Run command no bgp update-delay max-delay to delete this configuration.

[Use Cases]

sonic# configure terminal
sonic(config)# bgp update-delay 2

network {A.B.C.D/M|A.B.C.D [mask A.B.C.D]} [route-map route-map]

Section titled “network {A.B.C.D/M|A.B.C.D [mask A.B.C.D]} [route-map route-map]”

[Command]

network {A.B.C.D/M|A.B.C.D [mask A.B.C.D]} [route-map route-map]

[Purpose]

Specify a network to announce via BGP.

[Parameters]

ParameterDescription
A.B.C.D/MIPv4 prefix
A.B.C.DNetwork number.
A.B.C.DNetwork mask.
route-mapRoute-map to modify the attributes.

[View]

BGP Configuration View/BGP IPv4 Unicast Address-family View

[Notes]

Run command no network {A.B.C.D/M|A.B.C.D [mask A.B.C.D]} [route-map route-map] to delete the network.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# network 1.1.1.0/24

neighbor {A.B.C.D|X:X::X:X|String} activate

Section titled “neighbor {A.B.C.D|X:X::X:X|String} activate”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} activate

[Purpose]

Enable the address family for this neighbor.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.

[View]

BGP Address-family View

[Notes]

By default, the switch will advertise IPv4 unicast address family to all neighbors. Using “no bgp default ipv4-unicast” will override this default, so all address families need to be explicitly enabled. Run command no neighbor {A.B.C.D|X:X::X:X|String} activate to disable the address family for this neighbor.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# network 1.1.1.1 activate
sonic(config-router-af)# exit
sonic(config-router)# address-family l2vpn evpn
sonic(config-router-af)# network 1.1.1.1 activate

neighbor {A.B.C.D|X:X::X:X|String} allowas-in [number|origin]

Section titled “neighbor {A.B.C.D|X:X::X:X|String} allowas-in [number|origin]”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} allowas-in [number|origin]

[Purpose]

Accept as-path with my AS present in it.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
numberNumber of occurrences of AS number, the range is [1,10].
originOnly accept my AS in the as-path if the route was originated in my AS.

[View]

BGP IPv4 unicast Address-family View

[Notes]

Run command no neighbor {A.B.C.D|X:X::X:X|String} allowas-in [number|origin] to disable this feature.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# neighbor 1.1.1.1 allowas-in 2

neighbor {A.B.C.D|X:X::X:X|String} as-override

Section titled “neighbor {A.B.C.D|X:X::X:X|String} as-override”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} as-override

[Purpose]

Override ASNs in outbound updates if as-path equals remote-as.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.

[View]

BGP IPv4 unicast Address-family View

[Notes]

Run command no neighbor {A.B.C.D|X:X::X:X|String} as-override to delete this configuration.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# neighbor 1.0.0.1 as-override

neighbor {A.B.C.D|X:X::X:X|String} default-originate [route-map route-map]

Section titled “neighbor {A.B.C.D|X:X::X:X|String} default-originate [route-map route-map]”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} default-originate [route-map route-map]

[Purpose]

Originate default route to this neighbor.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
route-mapRoute-map to modify the attributes.

[View]

BGP Address-family View

[Notes]

BGP does not advertise the default route (0.0.0.0/0) by default, even if it is in the routing table. Use this command when you want to advertise the default route to the peer. Run command no neighbor {A.B.C.D|X:X::X:X|String} default-originate [route-map route-map] to disable this feature.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# neighbor 1.1.1.1 default-originate route-map test

neighbor {A.B.C.D|X:X::X:X|String} next-hop-self [force]

Section titled “neighbor {A.B.C.D|X:X::X:X|String} next-hop-self [force]”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} next-hop-self [force]

[Purpose]

Disable the next hop calculation for this neighbor.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
forceSet the next hop to self for reflected routes.

[View]

BGP Address-family View

[Notes]

Run command no neighbor {A.B.C.D|X:X::X:X|String} next-hop-self [force] to disable this feature.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# neighbor 1.1.1.1 next-hop-self

neighbor {A.B.C.D|X:X::X:X|String} prefix-list list_name {in|out}

Section titled “neighbor {A.B.C.D|X:X::X:X|String} prefix-list list_name {in|out}”

[Command]

neighbor {A.B.C.D|X:X::X:X|String} prefix-list list_name {in|out}

[Purpose]

Filter updates to/from this neighbor.

[Parameters]

ParameterDescription
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
list_nameSpecify the name of IP prefix list.

[View]

BGP IPv4 unicast Address-family View

[Notes]

Run command no neighbor {A.B.C.D|X:X::X:X|String} prefix-list name [in|out] to disable this configuration.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# neighbor 1.1.1.1 prefix-list test in

neighbor {peer-group|A.B.C.D|X:X::X:X|String} route-map route-map {in|out}

Section titled “neighbor {peer-group|A.B.C.D|X:X::X:X|String} route-map route-map {in|out}”

[Command]

neighbor {peer-group|A.B.C.D|X:X::X:X|String} route-map route-map {in|out}

[Purpose]

Apply route map to neighbor.

[Parameters]

ParameterDescription
peer-groupPeer group name.
A.B.C.DIPv4 neighbor address.
X:X::X:XIPv6 neighbor address.
StringInterface name or neighbor tag.
route-mapRoute map name.

[View]

BGP IPv4 unicast Address-family View

[Notes]

The route map needs to be pre-created before it can be bound to a neighbor. A neighbor can only bind to one route-map in in/out directions. Multiple configurations will override. Run command no neighbor {PEER-GROUP|A.B.C.D|X:X::X:X|String} route-map route-map in|out to delete this configuration.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# neighbor 1.1.1.1 route-map test in

redistribute src_protocol [metric metric_value|route-map route-map]

Section titled “redistribute src_protocol [metric metric_value|route-map route-map]”

[Command]

redistribute src_protocol [metric metric_value|route-map route-map]

[Purpose]

Redistribute information from another routing protocol.

[Parameters]

ParameterDescription
src_protocolSet source protocol (babel|connected|eigrp|isis|kernel|openfabric|ospf|rip|static|table|vnc|vnc-direct)
metric_valueMetric for redistributed routes, range from 0 to 4294967295.
route-mapRoute map reference.

[View]

BGP IPv4 unicast Address-family View

[Notes]

The redistribution for the same protocol is an overriding configuration. Run command no redistribute src_protocol [metric metric_value|route-map route-map] to cancel route redistribution.

[Use Cases]

sonic# configure terminal
sonic(config)# router bgp 65100
sonic(config-router)# address-family ipv4 unicast
sonic(config-router-af)# redistribute ospf metric 200