BGP Configuration For CCNP Students by Eng. Abeer Hosni

Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

2018

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.

3- Advertise the 50.1.1.0 network using the network command.

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)#ip address 10.1.13.1 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#int s1/1

R1(config-if)#ip address 10.1.12.1 255.255.255.0

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)#router ospf 1

R1(config-router)#network 1.1.1.1 0.0.0.0 area 0

R1(config-router)#network 10.1.13.1 0.0.0.0 area 0

R1(config-router)#network 10.1.12.1 0.0.0.0 area 0

R2(config)#int s1/0

R2(config-if)#ip address 10.1.24.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#int s1/1

R2(config-if)#ip address 10.1.12.2 255.255.255.0

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)#router ospf 1

R2(config-router)#network 10.1.24.2 0.0.0.0 area 0

R2(config-router)#network 10.1.12.2 0.0.0.0 area 0

R2(config-router)#network 2.2.2.2 0.0.0.0 area 0

R3(config)#int s1/0

R3(config-if)#ip address 10.1.13.3 255.255.255.0

R3(config-if)#no shutdown

R3(config-if)#int s1/1

R3(config-if)#ip address 10.1.34.3 255.255.255.0

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

R3(config-router)#network 10.1.13.3 0.0.0.0 area 0

R3(config-router)#network 10.1.34.3 0.0.0.0 area 0

R3(config-router)#network 3.3.3.3 0.0.0.0 area 0

R4(config)#int s1/0

R4(config-if)#ip address 10.1.24.4 255.255.255.0

R4(config-if)#no shutdown

R4(config-if)#int s1/1

R4(config-if)#ip address 10.1.34.4 255.255.255.0

R4(config-if)#no shutdown

R4(config-if)#int s1/2

R4(config-if)#ip address 10.1.45.4 255.255.255.0

R4(config-if)#no shutdown

R4(config-if)#int loop 4

R4(config-if)#ip address 4.4.4.4 255.255.255.255

R4(config-if)#router ospf 1

R4(config-router)#network 10.1.24.4 0.0.0.0 area 0

R4(config-router)#network 10.1.34.4 0.0.0.0 area 0

R4(config-router)#network 4.4.4.4 0.0.0.0 area 0

R4(config-router)#exit

R4(config)#ip route 0.0.0.0 0.0.0.0 s1/2

R5(config)#int s1/0

R5(config-if)#ip address 10.1.45.5 255.255.255.0

R5(config-if)#no shutdown
R5(config-if)#int loop 0

R5(config-if)#ip address 50.1.1.5 255.255.255.0

R5(config-if)#int loop 1

R5(config-if)#ip address 50.1.1.5 255.255.255.0

R5(config-if)#int loop 2

R5(config-if)#ip address 200.1.2.5 255.255.255.0

R5(config-if)#int loop 3

R5(config-if)#ip address 200.1.3.5 255.255.255.0

R5(config-if)#int loop 4

R5(config-if)#ip address 200.1.4.5 255.255.255.0

R5(config-if)#int loop 5

R5(config-if)#ip address 200.1.5.5 255.255.255.0

R5(config-if)#int loop 6

R5(config-if)#ip address 200.1.6.5 255.255.255.0

R5(config-if)#exit

R5(config)#ip route 10.1.12.0 255.255.255.0 s1/0

R5(config)#ip route 10.1.13.0 255.255.255.0 s1/0

R5(config)#ip route 10.1.24.0 255.255.255.0 s1/0

R5(config)#ip route 10.1.34.0 255.255.255.0 s1/0

2- Configure BGP neighbor relationships as shown in the diagram.

>> The eBGP neighbor relationship:

R4(config)#router bgp 5500

R4(config-router)#neighbor 10.1.45.5 remote-as 6500

R5(config)#router bgp 6500

R5(config-router)#neighbor 10.1.45.4 remote-as 5500


Note)

We can run only one BGP process on the router.

R4#show ip bgp summary

BGP router identifier 4.4.4.4, local AS number 5500

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

10.1.45.5 4 6500 3 3 1 0 00:00:47 0

R5#show ip bgp summary

BGP router identifier 200.1.6.5, local AS number 6500

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

