Wednesday 28 December 2016

BGP CHAPTER 2

BGP CHAPTER 2
QUESTIONS:
5. What is EBGP vs iBGP Peering rules ?
6. How to Configure EBGP relationship ?
7. Use of network command in BGP ?
Solution:
5. What is EBGP vs iBGP Peering rules ?

iBGP Peering Rules:
. iBGP packets default to TTL 255
- implies neighbours do not have to be connected as long
as IGP reachability exists
. Loop prevention via route filtering
- iBGP learned routes cannot be advertised on to another
iBGP neighbor.
- implies need for either....
. Fully meshed iBGP peerings
. Route reflection
. Confederation

EBGP Peering Rules:
  . EBGP packets default to TTL 1
  - Can be modified if neighbors are multiple hops away
  . neighbor ebgp-multihop [ttl]
  . neighbor ttl-security hops [ttl]
  . Non multi-hop peers must be directly connected by
   default
  - can be modified if connected neighbours via loopbacks
  . neighbor disable-connected-check

. Loop prevention via AS-PATH
- Local ASN is "prepended" to outbound updates
- inbound updates containing local ASN are discarded
- can be modified with neighbor allows-in

EBGP Peering Rules:
. Next-hop processing:
- outbound EBGP updates have local update-source for
  neighbor set as next-hop
  .E.g if update-source is Loopback0 , next-hop is Loopb0
- Can be modifed with route-map action set ip next-hop but
  typically shoudn't
  . E.g "Third Party" next-hop

 6. How to Configure EBGP neighbour relationship ?
  . EBGP packets default to TTL 1
  - can be modified if connected neighbours via loopbacks
  . neighbor disable-connected-check
   - Can be modified if neighbors are multiple hops away
  . neighbor ebgp-multihop [ttl]
  . neighbor ttl-security hops [ttl]

  Diag :
  in our case make bgp relationship with ISP1 with its loopback
  ----->


  Creating Neighbour relationship between ISP1 & R2, with their loopbacks

  First i am using neighbor disable-connected-check
  then using neighbor ebgp-multihop [ttl]

  R2#sh run | se bgp
router bgp 123
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 123
 neighbor 1.1.1.1 update-source Loopback1
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 update-source Loopback1
 neighbor 4.4.4.4 remote-as 444
 neighbor 4.4.4.4 disable-connected-check
 neighbor 4.4.4.4 update-source Loopback1
 no auto-summary
R2#sh run | se ip route
ip route 4.4.4.4 255.255.255.255 10.1.24.4

ISP1#sh run | se bgp
router bgp 444
 no synchronization
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 123
 neighbor 2.2.2.2 disable-connected-check
 neighbor 2.2.2.2 update-source Loopback4
 no auto-summary
ISP1#
*Mar  1 00:30:46.959: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up

----------- now using neighbor ebgp-multihop -----
R2(config-router)#do sh run | se bgp
router bgp 123
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 123
 neighbor 1.1.1.1 update-source Loopback1
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 update-source Loopback1
 neighbor 4.4.4.4 remote-as 444
 neighbor 4.4.4.4 ebgp-multihop 3
 neighbor 4.4.4.4 update-source Loopback1
 no auto-summary
R2(config-router)#
*Mar  1 00:32:53.127: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up

ISP1#sh run | se bgp
router bgp 444
 no synchronization
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 123
 neighbor 2.2.2.2 ebgp-multihop 3
 neighbor 2.2.2.2 update-source Loopback4
 no auto-summary
ISP1#sh ip bgp su
BGP router identifier 4.4.4.4, local AS number 444
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   123      17      17        1    0    0 00:00:16        0


7. Use of network command in BGP ?
--->
Network command of bgp takes routes of your routing tabel and
advertise it via bgp.

Here advertising 4.4.4.1-4 of ISP1 ot AS 123

ISP1#sh ip bgp
BGP table version is 5, 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
*> 4.4.4.1/32       0.0.0.0                  0         32768 i
*> 4.4.4.2/32       0.0.0.0                  0         32768 i
*> 4.4.4.3/32       0.0.0.0                  0         32768 i
*> 4.4.4.4/32       0.0.0.0                  0         32768 i
ISP1#sh run | se bgp
router bgp 444
 no synchronization
 bgp log-neighbor-changes
 network 4.4.4.1 mask 255.255.255.255
 network 4.4.4.2 mask 255.255.255.255
 network 4.4.4.3 mask 255.255.255.255
 network 4.4.4.4 mask 255.255.255.255
 neighbor 2.2.2.2 remote-as 123
 neighbor 2.2.2.2 ebgp-multihop 3
 neighbor 2.2.2.2 update-source Loopback4
 no auto-summary
!
check this route on R2 & R1 also
!
R2#sh ip bgp
BGP table version is 6, local router ID is 2.2.2.2
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
*> 4.4.4.1/32       4.4.4.4                  0             0 444 i
*> 4.4.4.2/32       4.4.4.4                  0             0 444 i
*> 4.4.4.3/32       4.4.4.4                  0             0 444 i
r> 4.4.4.4/32       4.4.4.4                  0             0 444 i

R1#sh ip bgp
BGP table version is 1, local router ID is 1.1.1.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
* i4.4.4.1/32       4.4.4.4                  0    100      0 444 i
* i4.4.4.2/32       4.4.4.4                  0    100      0 444 i
* i4.4.4.3/32       4.4.4.4                  0    100      0 444 i
* i4.4.4.4/32       4.4.4.4                  0    100      0 444 i
R1#

No comments:

Post a Comment