BGP Lab

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

BGP LAB

Note:
IP address assigned and all interfaces in no-shutdown mode and point-to-point pingable.

Configuration of eBGP

R1

R1(config)#router bgp 65100


R1(config-router)#neighbor 209.165.202.130 remote-as 65000

R2

R2(config)#router bgp 65000


R2(config-router)#neighbor 209.165.202.129 remote-as 65000

Missmatch AS on Neighbor for test

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


209.165.202.129 4 65000 0 0 1 0 0 never Idle
R2(config)#do sh ip bg sum
BGP router identifier 192.168.22.1, local AS number 65000
BGP table version is 1, main routing table version 1

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


209.165.202.129 4 65000 0 0 1 0 0 never Active
R2(config)#
*Jul 25 04:20:59.459: %BGP-3-NOTIFICATION: sent to neighbor 209.165.202.129 active 2/2 (peer in wrong AS) 2
bytes FE4C
R2(config)#do sh ip bg sum
BGP router identifier 192.168.22.1, local AS number 65000
BGP table version is 1, main routing table version 1

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


209.165.202.129 4 65000 2 2 1 0 0 00:00:00 Closing

1|Page
After correcting AS

R2

R2(config)#router bgp 65000


R2(config-router)#neighbor 209.165.202.129 remote-as 65100
R2(config-router)#
*Jul 25 04:25:57.755: %BGP-5-ADJCHANGE: neighbor 209.165.202.129 Up
R2(config-router)#

R2#sh ip bgp summary


BGP router identifier 192.168.22.1, local AS number 65000
BGP table version is 1, main routing table version 1

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


209.165.202.129 4 65100 5 5 1 0 0 00:01:33 0

R2#sh ip bgp neighbors


BGP neighbor is 209.165.202.129, remote AS 65100, external link
BGP version 4, remote router ID 209.165.201.1
BGP state = Established, up for 00:03:21
Last read 00:00:01, last write 00:00:44, hold time is 180, keepalive interval is 60 seconds
Neighbor sessions:
1 active, is not multisession capable (disabled)
Neighbor capabilities:
Route refresh: advertised and received(new)
Four-octets ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Enhanced Refresh Capability: advertised and received
Multisession Capability:
Stateful switchover support enabled: NO for session 1
Message statistics:
InQ depth is 0
OutQ depth is 0

Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 1 1
Keepalives: 5 6
Route Refresh: 0 0
Total: 7 8
Default minimum time between advertisement runs is 30 seconds

R2#sh ip bgp neighbors 209.165.202.129


BGP neighbor is 209.165.202.129, remote AS 65100, external link
BGP version 4, remote router ID 209.165.201.1
BGP state = Established, up for 00:06:55
Last read 00:00:42, last write 00:00:37, hold time is 180, keepalive interval is 60 seconds
Neighbor sessions:
1 active, is not multisession capable (disabled)
Neighbor capabilities:
Route refresh: advertised and received(new)

2|Page
Configure iBGP

R2(config)#router bgp 65000


R2(config-router)#neighbor 172.16.23.3 remote-as 65000

R3(config)#router bgp 65000


R3(config-router)#neighbor 172.16.23.2 remote-as 65000

R2#sh ip bgp summary


BGP router identifier 192.168.22.1, local AS number 65000
BGP table version is 1, main routing table version 1

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


172.16.23.3 4 65000 4 4 1 0 0 00:00:22 0
209.165.202.129 4 65100 16 16 1 0 0 00:10:54 0
R2#sh ip bgp neighbors
BGP neighbor is 172.16.23.3, remote AS 65000, internal link
BGP version 4, remote router ID 192.168.33.1
BGP state = Established, up for 00:02:03
Last read 00:00:08, last write 00:00:17, hold time is 180, keepalive interval is 60 seconds

Network Command

R3(config)#router bgp 65000


R3(config-router)#network 192.168.33.0 mask 255.255.255.0

R2#debug bgp ipv4 unicast updates


BGP updates debugging is on for address family: IPv4 Unicast
R2#
*Jul 25 05:08:21.847: BGP(0): 172.16.23.3 rcvd UPDATE w/ attr: nexthop 172.16.23.3, origin i, localpref 100,
metric 0
*Jul 25 05:08:21.851: BGP(0): 172.16.23.3 rcvd 192.168.33.0/24
*Jul 25 05:08:21.855: BGP(0): Revise route installing 1 of 1 routes for 192.168.33.0/24 -> 172.16.23.3(global) to
main IP table
*Jul 25 05:08:21.871: BGP(0): (base) 209.165.202.129 send UPDATE (format) 192.168.33.0/24, next
209.165.202.130, metric 0, path Local
R2#

R3(config-router)#do sh ip bgp
BGP table version is 4, local router ID is 192.168.33.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path


*> 192.168.33.0 0.0.0.0 0 32768 i
R3(config-router)#

3|Page
R2#sh ip bgp
BGP table version is 4, local router ID is 192.168.22.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path