10.1.45.4 4 5500 5 5 1 0 0 00:02:06 0

>> The iBGP neighbor relationship:

R1(config)#router bgp 5500

R1(config-router)#neighbor 4.4.4.4 remote-as 5500

R1(config-router)#neighbor 4.4.4.4 update-source loop 1

R4(config)#router bgp 5500

R4(config-router)#neighbor 1.1.1.1 remote-as 5500

R4(config-router)#neighbor 1.1.1.1 update-source loop 4

R1#show ip bgp summary

BGP router identifier 1.1.1.1, local AS number 5500

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd


4.4.4.4 4 5500 4 4 1 0 0 00:00:08 0

R4#show ip bgp summary

BGP router identifier 4.4.4.4, local AS number 5500

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

1.1.1.1 4 5500 5 5 1 0 0 00:01:54 0

10.1.45.5 4 6500 15 15 1 0 0 00:12:07 0

3- Advertise the 50.1.1.0 network using the network command.

R5(config)#router bgp 6500

R5(config-router)#network 50.1.1.0 mask 255.255.255.0

R5(config-router)#do show ip bgp

BGP table version is 6, local router ID is 200.1.6.5

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*> 50.1.1.0/24 0.0.0.0 0 32768 i

R4#show ip bgp

BGP table version is 6, local router ID is 4.4.4.4

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*> 50.1.1.0/24 10.1.45.5 0 0 6500 i


R1#show ip bgp

BGP table version is 1, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

* i50.1.1.0/24 10.1.45.5 0 100 0 6500 i

4- Advertise the 200.1.1.0/24 to the 200.1.4.0/24 networks using the redistribution way.

R5(config)#access-list 1 permit 200.1.1.0 0.0.0.255

R5(config)#access-list 1 permit 200.1.2.0 0.0.0.255

R5(config)#access-list 1 permit 200.1.3.0 0.0.0.255

R5(config)#access-list 1 permit 200.1.4.0 0.0.0.255

R5(config)#route-map FILTER

R5(config-route-map)#match ip address 1

R5(config-route-map)#router bgp 6500

R5(config-router)#redistribute connected route-map FILTER

R5(config-router)#do show ip bgp

BGP table version is 10, local router ID is 200.1.6.5

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*> 50.1.1.0/24 0.0.0.0 0 32768 i

*> 200.1.1.0 0.0.0.0 0 32768 ?

*> 200.1.2.0 0.0.0.0 0 32768 ?


*> 200.1.3.0 0.0.0.0 0 32768 ?

*> 200.1.4.0 0.0.0.0 0 32768 ?

R4#show ip bgp

BGP table version is 10, local router ID is 4.4.4.4

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*> 50.1.1.0/24 10.1.45.5 0 0 6500 i

*> 200.1.1.0 10.1.45.5 0 0 6500 ?

*> 200.1.2.0 10.1.45.5 0 0 6500 ?

*> 200.1.3.0 10.1.45.5 0 0 6500 ?

*> 200.1.4.0 10.1.45.5 0 0 6500 ?

R1#show ip bgp

BGP table version is 1, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

* i50.1.1.0/24 10.1.45.5 0 100 0 6500 i

* i200.1.1.0 10.1.45.5 0 100 0 6500 ?

* i200.1.2.0 10.1.45.5 0 100 0 6500 ?

* i200.1.3.0 10.1.45.5 0 100 0 6500 ?

* i200.1.4.0 10.1.45.5 0 100 0 6500 ?


But none of the routes is best and so no one of those routes is inserted in the routing table, and this
is due to two reasons:

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.

R1#show run | section bgp

router bgp 5500

no synchronization

bgp log-neighbor-changes

neighbor 4.4.4.4 remote-as 5500

neighbor 4.4.4.4 update-source Loopback1

no auto-summary

The default for synchronization is off since IOS 12.2(8)T.

2- How BGP processes the next hop address:

 For eBGP peers: Change next hop address on advertised routes.



 For ibgp peers: Don't change next hop address on advertised routes.

R4#show ip bgp

BGP table version is 6, local router ID is 4.4.4.4

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*> 50.1.1.0/24 10.1.45.5 0 0 6500 i

*> 200.1.1.0 10.1.45.5 0 0 6500 ?

