#configure terminal | Enter Configure mode. |
(config)#interface xe5 | Enter Interface mode |
(config-if)# ip address 5.5.5.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe20 | Enter Interface mode |
(config-if)# ip address 20.1.1.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 100 | Enter Router BGP mode |
(config-router)# neighbor 5.5.5.2 remote-as 200 | Define BGP neighbors. 5.5.5.2 is the IP address of the neighbor (R2) and 200 is the neighbors AS number |
(config-router)# address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#neighbor 5.5.5.2 activate | Activate the neighbor |
(config-router-af)#network 20.1.1.0/24 | Advertise networks with prefix |
(config-router-af)# commit | Commit the configurations |
(config-router-af)# end | Return to privilege mode |
#configure terminal | Enter Configure mode. |
(config)#interface xe5 | Enter Interface mode |
(config-if)# ip address 5.5.5.2/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe1 | Enter Interface mode |
(config-if)# ip address 1.1.1.2/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 200 | Enter Router BGP mode |
(config-router)# neighbor 5.5.5.1 remote-as 100 | Define BGP neighbors. 5.5.5.1 is the IP address of the neighbor (R1) and 100 is the neighbors AS number |
(config-router)# neighbor 1.1.1.1 remote-as 300 | Define BGP neighbors. 1.1.1.1 is the IP address of the neighbor (R3) and 100 is the neighbors AS number |
(config-router)# address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#neighbor 5.5.5.1 activate | Activate the neighbor |
(config-router-af)#neighbor 1.1.1.1 activate | Activate the neighbor |
(config-router-af)# commit | Commit the configurations |
(config-router-af)# end | Return to privilege mode |
#configure terminal | Enter Configure mode. |
(config)#interface xe1 | Enter Interface mode |
(config-if)# ip address 1.1.1.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe18 | Enter Interface mode |
(config-if)# ip address 18.1.1.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 300 | Enter Router BGP mode |
(config-router)# neighbor 1.1.1.2 remote-as 200 | Define BGP neighbors. 1.1.1.2 is the IP address of the neighbor (R2) and 200 is the neighbors AS number |
(config-router)# address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#neighbor 1.1.1.2 activate | Activate the neighbor |
(config-router-af)#network 18.1.1.0/24 | Advertise networks with prefix |
(config-router-af)# commit | Commit the configurations |
(config-router-af)# end | Return to privilege mode |
#configure terminal | Enter Configure mode. |
(config)#route-map D permit 10 | Enter Route-map mode to set the match operation |
(config-route-map)#set community no-export 65535:666 additive | Configure Reserved Black hole community in Route-map mode |
(config-route-map)#commit | Commit the configuration |
(config-route-map)#exit | Return to configuration mode |
(config)#router bgp 300 | Enter Router BGP mode |
(config-router)#address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#neighbor 1.1.1.2 route-map D out | Apply Route-map for the neighbor 1.1.1.2 in out direction |
(config-router-af)#commit | Commit the configurations |
(config-router-af)#end | Return to privilege mode |
#clear ip bgp * soft out | Soft reset after applying Route-map |