BGP Configuration For CCNP Students by Eng. Abeer Hosni
BGP Configuration For CCNP Students by Eng. Abeer Hosni
BGP Configuration For CCNP Students by Eng. Abeer Hosni
BGP configuration
for
CCNP Students
By
Eng. Abeer Hosni
BGP
lab 1 (BGP peers and advertising networks):
Objectives:
1- Run OSPF on routers R1, R2, R3 and R4.
2- Configure the appropriate BGP neighbor relationships between the appropriate routers.
4- Advertise the 200.1.1.0/24 to the 200.1.4.0/24 networks using the redistribution way.
Solution:
1- Run OSPF on routers R1, R2, R3 and R4.
R1(config)#int s1/0
R1(config-if)#no shutdown
R1(config-if)#int s1/1
R1(config-if)#no shutdown
R1(config-if)#int loop 1
R1(config-if)#router ospf 1
R2(config)#int s1/0
R2(config-if)#no shutdown
R2(config-if)#int s1/1
R2(config-if)#no shutdown
R2(config-if)#int loop 2
R2(config-if)#router ospf 1
R3(config)#int s1/0
R3(config-if)#no shutdown
R3(config-if)#int s1/1
R3(config-if)#no shutdown
R3(config-if)#int loop 3
R3(config-if)#ip address 3.3.3.3 255.255.255.255
R3(config-if)#router ospf 1
R4(config)#int s1/0
R4(config-if)#no shutdown
R4(config-if)#int s1/1
R4(config-if)#no shutdown
R4(config-if)#int s1/2
R4(config-if)#no shutdown
R4(config-if)#int loop 4
R4(config-if)#router ospf 1
R4(config-router)#exit
R5(config)#int s1/0
R5(config-if)#no shutdown
R5(config-if)#int loop 0
R5(config-if)#int loop 1
R5(config-if)#int loop 2
R5(config-if)#int loop 3
R5(config-if)#int loop 4
R5(config-if)#int loop 5
R5(config-if)#int loop 6
R5(config-if)#exit
r RIB-failure, S Stale
R4#show ip bgp
r RIB-failure, S Stale
r RIB-failure, S Stale
4- Advertise the 200.1.1.0/24 to the 200.1.4.0/24 networks using the redistribution way.
R5(config)#route-map FILTER
R5(config-route-map)#match ip address 1
r RIB-failure, S Stale
R4#show ip bgp
r RIB-failure, S Stale
R1#show ip bgp
r RIB-failure, S Stale
1- BGP synchronization role: Don't use or advertise a route learned via iBGP until the same route
has been learned from the internal routing protocol.
no synchronization
bgp log-neighbor-changes
no auto-summary
R4#show ip bgp
r RIB-failure, S Stale
R1#show ip bgp
r RIB-failure, S Stale
R4(config-router)#exit
R4#clear ip bgp *
R1#show ip bgp
r RIB-failure, S Stale
But the network is still unpingable as R2 and R3 don't know anything about those networks, so
we will configure BGP on R2 and R3 using the peer groups.
We have built a full iBGP neighbor relationship between all routers because of the split horizon rule.
Split Horizon rule: Don't send updates that you received via iBGP to other iBGP peers.
R1#ping 50.1.1.5
!!!!!
R1#ping 200.1.1.5
!!!!!
Objective:
Configure eBGP peering between R1 and R2 using their loopback interfaces.
Configuration:
R1(config)#int s1/0
R1(config-if)#no shutdown
R1(config-if)#int s1/1
R1(config-if)#no shutdown
R1(config-if)#int loop 1
R1(config-if)#exit
R2(config)#int s1/0
R2(config-if)#no shutdown
R2(config-if)#int s1/1
R2(config-if)#no shutdown
R2(config-if)#int loop 2
R2(config-if)#exit
But the adjacency doesn’t come up as the TTL value for the eBGP control plane is 1 by default.
<Output omitted>
<Output omitted>
<Output omitted>
R1(config)#int s1/0
R1(config-if)#no shutdown
R1(config-if)#int s1/1
R1(config-if)#no shutdown
R1(config-if)#int loop 1
R1(config)#router ospf 1
R2(config)#int s1/0
R2(config-if)#int s1/1
R2(config-if)#no shutdown
R2(config-if)#int s1/2
R2(config-if)#no shutdown
R2(config-if)#int loop 2
R2(config)#router ospf 1
R3(config)#int s1/0
R3(config-if)#no shutdown
R3(config-if)#int s1/1
R3(config-if)#no shutdown
R3(config-if)#int s1/2
R3(config-if)#no shutdown
R3(config-if)#int loop3
R3(config)#router ospf 1
R4(config)#int s1/0
R4(config-if)#no shutdown
R4(config-if)#int s1/1
R4(config-if)#no shutdown
R5(config)#int s1/0
R5(config-if)#no shutdown
R5(config-if)#int s1/1
R5(config-if)#no shutdown
R5(config-if)#int loop 1
R5(config-if)#int loop 2
R6(config)#int s1/0
R6(config-if)#no shutdown
R6(config-if)#int s1/1
R6(config-if)#no shutdown
R7(config)#int s1/0
R7(config-if)#no shutdown
R7(config-if)#int s1/1
R7(config-if)#no shutdown
R7(config-if)#int loop 1
R7(config-if)#int loop 2
Now we will run BGP:
R1(config-router)#neighbor G peer-group
R1(config-router)#neighbor G next-hop-self
Now we will advertise the networks:
R5(config)#router bgp 911
R5(config-router)#network 150.1.50.0 mask 255.255.255.0
R5(config-router)#network 150.2.50.0 mask 255.255.255.0
R7(config-router)#redistribute connected
R1#show ip bgp
r RIB-failure, S Stale
Notice that R1 has chosen the routes via the shortest AS path.
The Weight attribute (default is 0):
We will change the weight attribute so that the 150.1.50.0/24 and 150.2.50.0/24 networks are
reached via R3.
R1#show ip bgp
r RIB-failure, S Stale
The Origin attribute:
e: The route was learned via the EGP protocol and we should never see that code.
The Local Preference attribute (default is 100):
R1(config)#router bgp 5500
R1(config-router)#no neighbor 3.3.3.3 weight 100
We will configure R3 to be the preferred path to reach all networks.
R3(config)#router bgp 5500
R3(config-router)#bgp default local-preference 500
R1#show ip bgp
r RIB-failure, S Stale
Now we make R3 is the preferred for the 150.1.50.0/24 and 150.2.50.0/24 networks, while
R2 will be the preferred path to reach the 200.50.2.0/24 and 200.60.2.0/24 networks.
R3(config)#route-map FILTER
R3(config-route-map)#match ip address 1
R3(config-route-map)#set local
R3(config-route-map)#match ip address 2
R3(config-route-map)#set local-preference 50
R1#clear ip bgp *
R1#show ip bgp
r RIB-failure, S Stale
The MED (Multiexit-discriminator):
It is a suggestion to other ASs.
R3(config)#router bgp 5500
R3(config-router)#default-metric 200
R1#clear ip bgp *
R1#show ip bgp
r RIB-failure, S Stale
R1(config)#int s1/0
R1(config-if)#no shutdown
R2(config)#int s1/0
R2(config-if)#no shutdown
R2(config-if)#int loop 16
R2(config-if)#int loop 17
R2(config-if)#ip address 17.1.1.2 255.0.0.0
R2(config-if)#int loop 18
R2(config-if)#int loop 19
R1#show ip bgp
r RIB-failure, S Stale
R1#clear ip bgp *
R1#show ip bgp
r RIB-failure, S Stale
Notice that you can see the summarized route and the more specific routes. To see the summarized
route only, we will use the summary-only option.
R1#clear ip bgp *
R1#show ip bgp
r RIB-failure, S Stale
Objective:
Configure MP-BGP to support IPV6 for the previous topology.
Configuration:
R1(config)#int f0/0
R1(config-if)#ipv6 address 2001:ab::1/64
R1(config-if)#no shutdown
R1(config-if)#int loop 1
R1(config-if)#ipv6 address 2001::1/128
R1(config-if)#exit
R1(config)#ipv6 unicast-routing
R2(config)#int f0/0
R2(config-if)#ipv6 address 2001:ab::2/64
R2(config-if)#no shutdown
R2(config-if)#int loop 2
R2(config-if)#ipv6 address 2001::2/128
R2(config-if)#exit
R2(config)#ipv6 unicast-routing
Since the two routers are neighbors, we can advertise the networks using the
network command or redistribution.
To verify:
R1#show bgp ipv6 unicast summary
<Output omitted>
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2001:AB::2 4 200 20 21 4 0 0 00:14:41 1
R1#ping 2001::2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001::2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/21/36 ms
R2#ping 2001::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/25/36 ms
Bonus Lab (MP-BGP for IPV6): (Supported on older IOS
versions)
Objective:
Configure BGP to advertise the IPV4 network over IPV6 for the previous topology.
Configuration:
R1(config)#int f0/0
R1(config-if)#ipv6 address 2001:ab::1/64
R1(config-if)#ip address 10.0.0.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#int loop 1
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#exit
R1(config)#ipv6 unicast-routing
R2(config)#int f0/0
R2(config-if)#ipv6 address 2001:ab::2/64
R2(config-if)#ip address 10.0.0.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#int loop 2
R2(config-if)#ip address 2.2.2.2 255.255.255.255
R2(config-if)#exit
R2(config)#ipv6 unicast-routing
R1#show ip bgp
<Output omitted>
Network Next Hop Metric LocPrf Weight Path
* 2.2.2.2/32 32.1.0.171 0 0 200 i
But notice the next hop which is not known for R1. To solve that problem:
R1(config)#route-map PEER
R1(config-route-map)#set ip next-hop 10.0.0.2
R1(config-route-map)#router bgp 100
R1(config-router)#neighbor 2001:ab::2 route-map PEER in
To verify:
R1#clear ip bgp *
R1#show ip bgp
<Output omitted>
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 10.0.0.2 0 0 200 i
R1#show ip route bgp
2.0.0.0/32 is subnetted, 1 subnets
B 2.2.2.2 [20/0] via 10.0.0.2, 00:01:37
R1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 8/55/100 ms
Best wishes
Abeer