*> 200.1.2.0 10.1.45.5 0 0 6500 ?


*> 200.1.3.0 10.1.45.5 0 0 6500 ?

*> 200.1.4.0 10.1.45.5 0 0 6500 ?

R1#show ip bgp

BGP table version is 1, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

* i50.1.1.0/24 10.1.45.5 0 100 0 6500 i

* i200.1.1.0 10.1.45.5 0 100 0 6500 ?

* i200.1.2.0 10.1.45.5 0 100 0 6500 ?

* i200.1.3.0 10.1.45.5 0 100 0 6500 ?

* i200.1.4.0 10.1.45.5 0 100 0 6500 ?

R4(config)#router bgp 5500

R4(config-router)#neighbor 1.1.1.1 next-hop-self

R4(config-router)#exit

R4#clear ip bgp *

R1#show ip bgp

BGP table version is 6, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*>i50.1.1.0/24 4.4.4.4 0 100 0 6500 i

*>i200.1.1.0 4.4.4.4 0 100 0 6500 ?


*>i200.1.2.0 4.4.4.4 0 100 0 6500 ?

*>i200.1.3.0 4.4.4.4 0 100 0 6500 ?

*>i200.1.4.0 4.4.4.4 0 100 0 6500 ?

R1#show ip route bgp

B 200.1.4.0/24 [200/0] via 4.4.4.4, 00:21:50

50.0.0.0/24 is subnetted, 1 subnets

B 200.1.1.0/24 [200/0] via 4.4.4.4, 00:21:50

B 200.1.2.0/24 [200/0] via 4.4.4.4, 00:21:50

B 200.1.3.0/24 [200/0] via 4.4.4.4, 00:21:50

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.

R1(config)#router bgp 5500

R1(config-router)#neighbor TSHOOT peer-group

R1(config-router)#neighbor TSHOOT remote-as 5500

R1(config-router)#neighbor TSHOOT next-hop-self

R1(config-router)#neighbor TSHOOT update-source loop1

R1(config-router)#neighbor 2.2.2.2 peer-group TSHOOT

R1(config-router)#neighbor 3.3.3.3 peer-group TSHOOT

R2(config)#router bgp 5500

R2(config-router)#neighbor TSHOOT peer-group

R2(config-router)#neighbor TSHOOT remote-as 5500

R2(config-router)#neighbor TSHOOT next-hop-self

R2(config-router)#neighbor TSHOOT update-source loop 2

R2(config-router)#neighbor 1.1.1.1 peer-group TSHOOT


R2(config-router)#neighbor 3.3.3.3 peer-group TSHOOT

R2(config-router)#neighbor 4.4.4.4 peer-group TSHOOT

R3(config)#router bgp 5500

R3(config-router)#neighbor TSHOOT peer-group

R3(config-router)#neighbor TSHOOT remote-as 5500

R3(config-router)#neighbor TSHOOT next-hop-self

R3(config-router)#neighbor TSHOOT update-source loop 3

R3(config-router)#neighbor 1.1.1.1 peer-group TSHOOT

R3(config-router)#neighbor 2.2.2.2 peer-group TSHOOT

R3(config-router)#neighbor 4.4.4.4 peer-group TSHOOT

R4(config)#router bgp 5500

R4(config-router)#neighbor TSHOOT peer-group

R4(config-router)#neighbor TSHOOT remote-as 5500

R4(config-router)#neighbor TSHOOT next-hop-self

R4(config-router)#neighbor TSHOOT update-source loop 4

R4(config-router)#neighbor 2.2.2.2 peer-group TSHOOT

R4(config-router)#neighbor 3.3.3.3 peer-group TSHOOT

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#show ip bgp summary

BGP router identifier 1.1.1.1, local AS number 5500

BGP table version is 6, main routing table version 6

5 network entries using 600 bytes of memory

5 path entries using 260 bytes of memory

3/2 BGP path/bestpath attribute entries using 372 bytes of

memory 1 BGP AS-PATH entries using 24 bytes of memory


0 BGP route-map cache entries using 0 bytes of

memory 0 BGP filter-list cache entries using 0 bytes of

memory BGP using 1256 total bytes of memory

BGP activity 5/0 prefixes, 5/0 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