*>i 192.168.33.0 172.16.23.3 0 100 0 i
R2#show ip route bgp
B 192.168.33.0/24 [200/0] via 172.16.23.3, 00:05:29
R2#

R1#sh ip bgp
BGP table version is 4, local router ID is 209.165.201.1

Network Next Hop Metric LocPrf Weight Path


*> 192.168.33.0 209.165.202.130 0 65000 i
R1# show ip route bgp
B 192.168.33.0/24 [20/0] via 209.165.202.130, 00:05:55
R1#

On R1 Network command

R1(config)#router bgp 65100


R1(config-router)#network 209.165.200.224 mask 255.255.255.224

R2#
*Jul 25 05:16:25.663: BGP(0): 209.165.202.129 rcvd UPDATE w/ attr: nexthop 209.165.202.129, origin i, metric 0,
merged path 65100, AS_PATH
*Jul 25 05:16:25.667: BGP(0): 209.165.202.129 rcvd 209.165.200.224/27
*Jul 25 05:16:25.671: BGP(0): Revise route installing 1 of 1 routes for 209.165.200.224/27 ->
209.165.202.129(global) to main IP table
*Jul 25 05:16:25.687: BGP(0): 172.16.23.3 NEXT_HOP is on same subnet as the bgp peer and set to
209.165.202.129 for net 209.165.200.224/27, flags 0, sb: 0, mask: 0
*Jul 25 05:16:25.691: BGP(0): (base) 172.16.23.3 send UPDATE (format) 209.165.200.224/27, next
209.165.202.129, metric 0, path 65100
R2#
R2#sh ip bgp
BGP table version is 5, local router ID is 192.168.22.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path


*>i 192.168.33.0 172.16.23.3 0 100 0 i
*> 209.165.200.224/27 209.165.202.129 0 0 65100 i
R2#sh ip route bgp
B 192.168.33.0/24 [200/0] via 172.16.23.3, 00:09:58
209.165.200.0/27 is subnetted, 1 subnets
B 209.165.200.224 [20/0] via 209.165.202.129, 00:01:54
R2#

4|Page
R3#sh ip bgp
BGP table version is 4, local router ID is 192.168.33.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path


*> 192.168.33.0 0.0.0.0 0 32768 i
* i 209.165.200.224/27 209.165.202.129 0 100 0 65100 i
R3#sh ip route 209.165.200.224
% Network not in table
R3(config)#ip route 209.165.202.129 255.255.255.255 172.16.23.2
R3#sh ip bgp
BGP table version is 5, local router ID is 192.168.33.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path


*> 192.168.33.0 0.0.0.0 0 32768 i
*>i 209.165.200.224/27 209.165.202.129 0 100 0 65100 i
R3#sh ip route 209.165.200.224
Routing entry for 209.165.200.224/27
Known via "bgp 65000", distance 200, metric 0
Tag 65100, type internal
Last update from 209.165.202.129 00:00:12 ago
Routing Descriptor Blocks:
* 209.165.202.129, from 172.16.23.2, 00:00:12 ago
Route metric is 0, traffic share count is 1
AS Hops 1
Route tag 65100
MPLS label: none
R3#

But it’s not a solution 

5|Page
We will use next-hop feature of BGP 

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


R2(config-router)#
*Jul 25 06:11:39.855: BGP(0): 172.16.23.3 NEXT_HOP is set to self for net 209.165.200.224/27,
*Jul 25 06:11:39.859: BGP(0): (base) 172.16.23.3 send UPDATE (format) 209.165.200.224/27, next 172.16.23.2,
metric 0, path 65100
R2(config-router)#

R3#debug ip bgp updates


BGP updates debugging is on for address family: IPv4 Unicast
*Jul 25 06:11:40.163: BGP(0): 172.16.23.2 rcvd UPDATE w/ attr: nexthop 172.16.23.2, origin i, localpref 100,
metric 0, merged path 65100, AS_PATH
*Jul 25 06:11:40.167: BGP(0): 172.16.23.2 rcvd 209.165.200.224/27
*Jul 25 06:11:40.171: BGP: bgp_rwatch_notify: BGP_RWATCH_APPL_NHOP
*Jul 25 06:11:40.171: EvD: charge penalty 500, new accum. penalty 500, flap count 3
*Jul 25 06:11:40.175: BGP(0): 172.16.23.2 rcv UPDATE about 192.168.33.0/24 -- withdrawn
*Jul 25 06:11:40.179: BGP(0): Revise route installing 1 of 1 routes for 209.165.200.224/27 -> 172.16.23.2(global)
to main IP table
R3#sh ip bgp
BGP table version is 7, local router ID is 192.168.33.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path


*> 192.168.33.0 0.0.0.0 0 32768 i
*>i 209.165.200.224/27 172.16.23.2 0 100 0 65100 i
R3#sh ip route bgp
209.165.200.0/27 is subnetted, 1 subnets
B 209.165.200.224 [200/0] via 172.16.23.2, 00:09:11
R3#

Exercise .. do the lab on Looback0 on all routers

6|Page

You might also like