Learning points:
- An AS is a collection of networks under a single administrative domain.
- Autonomous system numbers are 16-bit which means we have AS 1 up to 65535.
- Private range is from 64512 – 65535
Types of BGP:
- External BGP – exchange routing information between the different autonomous.
- Internal BGP – exchange routing information within the same autonomous system
Type of Routes advertise by ISP’s:
- Default routes Only
- Default route and partial routes
- Full Internet routes
Why to used BGP?
- BGP is the routing protocol used to route between autonomous system.
- Guarantee loop-free path
- Path-vector routing protocols
- Uses attributes instead of metric
- BGP can influence the path to a destinations
- BGP is a policy based routing protocol
Why BGP is a path-vector?
- In order to reach a destination, the routing table stores a copy of the AS together with the next hop address.
R1:
R1#sh run | sec bgp
router bgp 10
bgp log-neighbor-changes
network 10.10.10.10 mask 255.255.255.255
neighbor 192.168.12.2 remote-as 20
R2:
R2#sh run | sec bgp
router bgp 20
bgp log-neighbor-changes
network 20.20.20.20 mask 255.255.255.255
neighbor 192.168.12.1 remote-as 10
BGP Neighbor were formed:
R1#show ip bgp summary
BGP router identifier 10.10.10.10, local AS number 10
BGP table version is 7, main routing table version 7
2 network entries using 288 bytes of memory
2 path entries using 160 bytes of memory
2/2 BGP path/bestpath attribute entries using 272 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 744 total bytes of memory
BGP activity 4/2 prefixes, 4/2 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.12.2 4 20 8 8 7 0 0 00:03:11 1
R1#
Routing Table:
R1#show ip route bgp
!
Gateway of last resort is not set
20.0.0.0/32 is subnetted, 1 subnets
B 20.20.20.20 [20/0] via 192.168.12.2, 00:25:25 >>> External BGP has AD of 20.
To check the BGP Database:
R1#show ip bgp
BGP table version is 7, local router ID is 10.10.10.10
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
*> 10.10.10.10/32 0.0.0.0 0 32768 i
*> 20.20.20.20/32 192.168.12.2 0 0 20 i
I have enabled debug bgp * all on R2 to check the BGP States.
*Sep 19 12:23:40.067: BGP: 192.168.12.1 active went from Idle to Active
*Sep 19 12:23:40.067: BGP: 192.168.12.1 open active, local address 192.168.12.2
*Sep 19 12:23:40.167: BGP: ses global 192.168.12.1 (0x688493B0:0) act Adding topology IPv4 Unicast:base
*Sep 19 12:23:40.171: BGP: ses global 192.168.12.1 (0x688493B0:0) act Send OPEN
*Sep 19 12:23:40.175: BGP: ses global 192.168.12.1 (0x688493B0:0) act Building Enhanced Refresh capability
*Sep 19 12:23:40.175: BGP: 192.168.12.1 active went from Active to OpenSent
*Sep 19 12:23:40.179: BGP: 192.168.12.1 active sending OPEN, version 4, my as: 20, holdtime 180 seconds, ID 14141414
*Sep 19 12:23:40.299: BGP: 192.168.12.1 active rcv message type 1, length (excl. header) 38
*Sep 19 12:23:40.303: BGP: ses global 192.168.12.1 (0x688493B0:0) act Receive OPEN
*Sep 19 12:23:40.303: BGP: 192.168.12.1 active rcv OPEN, version 4, holdtime 180 seconds
*Sep 19 12:23:40.307: BGP: 192.168.12.1 active rcv OPEN w/ OPTION parameter len: 28
*S
R2#ep 19 12:23:40.307: BGP: 192.168.12.1 active rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Sep 19 12:23:40.311: BGP: 192.168.12.1 active OPEN has CAPABILITY code: 1, length 4
*Sep 19 12:23:40.311: BGP: 192.168.12.1 active OPEN has MP_EXT CAP for afi/safi: 1/1
*Sep 19 12:23:40.311: BGP: 192.168.12.1 active rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Sep 19 12:23:40.315: BGP: 192.168.12.1 active OPEN has CAPABILITY code: 128, length 0
*Sep 19 12:23:40.315: BGP: 192.168.12.1 active OPEN has ROUTE-REFRESH capability(old) for all address-families
*Sep 19 12:23:40.319: BGP: 192.168.12.1 active rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Sep 19 12:23:40.319: BGP: 192.168.12.1 active OPEN has CAPABILITY code: 2, length 0
*Sep 19 12:23:40.319: BGP: 192.168.12.1 active OPEN has ROUTE-REFRESH capability(new) for all address-families
*Sep 19 12:23:40.323: BGP: 192.168.12.1 active rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Sep 19
R2# 12:23:40.323: BGP: 192.168.12.1 active OPEN has CAPABILITY code: 70, length 0
*Sep 19 12:23:40.323: BGP: ses global 192.168.12.1 (0x688493B0:0) act Enhanced Refresh cap received in open message
*Sep 19 12:23:40.327: BGP: 192.168.12.1 active rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Sep 19 12:23:40.327: BGP: 192.168.12.1 active OPEN has CAPABILITY code: 65, length 4
*Sep 19 12:23:40.331: BGP: 192.168.12.1 active OPEN has 4-byte ASN CAP for: 10
*Sep 19 12:23:40.331: BGP: nbr global 192.168.12.1 neighbor does not have IPv4 MDT topology activated
*Sep 19 12:23:40.335: BGP: 192.168.12.1 active rcvd OPEN w/ remote AS 10, 4-byte remote AS 10
*Sep 19 12:23:40.335: BGP: 192.168.12.1 active went from OpenSent to OpenConfirm
*Sep 19 12:23:40.339: BGP: 192.168.12.1 active went from OpenConfirm to Established
*Sep 19 12:23:40.339: BGP: ses global 192.168.12.1 (0x688493B0:1) act Assigned ID
*Sep 19 12:23:40.343: BGP: ses global 192.168.12.1 (0x688493B0:1) Up
*Sep 19 12:
R2#23:40.347: %BGP-5-ADJCHANGE: neighbor 192.168.12.1 Up
*Sep 19 12:23:40.355: BGP: ses global 192.168.12.1 (0x688493B0:1) read request no-op
*Sep 19 12:23:40.439: RT: updating bgp 10.10.10.10/32 (0x0):
via 192.168.12.1
BGP STATES as Observed from the debug output.
- Idle – this means that BGP process has been shutdown or it is waiting for the next retry.
- Connect – BGP is waiting for the TCP connection to complete.
- Active – TCP connection is ready but no BGP messages have been sent yet.
- Opensent – Open message has been sent but did not receive yet from the neighbor.
- Openconfirm – Open message has been sent and received from the other side.
- Established – All parameters match, BGP peering is established, routing information is exchanged.
**************************END OF LAB**********************************
Leave a comment