2.2.2.2 4 5500 4 4 6 0 0 00:00:54 0

3.3.3.3 4 5500 2 4 6 0 0 00:00:12 0

4.4.4.4 4 5500 61 57 6 0 0 00:54:45 5

Now the network should be pingable:

R1#ping 50.1.1.5

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 50.1.1.5, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 8/66/148 ms

R1#ping 200.1.1.5

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 200.1.1.5, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/83/140 ms


lab 2 (eBGP-multihop)

Objective:
Configure eBGP peering between R1 and R2 using their loopback interfaces.
Configuration:
R1(config)#int s1/0

R1(config-if)#ip address 10.0.0.1 255.255.255.252

R1(config-if)#no shutdown

R1(config-if)#int s1/1

R1(config-if)#ip address 11.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)#ip route 2.2.2.2 255.255.255.255 s1/0

R1(config)#ip route 2.2.2.2 255.255.255.255 s1/1

R2(config)#int s1/0

R2(config-if)#ip address 10.0.0.2 255.255.255.252

R2(config-if)#no shutdown

R2(config-if)#int s1/1

R2(config-if)#ip address 11.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)#ip route 1.1.1.1 255.255.255.255 s1/0

R2(config)#ip route 1.1.1.1 255.255.255.255 s1/1

R1(config-router)#neighbor 2.2.2.2 remote-as 200

R1(config-router)#neighbor 2.2.2.2 update-source loop 1

R2(config-router)#neighbor 1.1.1.1 remote-as 100

R2(config-router)#neighbor 1.1.1.1 update-source loop 2

But the adjacency doesn’t come up as the TTL value for the eBGP control plane is 1 by default.

R1#show ip bgp summary

<Output omitted>

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

2.2.2.2 4 200 0 0 1 0 0 never Idle

R1(config)#router bgp 100

R1(config-router)#neighbor 2.2.2.2 ebgp-multihop 2

R2(config)#router bgp 200

R2(config-router)#neighbor 1.1.1.1 ebgp-multihop 2

*May 14 02:08:26.283: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up

R1#show ip bgp summary

<Output omitted>

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

2.2.2.2 4 200 4 4 1 0 0 00:00:27 0

R2#show ip bgp summary

<Output omitted>

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd


1.1.1.1 4 100 5 5 1 0 0 00:01:28 0

lab 3 (BGP authentication)


Based on the previous topology.

R1(config)#router bgp 100


R1(config-router)#neighbor 2.2.2.2 password TSHOOT
R1(config-router)#do clear ip bgp *
*May 14 02:20:29.315: %TCP-6-BADAUTH: No MD5 digest from 2.2.2.2(179)
to 1.1.1.1(64027) tableid – 0

R2(config-router)#neighbor 1.1.1.1 password REDHAT


*May 14 02:22:31.043: %TCP-6-BADAUTH: Invalid MD5 digest from 1.1.1.1(56989) to
2.2.2.2(179) tableid – 0
R2(config-router)#neighbor 1.1.1.1 password TSHOOT
*May 14 02:23:14.271: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up
lab 4 (BGP attributes):

R1(config)#int s1/0

R1(config-if)#ip address 10.1.12.1 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#int s1/1

R1(config-if)#ip address 10.1.13.1 255.255.255.0

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)#router ospf 1

R1(config-router)#network 10.1.12.1 0.0.0.0 area 0

R1(config-router)#network 10.1.13.1 0.0.0.0 area 0

R1(config-router)#network 1.1.1.1 0.0.0.0 area 0

R2(config)#int s1/0

R2(config-if)#ip address 10.1.12.2 255.255.255.0


R2(config-if)#no shutdown

R2(config-if)#int s1/1

R2(config-if)#ip address 10.1.23.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#int s1/2

R2(config-if)#ip address 10.1.24.2 255.255.255.0

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)#router ospf 1

R2(config-router)#network 10.1.12.2 0.0.0.0 area 0

R2(config-router)#network 10.1.23.2 0.0.0.0 area 0

R2(config-router)#network 2.2.2.2 0.0.0.0 area 0

R3(config)#int s1/0

R3(config-if)#ip address 10.1.23.3 255.255.255.0

