BGP Configuration on Asterfusion Enterprise SONiC Distribution Switch
- 1 Purpose
- 2 Model and Version
- 3 BGP introduction
- 4 Basic BGP configuration instructions
- 4.1 Configure AS number and router-id
- 4.2 Configure BGP neighbors
- 4.3 Configure the AS-Path relax switch
- 4.4 Configure BGP and BFD association
- 5 BGP configuration typical scenario
- 5.1 Requirements
- 5.2 Topology
- 5.3 Testing environment
- 5.4 Preparation before testing
- 5.5 Configuration steps
- 5.6 Verify network configuration
- 6 Conclusion
- Asterfusion CX-N data center switches as the links below
1 Purpose
This article mainly explains the BGP configuration and solution on Asterfusion enterprise SONiC switches.
By reading this article, users can quickly understand and master the configuration method of BGP on the Asterfusion SONiC switch.
2 Model and Version
Model:
CX-N series switches
Version:
AsterNOSv3.1
3 BGP introduction
BGP (Border Gateway Protocol) is a distance vector routing protocol that implements reachability between ASs (Autonomous Systems) and selects the best route. Defined by RFC4271.
AS (Autonomous System) represents an independent network collection composed of a group of routers and network devices. Each autonomous system has a unique autonomous system number (Autonomous System Number, ASN), which is used to identify and identify the autonomous system. All routers in an AS must be connected to each other and run the same routing protocol.
MP-BGP (Multiprotocol Extensions for BGP-4). Traditional BGP-4 can only manage IPV4 routing information. Applications that use other network layer protocols (such as ipv6) are subject to certain restrictions when propagated across autonomous systems. In order to provide support for multiple network layer protocols, the IETF extended BGP-4 to form MP-BGP, which is defined by RFC4760 and RFC7606.
4 Basic BGP configuration instructions
CX-N series switches running AsterNOS support MP-BGP protocol, ECMP, and linkage with BFD, thereby providing a multi-protocol-supported and stable network for the data center network.
4.1 Configure AS number and router-id
router bgp asn #Configure local AS number.
bgp router-id ip_addr #Configure router id.
Example:
sonic(config)# router bgp 65001
sonic(config-router)# bgp router-id 172.16.0.1
4.2 Configure BGP neighbors
router bgp asn #Enter bgp view, asn is the local as number.
neighbor neighbor_ip remote-as asn #Add a bgp neighbor, neighbor_ip is the neighbor’s IP address, and asn is the neighbor’s AS number.
Example:
sonic(config)# router bgp 65001
sonic(config-router)# neighbor 10.0.10.11 remote-as 65002
4.3 Configure the AS-Path relax switch
This switch determines how the same route from different AS domains is handled:
When the switch is turned on, the next hop of the same route from different AS domains will be an ecmp group; at this time, traffic load balancing can be achieved.
When the switch is turned off, only one route will be selected for delivery.
router bgp asn # Enter bgp view, asn is the local as number.
bgp bestpath as-path multipath-relax as-set #Turn on the AS-Path relax switch.
Example:
sonic(config)# router bgp 65001
sonic(config-router)# bgp bestpath as-path multipath-relax as-set
4.4 Configure BGP and BFD association
router bgp asn # Enter bgp view, asn is the local as number.
neighbor {ipaddr | hostname} bfd #bfd bind bgp session.
Example:
sonic(config)# router bgp 65001
sonic(config-router)# neighbor 10.0.11.11 bfd
5 BGP configuration typical scenario
5.1 Requirements
The user has two servers and requires the hosts to be connected through three switches and run the BGP protocol. Enable server-1 connected leaf1 and server-2 connected leaf2 to communicate with each other.
5.2 Topology
5.3 Testing environment
Hardware
|
Software
|
Management IP
|
Interconnection IP
|
5.4 Preparation before testing
Ensure each device is correctly connected according to the topology diagram.
5.5 Configuration steps
Step 1
Configure the interconnection IP addresses of three switches.
Spine
sonic# configure terminal
sonic(config)# interface ethernet 0/1
sonic(config-if-0/1)# ip address 10.0.10.1/24
sonic(config-if-0/1)# interface ethernet 0/2
sonic(config-if-0/2)# ip address 10.0.11.1/24
sonic(config-if-0/2)# exit
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip address 172.16.0.1/32
sonic(config-loif-0)#exit
Leaf1
sonic# configure terminal
sonic(config)# interface ethernet 0/1
sonic(config-if-0/1)# ip address 192.168.0.1/24
sonic(config-if-0/1)# interface ethernet 0/2
sonic(config-if-0/2)# ip address 10.0.10.11/24
sonic(config-if-0/2)# exit
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip address 172.16.0.2/32
sonic(config-loif-0)#exit
Leaf2
sonic# configure terminal
sonic(config)# interface ethernet 0/1
sonic(config-if-0/1)# ip address 192.168.1.1/24
sonic(config-if-0/1)# interface ethernet 0/2
sonic(config-if-0/2)# ip address 10.0.11.11/24
sonic(config-if-0/2)# exit
sonic(config)# interface loopback 0
sonic(config-loif-0)# ip address 172.16.0.3/32
sonic(config-loif-0)#exit
Step 2
Configure bgp of 3 switches.
Spine
sonic(config)# router bgp 65001
sonic(config-router)# bgp router-id 172.16.0.1
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.0.10.11 remote-as 65002
sonic(config-router)# neighbor 10.0.11.11 remote-as 65003
sonic(config-router)# address-family ipv4
sonic(config-router-af)# redistribute connected
Leaf1
sonic(config)# router bgp 65002
sonic(config-router)# bgp router-id 172.16.0.2
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.0.10.1 remote-as 65001
sonic(config-router)# address-family ipv4
sonic(config-router-af)# redistribute connected
Leaf2
sonic(config)# router bgp 65003
sonic(config-router)# bgp router-id 172.16.0.3
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.0.11.1 remote-as 65001
sonic(config-router)# address-family ipv4
sonic(config-router-af)# redistribute connected
Step 3
Configure the IP addresses of 2 servers.
Server-1
[root@localhost ~]# ifconfig eth0 192.168.0.11/24
[root@localhost ~]# route add default gw 192.168.0.1
Server-2
[root@localhost ~]# ifconfig eth0 192.168.1.11/24
[root@localhost ~]# route add default gw 192.168.1.1
5.6 Verify network configuration
1. Each server can ping each other successfully.
2. Check the bgp status of each switch.
Spine
sonic# show bgp summary
Leaf1
sonic# show bgp summary
Leaf2
sonic# show bgp summary
From the results, we can see that the bgp status of each switch is normal.
6 Conclusion
In this test, two servers can ping each other, and three switches can establish BGP neighbors and transmit routing information, indicating that the bgp functions of each switch are normal.
Asterfusion CX-N data center switches as the links below
If you have more technical questions, feel free to propose a ticket on our https://help.cloudswit.ch/portal/en/signin