OcNOS-SP : Layer 3 Guide : Layer 3 Unicast Configuration Guide : BGP : Add Multiple Instances of the Same Autonomous System
Add Multiple Instances of the Same Autonomous System
BGP supports adding the same AS number multiple times to influence the route selection process. This can be done using route maps, as described below.
Under normal circumstances, any route advertised by R1 is sent to R4 via two different routes, and then R4 selects the path from R2. This decision can be influenced by adding multiple instances of AS number 200 at R2.
Topology
Figure 1-19: Multiple Instances of Same AS
R1
 
#configure terminal
Enter configure mode.
(config)#interface lo
Enter loopback interface mode.
(config-if)#ip address 44.44.44.1/24 secondary
Specify the IP address for the interface.
(config-if)#exit
Exit loopback interface mode.
(config)#router bgp 100
Define the routing process with AS number 100.
(config-router)#neighbor 172.1.2.112 remote-
 
as 200
Define neighbor R2. 172.1.2.112 is the IP address of R2, and 200 is the AS number.
(config-router)#neighbor 172.1.3.113 remote-
 
as 300
Define neighbor R3. 172.1.3.113 is the IP address of R2, and 300 is the AS number.
(config-router)#address-family ipv4 unicast
Enter address-family ipv4 unicast mode
(config-router-af)# neighbor 172.1.2.112 activate
Activate neighbor under address family mode
(config-router-af)# neighbor 172.1.2.113 activate
Activate neighbor under address family mode
(config-router-af)#network 44.44.44.0/24
Advertise network 44.44.44.0/24 through BGP. This route reaches R4 via R2 and R3.
(config-router-af)# exit-address-family
Exit address-family mode.
(config-router)#commit
Commit the candidate configuration to the running configuration.
R2
 
#configure terminal
Enter configure mode.
(config)#route-map mul_inst permit 10
Define the route-map multiple instance with permit definition sequence number 10.
(config-route-map)#set as-path prepend 200 200
Prepend AS number 200 two times to the AS_PATH attribute in the BGP Update message.
(config-route-map)#exit
Exit Route-map mode, and return to Configure mode.
(config)#router bgp 200
Define the routing process with AS number 200.
(config-router)#neighbor 172.1.2.111 remote-as 100
Define neighbor R1. 172.1.2.111 is the IP address of R1, and 100 is the AS number.
(config-router)#neighbor 172.2.4.114 remote-as 400
Define neighbor R4. 172.2.4.114 is the IP address of R2, and 400 is the AS number.
(config-router)#address-family ipv4 unicast
Enter address-family ipv4 unicast mode
(config-router-af)# neighbor 172.2.4.114 activate
Activate neighbor under address family mode
(config-router-af)# neighbor 172.1.2.111 activate
Activate neighbor under address family mode
(config-router-af)#neighbor 172.2.4.114 route-map mul_inst out
Apply route-map multi_inst to all outbound routes to R4
(config-router-af)# exit-address-family
Exit address-family mode.
(config-router)#commit
Commit the candidate configuration to the running configuration.
R3
 
#configure terminal
Enter configure mode.
(config)#router bgp 300
Define the routing process with AS number 300.
(config-router)#neighbor 172.1.3.111 remote-as 100
Define neighbor R1. 172.1.3.111 is the IP address of R1, and 100 is the AS number.
(config-router)#neighbor 172.3.4.114 remote-as 400
Define neighbor R4. 172.3.4.114 is the IP address of R4, and 400 is the AS number.
(config-router)#address-family ipv4 unicast
Enter address-family ipv4 unicast mode
(config-router-af)# neighbor 172.3.4.114 activate
Activate neighbor under address family mode
(config-router-af)# neighbor 172.1.3.111 activate
Activate neighbor under address family mode
(config-router-af)# exit-address-family
Exit address-family mode.
(config-router)#commit
Commit the candidate configuration to the running configuration.
R4
 
#configure terminal
Enter configure mode.
(config)#router bgp 400
Define the routing process with AS number 400.
(config-router)#neighbor 172.2.4.112 remote-as 200
Define neighbor R2. 172.2.4.112 is the IP address of R2, and 200 is the AS number.
(config-router)#neighbor 172.3.4.113 remote-as 300
Define neighbor R3. 172.3.4.113 is the IP address of R3, and 300 is the AS number.
(config-router)#address-family ipv4 unicast
Enter address-family ipv4 unicast mode
(config-router-af)# neighbor 172.2.4.112 activate
Activate neighbor under address family mode
(config-router-af)# neighbor 172.3.4.113 activate
Activate neighbor under address family mode
(config-router-af)# exit-address-family
Exit address-family mode.
(config-router)#commit
Commit the candidate configuration to the running configuration.
Validation
#show ip bgp
BGP table version is 1, local router ID is 44.44.44.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
 
Network Next Hop Metric LocPrf Weight Path
*> 44.44.44.0/24 0.0.0.0 0 100 32768 i
 
Total number of prefixes 1
Last modified date: 10/16/2023