R3(config-if)#no shutdown

R3(config-if)#int s1/1

R3(config-if)#ip address 10.1.13.3 255.255.255.0

R3(config-if)#no shutdown

R3(config-if)#int s1/2

R3(config-if)#ip address 10.1.36.3 255.255.255.0

R3(config-if)#no shutdown

R3(config-if)#int loop3

R3(config-if)#ip address 3.3.3.3 255.255.255.255

R3(config)#router ospf 1

R3(config-router)#network 10.1.13.3 0.0.0.0 area 0


R3(config-router)#network 10.1.23.3 0.0.0.0 area 0

R3(config-router)#network 3.3.3.3 0.0.0.0 area 0

R4(config)#int s1/0

R4(config-if)#ip address 10.1.24.4 255.255.255.0

R4(config-if)#no shutdown

R4(config-if)#int s1/1

R4(config-if)#ip address 10.1.45.4 255.255.255.0

R4(config-if)#no shutdown

R5(config)#int s1/0

R5(config-if)#ip address 10.1.57.5 255.255.255.0

R5(config-if)#no shutdown

R5(config-if)#int s1/1

R5(config-if)#ip address 10.1.45.5 255.255.255.0

R5(config-if)#no shutdown

R5(config-if)#int loop 1

R5(config-if)#ip address 150.1.50.5 255.255.255.0

R5(config-if)#int loop 2

R5(config-if)#ip address 150.2.50.5 255.255.255.0

R6(config)#int s1/0

R6(config-if)#ip address 10.1.36.6 255.255.255.0

R6(config-if)#no shutdown

R6(config-if)#int s1/1

R6(config-if)#ip address 10.1.67.6 255.255.255.0

R6(config-if)#no shutdown
R7(config)#int s1/0

R7(config-if)#ip address 10.1.57.7 255.255.255.0

R7(config-if)#no shutdown

R7(config-if)#int s1/1

R7(config-if)#ip address d 10.1.67.7 255.255.255.0

R7(config-if)#no shutdown

R7(config-if)#int loop 1

R7(config-if)#ip address 200.50.2.7 255.255.255.0

R7(config-if)#int loop 2

R7(config-if)#ip address 200.60.2.7 255.255.255.0

 
Now we will run BGP:

R1(config)#router bgp 5500

R1(config-router)#neighbor G peer-group

R1(config-router)#neighbor G remote-as 5500

R1(config-router)#neighbor G next-hop-self

R1(config-router)#neighbor G update-source loop 1

R1(config-router)#neighbor 2.2.2.2 peer-group G

R1(config-router)#neighbor 3.3.3.3 peer-group G

R2(config)#router bgp 5500

R2(config-router)#neighbor 1.1.1.1 remote-as 5500

R2(config-router)#neighbor 1.1.1.1 next-hop-self

R2(config-router)#neighbor 1.1.1.1 update-source loop 2

R2(config-router)#neighbor 10.1.24.4 remote-as 777

R3(config)#router bgp 5500


R3(config-router)#neighbor 1.1.1.1 remote-as 5500

R3(config-router)#neighbor 1.1.1.1 next-hop-self

R3(config-router)#neighbor 1.1.1.1 update-source loop 3

R3(config-router)#neighbor 10.1.36.6 remote-as 777

R4(config)#router bgp 777

R4(config-router)#neighbor 10.1.24.2 remote-as 5500

R4(config-router)#neighbor 10.1.45.5 remote-as 911

R5(config)#router bgp 911

R5(config-router)#neighbor 10.1.45.4 remote-as 777

R5(config-router)#neighbor 10.1.57.7 remote-as 711

R6(config)#router bgp 777

R6(config-router)#neighbor 10.1.36.3 remote-as 5500

R6(config-router)#neighbor 10.1.67.7 remote-as 711

R7(config)#router bgp 711

R7(config-router)#neighbor 10.1.67.6 remote-as 777

R7(config-router)#neighbor 10.1.57.5 remote-as 911

R1#show ip bgp summary

BGP router identifier 1.1.1.1, local AS number 5500

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

2.2.2.2 4 5500 11 11 1 0 0 00:08:37 0

3.3.3.3 4 5500 11 11 1 0 0 00:07:52 0


