[Enterprise SONiC] BGP Step 1 - Establish BGP Session Follow
- Updated
- Establish iBGP session
- Establish eBGP session
- Establish eBGP with peer group
- Establish iBGP with peer group auto-discovery
Tested model & firmware version:
- Switch model name:
AS7726-32X
AS5835-54X(T)
AS7326-56X
- Edgecore SONiC version:
202006.4
202012.2
202111.3
202111.8
Restriction:
- After 202012 branch, default eBGP requests the route-map defined with RFC-8212 compliance. If user don't define the route-map, please disable "ebgp-requires-policy". Otherwise, BGP PfxRcd(Prefix Received) / PfxSnt(Prefix Sent) are restriction by the route-map policy. (i.e no no routes will be accepted and announced)
Example.
When the incoming or outgoing filter is missing you will see "(Policy)" sign under show bop summary
AS5835-54X# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 1.1.1.1, local AS number 65101 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 727 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
Ethernet48 4 65100 18 20 0 0 0 00:00:03 (Policy) (Policy) N/A
Total number of neighbors 1Please remove the "ebgp-requires-policy" in BGP configuration.
AS5835-54X# configure terminal
AS5835-54X(config)# router bgp 65101
AS5835-54X(config-router)# no bgp ebgp-requires-policy
AS5835-54X(config-router)# do show bgp summary
IPv4 Unicast Summary:
BGP router identifier 1.1.1.1, local AS number 65101 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 727 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
Ethernet48 4 65100 22 24 0 0 0 00:04:50 0 0 N/A
Total number of neighbors 1
Establish iBGP session
Topology:
Procedure:
Step 1. FRR config initialization (refer to this article)
Step 2. Configure IP address properly for BGP session (refer to this article)
Step 3. Enter Vty shell.
admin@sonic:~$ vtysh
Hello, this is FRRouting (version 7.2.1-sonic).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
sonic#
Note: vtysh provides a combined frontend to all FRR daemons in a single combined session.
Step 4. Assign the Router ID
Switch#1
sonic# configure terminal
sonic(config)# router-id 3.3.3.3
Switch#2
sonic# configure terminal
sonic(config)# router-id 4.4.4.4
Caution: Router ID is used to identify routers in AS(autonomous systems). Router ID must be unique for each BGP router in the network. Otherwise, it's failed to establish BGP session.
Step 5. Configuring BGP Neighbor Session
Switch#1's setting.
sonic# configure terminal
sonic(config)# router bgp 65101
sonic(config-router)# neighbor 10.3.0.2 remote-as 65101
Switch#2's setting.
sonic# configure terminal
sonic(config)# router bgp 65101
sonic(config-router)# neighbor 10.3.0.3 remote-as 65101
Note:
- AS (autonomous systems) is a unique identifier and it used to exchange routing information with other AS.Its available pool of 16-bit AS numbers.
1 ~ 64511 reserve to the public, you need to apply for it form IANA ( Internet Assigned Numbers Authority)
64512~ 65534 reserve for private.
- Since AS numbers are not enough, IANA extended the AS Number field to 32 bits in size.
131072 - 4199999999 reserve for public and 4200000000-4294967294 reserve for private.
Step 6. Checking the neighbor status.
Switch#1
sonic# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 3.3.3.3, local AS number 65101 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.3.0.2 4 65101 5 5 0 0 0 00:02:13 0
Total number of neighbors 1
sonic# show bgp neighbors
BGP neighbor is 10.3.0.2, remote AS 65101, local AS 65101, internal link
Hostname: sonic
BGP version 4, remote router ID 4.4.4.4, local router ID 3.3.3.3
BGP state = Established, up for 00:00:26
Last read 00:00:25, Last write 00:00:25
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 3 3
Notifications: 4 0
Updates: 2 2
Keepalives: 9 9
Route Refresh: 0 0
Capability: 0 0
Total: 18 14
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
Update group 2, subgroup 2
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 2; dropped 1
Last reset 00:00:28, No AFI/SAFI activated for peer
Message received that caused BGP to send a NOTIFICATION:
FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
004E0104 FE4D00B4 04040404 31020601
04000100 01020280 00020202 00020641
040000FE 4D020645 04000101 01020949
0705736F 6E696300 02044002 0078
Local host: 10.3.0.3, Local port: 179
Foreign host: 10.3.0.2, Foreign port: 49374
Nexthop: 10.3.0.3
Nexthop global: fe80::3e2c:99ff:fe8b:41bc
Nexthop local: fe80::3e2c:99ff:fe8b:41bc
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 2
Switch#2
sonic# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 4.4.4.4, local AS number 65101 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.3.0.3 4 65101 4 4 0 0 0 00:01:31 0
Total number of neighbors 1
sonic# show bgp neighbors
BGP neighbor is 10.3.0.3, remote AS 65101, local AS 65101, internal link
Hostname: sonic
BGP version 4, remote router ID 3.3.3.3, local router ID 4.4.4.4
BGP state = Established, up for 00:00:31
Last read 00:00:30, Last write 00:00:30
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 2 2
Notifications: 0 2
Updates: 2 2
Keepalives: 9 9
Route Refresh: 0 0
Capability: 0 0
Total: 13 15
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
Update group 2, subgroup 2
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 2; dropped 1
Last reset 00:00:33, Notification sent (Cease/Other Configuration Change)
Local host: 10.3.0.2, Local port: 49374
Foreign host: 10.3.0.3, Foreign port: 179
Nexthop: 10.3.0.2
Nexthop global: fe80::6f8:f8ff:fe8d:81e1
Nexthop local: fe80::6f8:f8ff:fe8d:81e1
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 28
Notice. If the BGP session is failed, user can run the bellowing command to quickly understand the reason for the failure.
sonic# show bgp summary failed
Step 7. Save the routing setting.
sonic# write
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/frr.conf
[OK]
Establish eBGP session
Topology:
Procedure:
Step 1. FRR config initialization (refer to this article)
Step 2. Configure IP address properly for BGP session (refer to this article)
Step 3. Enter Vty shell.
admin@sonic:~$ vtysh
Hello, this is FRRouting (version 7.2.1-sonic).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
sonic#
Note: vtysh provides a combined frontend to all FRR daemons in a single combined session.
Step 4. Assign the Router ID
Switch#1
sonic# configure terminal
sonic(config)# router-id 3.3.3.3
Switch#2
sonic# configure terminal
sonic(config)# router-id 4.4.4.4
Note: Router ID is used to identify routers in AS(autonomous systems).
Caution: Router ID must be unique for each BGP router in the network. Otherwise, it's failed to establish BGP session.
Step 5. Configuring BGP Neighbor Session
Switch#1
sonic# configure terminal
sonic(config)# router bgp 65000
sonic(config-router)# neighbor 10.3.0.2 remote-as 65001
Switch#2
sonic# configure terminal
sonic(config)# router bgp 65001
sonic(config-router)# neighbor 10.3.0.3 remote-as 65000
Step 6. Checking the neighbor status.(If the version is above the 202012 branch, please refer to the restrictions to avoid encountering a policy error.)
Switch#1
sonic# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 3.3.3.3, local AS number 65000 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.3.0.2 4 65001 13 22 0 0 0 00:00:41 0
Total number of neighbors 1
sonic# show bgp neighbors
BGP neighbor is 10.3.0.2, remote AS 65001, local AS 65000, external link
Hostname: sonic
BGP version 4, remote router ID 4.4.4.4, local router ID 3.3.3.3
BGP state = Established, up for 00:00:44
Last read 00:00:43, Last write 00:00:43
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 6 5
Notifications: 10 2
Updates: 3 3
Keepalives: 3 3
Route Refresh: 0 0
Capability: 0 0
Total: 22 13
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
Update group 4, subgroup 4
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 4; dropped 3
Last reset 00:00:46, No AFI/SAFI activated for peer
Message received that caused BGP to send a NOTIFICATION:
FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
004E0104 FDE900B4 04040404 31020601
04000100 01020280 00020202 00020641
040000FD E9020645 04000101 01020949
0705736F 6E696300 02044002 0078
Local host: 10.3.0.3, Local port: 179
Foreign host: 10.3.0.2, Foreign port: 47570
Nexthop: 10.3.0.3
Nexthop global: fe80::3e2c:99ff:fe8b:41bc
Nexthop local: fe80::3e2c:99ff:fe8b:41bc
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 29
Switch#2
sonic# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 4.4.4.4, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.3.0.3 4 65000 37 25 0 0 0 00:00:48 0
Total number of neighbors 1
sonic# show bgp neighbors
BGP neighbor is 10.3.0.3, remote AS 65000, local AS 65001, external link
Hostname: sonic
BGP version 4, remote router ID 3.3.3.3, local router ID 4.4.4.4
BGP state = Established, up for 00:00:50
Last read 00:00:49, Last write 00:00:49
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 12 12
Notifications: 2 18
Updates: 3 3
Keepalives: 8 4
Route Refresh: 0 0
Capability: 0 0
Total: 25 37
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
Update group 4, subgroup 4
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 4; dropped 3
Last reset 00:00:52, User reset
Local host: 10.3.0.2, Local port: 47570
Foreign host: 10.3.0.3, Foreign port: 179
Nexthop: 10.3.0.2
Nexthop global: fe80::6f8:f8ff:fe8d:81e1
Nexthop local: fe80::6f8:f8ff:fe8d:81e1
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 27
Step 7. Save the routing setting.
sonic# write
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/frr.conf
[OK]
Establish eBGP with peer group
Topology:
Procedure:
Step 1. FRR config initialization (refer to this article)
Step 2. Configure IP address properly for BGP session (refer to this article)
Step 3. Enter Vty shell.
admin@sonic:~$ vtysh
Hello, this is FRRouting (version 7.2.1-sonic).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
sonic#
Note: vtysh provides a combined frontend to all FRR daemons in a single combined session.
Step 4. Assign the Router ID
Switch#1
sonic# configure terminal
sonic(config)# router-id 1.1.1.1
Switch#2
sonic# configure terminal
sonic(config)# router-id 3.3.3.3
Switch#3
sonic# configure terminal
sonic(config)# router-id 4.4.4.4
Note: Router ID is used to identify routers in AS(autonomous systems).
Caution: Router ID must be unique for each BGP router in the network. Otherwise, it's failed to establish BGP session.
Step 5. Configuring BGP Neighbor Session
Switch#1Step 6. Checking the neighbor status.
sonic# configure terminal
sonic(config)# router bgp 65000
sonic(config-router)# neighbor 10.2.0.3 remote-as 65001
Switch#2
sonic# configure terminal
sonic(config)# router bgp 65001
sonic(config-router)# neighbor LEAF peer-group
sonic(config-router)# neighbor LEAF remote-as external
sonic(config-router)# neighbor 10.2.0.2 peer-group LEAF
sonic(config-router)# neighbor 10.3.0.2 peer-group LEAF
Switch#3
sonic# configure terminal
sonic(config)# router bgp 65002
sonic(config-router)# neighbor 10.3.0.3 remote-as 65001
Switch#1
sonic# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 1.1.1.1, local AS number 65000 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.2.0.3 4 65001 13 17 0 0 0 00:00:31 0
Total number of neighbors 1
sonic# show bgp neighbors
BGP neighbor is 10.2.0.3, remote AS 65001, local AS 65000, external link
Hostname: sonic
BGP version 4, remote router ID 3.3.3.3, local router ID 1.1.1.1
BGP state = Established, up for 00:00:40
Last read 00:00:39, Last write 00:00:38
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 6 4
Notifications: 4 2
Updates: 3 3
Keepalives: 4 4
Route Refresh: 0 0
Capability: 0 0
Total: 17 13
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)
0 accepted prefixes
Connections established 3; dropped 2
Last reset 00:00:42, No AFI/SAFI activated for peer
Message received that caused BGP to send a NOTIFICATION:
FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
004E0104 FDE900B4 03030303 31020601
04000100 01020280 00020202 00020641
040000FD E9020645 04000101 01020949
0705736F 6E696300 02044002 0078
Local host: 10.2.0.2, Local port: 179
Foreign host: 10.2.0.3, Foreign port: 59126
Nexthop: 10.2.0.2
Nexthop global: fe80::6f8:f8ff:fe6b:691
Nexthop local: fe80::6f8:f8ff:fe6b:691
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 29
Switch#2
sonic# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 3.3.3.3, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 2, using 41 KiB of memory
Peer groups 1, using 64 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.2.0.2 4 65000 12 12 0 0 0 00:00:30 0
10.3.0.2 4 65002 13 18 0 0 0 00:00:34 0
Total number of neighbors 2
sonic# show bgp neighbors
BGP neighbor is 10.2.0.2, remote AS 65000, local AS 65001, external link
Hostname: sonic
Member of peer-group LEAF for session parameters
BGP version 4, remote router ID 1.1.1.1, local router ID 3.3.3.3
BGP state = Established, up for 00:00:39
Last read 00:00:38, Last write 00:00:39
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 3 3
Notifications: 2 2
Updates: 3 3
Keepalives: 4 4
Route Refresh: 0 0
Capability: 0 0
Total: 12 12
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
LEAF peer-group member
Update group 2, subgroup 2
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 3; dropped 2
Last reset 00:00:41, Notification received (Cease/Administratively Reset)
Local host: 10.2.0.3, Local port: 59126
Foreign host: 10.2.0.2, Foreign port: 179
Nexthop: 10.2.0.3
Nexthop global: fe80::3e2c:99ff:fe8b:41bc
Nexthop local: fe80::3e2c:99ff:fe8b:41bc
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 28
BGP neighbor is 10.3.0.2, remote AS 65002, local AS 65001, external link
Hostname: sonic
Member of peer-group LEAF for session parameters
BGP version 4, remote router ID 4.4.4.4, local router ID 3.3.3.3
BGP state = Established, up for 00:00:43
Last read 00:00:42, Last write 00:00:43
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 5 4
Notifications: 6 2
Updates: 3 3
Keepalives: 4 4
Route Refresh: 0 0
Capability: 0 0
Total: 18 13
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
LEAF peer-group member
Update group 2, subgroup 2
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 3; dropped 2
Last reset 00:00:45, No AFI/SAFI activated for peer
Message received that caused BGP to send a NOTIFICATION:
FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
004E0104 FDEA00B4 04040404 31020601
04000100 01020280 00020202 00020641
040000FD EA020645 04000101 01020949
0705736F 6E696300 02044002 0078
Local host: 10.3.0.3, Local port: 179
Foreign host: 10.3.0.2, Foreign port: 52028
Nexthop: 10.3.0.3
Nexthop global: fe80::3e2c:99ff:fe8b:41bc
Nexthop local: fe80::3e2c:99ff:fe8b:41bc
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 30
Switch#3
sonic# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 4.4.4.4, local AS number 65002 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.3.0.3 4 65001 12 13 0 0 0 00:00:34 0
Total number of neighbors 1
sonic# show bgp neighbors
BGP neighbor is 10.3.0.3, remote AS 65001, local AS 65002, external link
Hostname: sonic
BGP version 4, remote router ID 3.3.3.3, local router ID 4.4.4.4
BGP state = Established, up for 00:00:43
Last read 00:00:43, Last write 00:00:42
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 4 3
Notifications: 2 2
Updates: 3 3
Keepalives: 4 4
Route Refresh: 0 0
Capability: 0 0
Total: 13 12
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)
0 accepted prefixes
Connections established 3; dropped 2
Last reset 00:00:45, Peer closed the session
Local host: 10.3.0.2, Local port: 52028
Foreign host: 10.3.0.3, Foreign port: 179
Nexthop: 10.3.0.2
Nexthop global: fe80::6f8:f8ff:fe8d:81e1
Nexthop local: fe80::6f8:f8ff:fe8d:81e1
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 28
Step 7. Save the routing setting.
sonic# write
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/frr.conf
[OK]
Establish iBGP with peer group auto-discovery
Topology:
Procedure:
Step 1. FRR config initialization (refer to this article)
Step 2. Configure IP address properly for BGP session (refer to this article)
Step 3. Enter Vty shell.
admin@sonic:~$ vtysh
Hello, this is FRRouting (version 7.2.1-sonic).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
sonic#
Note: vtysh provides a combined frontend to all FRR daemons in a single combined session.
Step 4. Assign the Router ID
Switch#1
sonic# configure terminal
sonic(config)# router-id 1.1.1.1
Switch#2
sonic# configure terminal
sonic(config)# router-id 3.3.3.3
Switch#3
sonic# configure terminal
sonic(config)# router-id 4.4.4.4
Note: Router ID is used to identify routers in AS(autonomous systems).
Caution: Router ID must be unique for each BGP router in the network. Otherwise, it's failed to establish BGP session.
Step 5. Configuring BGP Neighbor Session
Switch#1
sonic# configure terminal
sonic(config)# router bgp 65001
sonic(config-router)# neighbor 10.2.0.3 remote-as 65001
Switch#2
sonic# configure terminal
sonic(config)# router bgp 65001
sonic(config-router)# neighbor LEAF peer-group
sonic(config-router)# neighbor LEAF remote-as 65001
sonic(config-router)# bgp listen range 10.0.0.0/8 peer-group LEAF
Switch#3
sonic# configure terminal
sonic(config)# router bgp 65001
sonic(config-router)# neighbor 10.3.0.3 remote-as 65001
Step 6. Checking the neighbor status.
Switch#1
sonic# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 1.1.1.1, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.2.0.3 4 65001 3 4 0 0 0 00:00:55 0
Total number of neighbors 1
sonic# show bgp neighbors
BGP neighbor is 10.2.0.3, remote AS 65001, local AS 65001, internal link
Hostname: sonic
BGP version 4, remote router ID 3.3.3.3, local router ID 1.1.1.1
BGP state = Established, up for 00:00:58
Last read 00:00:57, Last write 00:00:57
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 2 1
Notifications: 0 0
Updates: 1 1
Keepalives: 1 1
Route Refresh: 0 0
Capability: 0 0
Total: 4 3
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
Update group 1, subgroup 1
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 1; dropped 0
Last reset 00:02:10, Waiting for NHT
Local host: 10.2.0.2, Local port: 35220
Foreign host: 10.2.0.3, Foreign port: 179
Nexthop: 10.2.0.2
Nexthop global: fe80::6f8:f8ff:fe6b:691
Nexthop local: fe80::6f8:f8ff:fe6b:691
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 28
Switch#2
sonic# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 3.3.3.3, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 2, using 41 KiB of memory
Peer groups 1, using 64 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
*10.2.0.2 4 65001 12 12 0 0 0 00:09:50 0
*10.3.0.2 4 65001 12 12 0 0 0 00:09:50 0
Total number of neighbors 2
* - dynamic neighbor
2 dynamic neighbor(s), limit 100
sonic# show bgp neighbors
BGP neighbor is *10.2.0.2, remote AS 65001, local AS 65001, internal link
Hostname: sonic
Member of peer-group LEAF for session parameters
Belongs to the subnet range group: 10.0.0.0/8
BGP version 4, remote router ID 1.1.1.1, local router ID 3.3.3.3
BGP state = Established, up for 00:09:54
Last read 00:00:54, Last write 00:00:54
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 1 1
Keepalives: 10 10
Route Refresh: 0 0
Capability: 0 0
Total: 12 12
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
LEAF peer-group member
Update group 1, subgroup 1
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 1; dropped 0
Last reset 00:09:54, No AFI/SAFI activated for peer
Local host: 10.2.0.3, Local port: 179
Foreign host: 10.2.0.2, Foreign port: 35220
Nexthop: 10.2.0.3
Nexthop global: fe80::3e2c:99ff:fe8b:41bc
Nexthop local: fe80::3e2c:99ff:fe8b:41bc
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 29
BGP neighbor is *10.3.0.2, remote AS 65001, local AS 65001, internal link
Hostname: sonic
Member of peer-group LEAF for session parameters
Belongs to the subnet range group: 10.0.0.0/8
BGP version 4, remote router ID 4.4.4.4, local router ID 3.3.3.3
BGP state = Established, up for 00:09:54
Last read 00:00:54, Last write 00:00:54
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 1 1
Keepalives: 10 10
Route Refresh: 0 0
Capability: 0 0
Total: 12 12
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
LEAF peer-group member
Update group 1, subgroup 1
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 1; dropped 0
Last reset 00:09:54, No AFI/SAFI activated for peer
Local host: 10.3.0.3, Local port: 179
Foreign host: 10.3.0.2, Foreign port: 53426
Nexthop: 10.3.0.3
Nexthop global: fe80::3e2c:99ff:fe8b:41bc
Nexthop local: fe80::3e2c:99ff:fe8b:41bc
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 28
Switch#3
sonic# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 4.4.4.4, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.3.0.3 4 65001 3 4 0 0 0 00:00:56 0
Total number of neighbors 1
sonic# show bgp neighbors
BGP neighbor is 10.3.0.3, remote AS 65001, local AS 65001, internal link
Hostname: sonic
BGP version 4, remote router ID 3.3.3.3, local router ID 4.4.4.4
BGP state = Established, up for 00:00:59
Last read 00:00:57, Last write 00:00:57
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: sonic,domain name: n/a)
Graceful Restart Capabilty: 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
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 2 1
Notifications: 0 0
Updates: 1 1
Keepalives: 1 1
Route Refresh: 0 0
Capability: 0 0
Total: 4 3
Minimum time between advertisement runs is 0 seconds
For address family: IPv4 Unicast
Update group 1, subgroup 1
Packet Queue length 0
Community attribute sent to this neighbor(all)
0 accepted prefixes
Connections established 1; dropped 0
Last reset 00:02:22, Waiting for NHT
Local host: 10.3.0.2, Local port: 53426
Foreign host: 10.3.0.3, Foreign port: 179
Nexthop: 10.3.0.2
Nexthop global: fe80::6f8:f8ff:fe8d:81e1
Nexthop local: fe80::6f8:f8ff:fe8d:81e1
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on Write thread: on FD used: 28
Step 7. Save the routing setting.
sonic# write
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/frr.conf
[OK]
Comments
0 comments
Please sign in to leave a comment.