#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. |
#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. |
#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. |
#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. |