R2#show ip bgp summary

BGP router identifier 2.2.2.2, local AS number 5500

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

1.1.1.1 4 5500 13 13 1 0 0 00:10:36 0

10.1.24.4 4 777 10 10 1 0 0 00:06:29 0

R3#show ip bgp summary

BGP router identifier 3.3.3.3, local AS number 5500

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

1.1.1.1 4 5500 21 21 1 0 0 00:17:03 0

10.1.36.6 4 777 7 7 1 0 0 00:03:43 0

R5#show ip bgp summary

BGP router identifier 150.2.50.5, local AS number 911

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

10.1.45.4 4 777 16 15 1 0 0 00:12:41 0

10.1.57.7 4 711 14 14 1 0 0 00:10:07 0

R6#show ip bgp summary

BGP router identifier 10.1.67.6, local AS number 777

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

10.1.36.3 4 5500 8 8 1 0 0 00:04:18 0

10.1.67.7 4 711 14 13 1 0 0 00:10:34 0


R7#show ip bgp summary

BGP router identifier 200.60.2.7, local AS number 711

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

10.1.57.5 4 911 14 14 1 0 0 00:10:42 0

10.1.67.6 4 777 13 14 1 0 0 00:10:52 0

 
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 bgp 711

R7(config-router)#redistribute connected

R1#show ip bgp

BGP table version is 13, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

* i10.1.57.0/24 2.2.2.2 0 100 0 777 911 711 ?

*>i 3.3.3.3 0 100 0 777 711 ?

* i10.1.67.0/24 2.2.2.2 0 100 0 777 911 711 ?

*>i 3.3.3.3 0 100 0 777 711 ?

* i150.1.50.0/24 3.3.3.3 0 100 0 777 711 911 i

*>i 2.2.2.2 0 100 0 777 911 i


* i150.2.50.0/24 3.3.3.3 0 100 0 777 711 911 i

*>i 2.2.2.2 0 100 0 777 911 i

* i200.50.2.0 2.2.2.2 0 100 0 777 911 711 ?

*>i 3.3.3.3 0 100 0 777 711 ?

* i200.60.2.0 2.2.2.2 0 100 0 777 911 711 ?

*>i 3.3.3.3 0 100 0 777 711 ?

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(config)#router bgp 5500

R1(config-router)#neighbor 3.3.3.3 weight 100

R1#show ip bgp

BGP table version is 7, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*>i10.1.57.0/24 3.3.3.3 0 100 100 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

*>i10.1.67.0/24 3.3.3.3 0 100 100 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

*>i150.1.50.0/24 3.3.3.3 0 100 100 777 711 911 i

*i 2.2.2.2 0 100 0 777 911 i


*>i150.2.50.0/24 3.3.3.3 0 100 100 777 711 911 i

*i 2.2.2.2 0 100 0 777 911 i

*>i200.50.2.0 3.3.3.3 0 100 100 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

*>i200.60.2.0 3.3.3.3 0 100 100 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

 
The Origin attribute:

i: The route was learned via the network command.

?: The route was learned via the redistribution.

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

BGP table version is 7, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*>i10.1.57.0/24 3.3.3.3 0 500 0 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?


*>i10.1.67.0/24 3.3.3.3 0 500 0 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

*>i150.1.50.0/24 3.3.3.3 0 500 0 777 711 911 i

*i 2.2.2.2 0 100 0 777 911 i

*>i150.2.50.0/24 3.3.3.3 0 500 0 777 711 911 i

*i 2.2.2.2 0 100 0 777 911 i

*>i200.50.2.0 3.3.3.3 0 500 0 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

*>i200.60.2.0 3.3.3.3 0 500 0 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

We will reset everything.

R3(config)#router bgp 5500

R3(config-router)#no bgp default local-preference 500

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)#access-list 1 permit 150.1.50.0 0.0.0.255

R3(config)#access-list 1 permit 150.2.50.0 0.0.0.255

R3(config)#access-list 2 permit 200.50.2.0 0.0.0.255

R3(config)#access-list 2 permit 200.60.2.0 0.0.0.255

R3(config)#route-map FILTER

R3(config-route-map)#match ip address 1

R3(config-route-map)#set local

R3(config-route-map)#set local-preference 200

R3(config-route-map)#route-map FILTER permit 20

R3(config-route-map)#match ip address 2
R3(config-route-map)#set local-preference 50

R3(config-route-map)# route-map FILTER permit 30

R3(config-route-map)#router bgp 5500

R3(config-router)#neighbor 1.1.1.1 route-map FILTER out

R1#clear ip bgp *

R1#show ip bgp

BGP table version is 7, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*>i10.1.57.0/24 3.3.3.3 0 100 0 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

*>i10.1.67.0/24 3.3.3.3 0 100 0 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

*>i150.1.50.0/24 3.3.3.3 0 200 0 777 711 911 i

*i 2.2.2.2 0 100 0 777 911 i

*>i150.2.50.0/24 3.3.3.3 0 200 0 777 711 911 i

*i 2.2.2.2 0 100 0 777 911 i

* i200.50.2.0 3.3.3.3 0 50 0 777 711 ?

*>i 2.2.2.2 0 100 0 777 911 711 ?

* i200.60.2.0 3.3.3.3 0 50 0 777 711 ?

*>i 2.2.2.2 0 100 0 777 911 711 ?

R1#show ip route bgp

B 200.50.2.0/24 [200/0] via 2.2.2.2, 00:02:24


B 200.60.2.0/24 [200/0] via 2.2.2.2, 00:02:24

10.0.0.0/24 is subnetted, 5 subnets

B 10.1.57.0 [200/0] via 3.3.3.3, 00:02:24

B 10.1.67.0 [200/0] via 3.3.3.3, 00:02:24

150.1.0.0/24 is subnetted, 1 subnets

B 150.1.50.0 [200/0] via 3.3.3.3, 00:02:24

150.2.0.0/24 is subnetted, 1 subnets

B 150.2.50.0 [200/0] via 3.3.3.3, 00:02:24


The MED (Multiexit-discriminator):

It is a suggestion to other ASs.

R3(config)#router bgp 5500

R3(config-router)#default-metric 200

And so routers in other ASs will prefer it to reach the networks.

R1#clear ip bgp *

R1#show ip bgp

BGP table version is 7, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*>i10.1.57.0/24 3.3.3.3 200 100 0 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

*>i10.1.67.0/24 3.3.3.3 200 100 0 777 711 ?

*i 2.2.2.2 0 100 0 777 911 711 ?

*>i150.1.50.0/24 3.3.3.3 200 200 0 777 711 911 i


*i 2.2.2.2 0 100 0 777 911 i

*>i150.2.50.0/24 3.3.3.3 200 200 0 777 711 911 i

*i 2.2.2.2 0 100 0 777 911 i

* i200.50.2.0 3.3.3.3 200 50 0 777 711 ?

*>i 2.2.2.2 0 100 0 777 911 711 ?

* i200.60.2.0 3.3.3.3 200 50 0 777 711 ?

*>i 2.2.2.2 0 100 0 777 911 711 ?

Lab 5 (BGP route aggregation):

R1(config)#int s1/0

R1(config-if)#ip address 11.0.0.1 255.255.255.252

R1(config-if)#no shutdown

R1(config-if)#router bgp 100

R1(config-router)#neighbor 11.0.0.2 remote-as 500

R2(config)#int s1/0

R2(config-if)#ip address 11.0.0.2 255.255.255.252

R2(config-if)#no shutdown

R2(config-if)#int loop 16

R2(config-if)#ip address 16.1.1.2 255.0.0.0

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)#ip address 18.1.1.2 255.0.0.0

R2(config-if)#int loop 19

R2(config-if)#ip address 19.1.1.2 255.0.0.0

R2(config-if)#router bgp 500

R2(config-router)#neighbor 11.0.0.1 remote-as 100

R2(config-router)#network 16.0.0.0 mask 255.0.0.0

R2(config-router)#network 17.0.0.0 mask 255.0.0.0

R2(config-router)#network 18.0.0.0 mask 255.0.0.0

R2(config-router)#network 19.0.0.0 mask 255.0.0.0

R1#show ip bgp

BGP table version is 5, local router ID is 11.0.0.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*> 16.0.0.0 11.0.0.2 0 0 500 i

*> 17.0.0.0 11.0.0.2 0 0 500 i

*> 18.0.0.0 11.0.0.2 0 0 500 i

*> 19.0.0.0 11.0.0.2 0 0 500 i

We will run summarization:

R2(config)#router bgp 500

R2(config-router)#aggregate-address 16.0.0.0 252.0.0.0

R1#clear ip bgp *
R1#show ip bgp

BGP table version is 6, local router ID is 11.0.0.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*> 16.0.0.0 11.0.0.2 0 0 500 i

*> 16.0.0.0/6 11.0.0.2 0 0 500 i

*> 17.0.0.0 11.0.0.2 0 0 500 i

*> 18.0.0.0 11.0.0.2 0 0 500 i

*> 19.0.0.0 11.0.0.2 0 0 500 i

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.

R2(config-router)#no aggregate-address 16.0.0.0 252.0.0.0

R2(config-router)#aggregate-address 16.0.0.0 252.0.0.0 summary-only

R1#clear ip bgp *

R1#show ip bgp

BGP table version is 2, local router ID is 11.0.0.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*> 16.0.0.0/6 11.0.0.2 0 0 500 i


Lab 6 (MP-BGP for IPV6):

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

R1(config)#router bgp 100


*May 13 23:07:02.623: %BGP-4-NORTRID: BGP could not pick a router-id. Please configure
manually.
R1(config-router)#bgp router-id 1.1.1.1
R1(config-router)#neighbor 2001:ab::2 remote-as 200
R1(config-router)#address-family ipv6
R1(config-router-af)#neighbor 2001:ab::2 activate

R2(config)#router bgp 200


*May 13 23:10:06.563: %BGP-4-NORTRID: BGP could not pick a router-id. Please configure
manually.
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#neighbor 2001:ab::1 remote-as 100
R2(config-router)#address-family ipv6
R2(config-router-af)#neighbor 2001:ab::1 activate
*May 13 23:12:15.903: %BGP-5-ADJCHANGE: neighbor 2001:AB::1 Up

Since the two routers are neighbors, we can advertise the networks using the
network command or redistribution.

R2(config)#router bgp 200


R2(config-router)#address-family ipv6
R2(config-router-af)#network 2001::2/128

R1(config)#router bgp 100


R1(config-router)#address-family ipv6
R1(config-router-af)#redistribute connected

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

R2#show bgp ipv6 unicast summary


<Output omitted>
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2001:AB::1 4 100 22 22 4 0 0 00:16:10 2

R1#show bgp ipv6 unicast


<Output omitted>
Network Next Hop Metric LocPrf Weight Path
*> 2001::1/128 :: 0 32768 ?
*> 2001::2/128 2001:AB::2 0 0 200 i
*> 2001:AB::/64 :: 0 32768 ?

R1#show ipv6 route bgp


<Output omitted>
B 2001::2/128 [20/0]
via FE80::C802:12FF:FE34:0, FastEthernet0/0

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#show bgp ipv6 unicast


<Output omitted>
Network Next Hop Metric LocPrf Weight Path
*> 2001::1/128 2001:AB::1 0 0 100 ?
*> 2001::2/128 :: 0 32768 i
r> 2001:AB::/64 2001:AB::1 0 0 100 ?

R2#show bgp ipv6 unicast rib-failure


Network Next Hop RIB-failure RIB-NH Matches
2001:AB::/64 2001:AB::1 IPv6 Higher admin distanc n/a

R2#show ipv6 route bgp


<Output omitted>
B 2001::1/128 [20/0]
via FE80::C801:8FF:FE1C:0, FastEthernet0/0

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(config)#router bgp 100


R1(config-router)#neighbor 2001:ab::2 remote-as 200

R2(config)#router bgp 200


R2(config-router)#neighbor 2001:ab::1 remote-as 100
*Mar 1 00:02:59.707: %BGP-5-ADJCHANGE: neighbor 2001:AB::1 Up
R2#show ip bgp neighbors
BGP neighbor is 2001:AB::1, remote AS 100, external link
BGP version 4, remote router ID 1.1.1.1
BGP state = Established, up for 00:00:18
Last read 00:00:18, last write 00:00:18, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received

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 

You might also like