Saturday, April 18, 2015

step 13 - lowest neighbor address ( 13 step selection route BGP)



R1#show run | se router bgp
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 network 8.8.8.0 mask 255.255.255.0
 neighbor 10.1.12.2 remote-as 1
 neighbor 10.1.21.2 remote-as 1
 no auto-summary
R2#show run | se router bgp
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.12.1 remote-as 1
 neighbor 10.1.21.1 remote-as 1
 no auto-summary

R2#show ip bgp
BGP table version is 2, 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
* i8.8.8.0/24       10.1.21.1                0    100      0 i
*>i                         10.1.12.1                0    100      0 I
Nhận xét: R2 học mạng 8.8.8.0/24 qua next-hop 10.1.12.1.
Chúng ta đi kiểm tra từng bước sau:
  1. Weight: bằng nhau 0
  1. Local prefer: bằng nhau 100
  1. Perfer the path was locally..: bằng nhau
  1. AS-path: bằng nhau 1
  1. Origin type : bằng nhau
  1. Med: bằng nhau
  1. Prefer eBGP over iBGP: cùng iBGP
  1. Prefer with lowes IGP metric to BGP next-hop : bằng nhau
  1. Không xét ở đây.
  1. The path are external: cùng học iBGP
  1. Router-id: đều học từ R1 -> cùng Router-id
  1. minimum cluster list length: không xét
  1.  lowest neighbor address: BREAK.

Next-hop 10.1.12.1 < 10.1.21.1 => R2 học mạng 8.8.8.0/24 qua 10.1.12.1

step 12 - minimum cluster list length ( 13 step selection route BGP)



R1#show run | se router bgp
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 network 8.8.8.0 mask 255.255.255.0
 neighbor 10.1.12.2 remote-as 1
 neighbor 10.1.13.3 remote-as 1
R2#show run | se router bgp
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.12.1 remote-as 1
 neighbor 10.1.12.1 route-reflector-client
 neighbor 10.1.25.5 remote-as 1
 no auto-summary
R3#show run | se router bgp
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.13.1 remote-as 1
 neighbor 10.1.13.1 route-reflector-client
 neighbor 10.1.34.4 remote-as 1
 no auto-summary
R4#show run | se router bgp
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.34.3 remote-as 1
 neighbor 10.1.45.5 remote-as 1
 no auto-summary
!
 interface f0/1
 ip ospf cost 2
R5#show run | se router bgp
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.25.2 remote-as 1
 neighbor 10.1.25.2 route-reflector-client
 neighbor 10.1.45.4 remote-as 1
 no auto-summary

R4#show ip route
           1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/4] via 10.1.45.5, 00:06:21, FastEthernet0/0
                       [110/4] via 10.1.34.3, 00:06:21, FastEthernet0/1
           8.0.0.0/24 is subnetted, 1 subnets
B        8.8.8.0 [200/0] via 10.1.13.1, 00:09:42
           10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O        10.1.12.0/24 [110/3] via 10.1.45.5, 00:06:31, FastEthernet0/0
O        10.1.13.0/24 [110/3] via 10.1.34.3, 00:06:21, FastEthernet0/1
R4#show ip bgp 8.8.8.0
BGP routing table entry for 8.8.8.0/24, version 7
Paths: (2 available, best #2, table default)
  Not advertised to any peer
  Local
    10.1.12.1 (metric 3) from 10.1.45.5 (5.5.5.5)
      Origin IGP, metric 0, localpref 100, valid, internal
      Originator: 8.8.8.8, Cluster list: 5.5.5.5, 2.2.2.2
  Local
    10.1.13.1 (metric 3) from 10.1.34.3 (3.3.3.3)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Originator: 8.8.8.8, Cluster list: 3.3.3.3

Nhận xét: R4 học 8.8.8.0 qua R3.
Chúng ta đi kiểm tra từng bước sau:
  1. Weight: bằng nhau 0
  1. Local prefer: bằng nhau 100
  1. Perfer the path was locally..: bằng nhau
  1. AS-path: bằng nhau
  1. Origin type : bằng nhau
  1. Med: bằng nhau
  1. Prefer eBGP over iBGP: cùng iBGP
  1. Prefer with lowes IGP metric to BGP next-hop : bằng nhau = 3 ( điều chỉnh cost IGP bằng nhau như bảng RIB ở trên)
  1. Không xét ở đây.
  1. The path are external: cùng học iBGP
  1. Router-id: đều học từ R1 -> cùng Router-id
  1. minimum cluster list length: BREAK.

=> cluster length qua next-hop 10.1.13.1 (Cluster list: 3.3.3.3) = 1 < next-hop 10.1.12.1 = 2 (Cluster list: 5.5.5.5, 2.2.2.2)

step 11 - lowest router ID (13 step selection route BGP)


R2#show run | se router bgp
router bgp 2
 bgp bestpath compare-routerid
 neighbor 10.1.12.1 remote-as 1
 neighbor 10.1.23.3 remote-as 3
 no auto-summary

R2#show 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
*> 8.8.8.0/24       10.1.12.1                0             0 1 i
*                             10.1.23.3                0             0 3 i

=> R2 học mạng 8.8.8.0/24 qua R1 vì có RID nhỏ hơn.
Chúng ta đi kiểm tra từng bước sau:
  1. Weight: bằng nhau 0
  2. Local prefer: bằng nhau 100
  3. Perfer the path was locally..: bằng nhau
  1. AS-path: bằng nhau
  1. Origin type : bằng nhau
  2. Med: bằng nhau
  3. Prefer eBGP over iBGP: cùng eBGP
  1. Prefer with lowes IGP metric to BGP next-hop : bằng nhau
  1. Không xét ở đây.
  2. The path are external: cùng học iBGP
  1. Router-id: BREAK

R2#clear ip bgp 10.1.12.1
*Mar  1 00:11:06.203: %BGP-5-ADJCHANGE: neighbor 10.1.12.1 Down User reset
*Mar  1 00:11:06.239: BGP(0): Revise route installing 1 of 1 routes for 8.8.8.0/24 -> 10.1.23.3(main) to main IP table
*Mar  1 00:11:06.247: BGP(0): 10.1.23.3 NEXT_HOP part 1 net 8.8.8.0/24, next 10.1.23.3
*Mar  1 00:11:06.247: BGP(0): 10.1.23.3 send UPDATE (format) 8.8.8.0/24, next 10.1.23.3, metric 0, path 3
*Mar  1 00:11:06.351: BGP(0): updgrp 1 - 10.1.23.3 updates replicated for neighbors:
*Mar  1 00:11:07.503: %BGP-5-ADJCHANGE: neighbor 10.1.12.1 Up
*Mar  1 00:11:07.567: BGP(0): 10.1.12.1 rcvd UPDATE w/ attr: nexthop 10.1.12.1, origin i, metric 0, path 1
*Mar  1 00:11:07.571: BGP(0): 10.1.12.1 rcvd 8.8.8.0/24
*Mar  1 00:11:07.571: BGP(0): Revise route installing 1 of 1 routes for 8.8.8.0/24 -> 10.1.12.1(main) to main IP table

  • Khi reset BGP giữa R2 và R1. R2 sẽ học route 8.8.8.0/24 qua R3, nhưng khi bgp giữa R1 và R2 được thiết lập lại thì R2 sẽ học 8.8.8.0/24 qua R1 ( quá trình debug ở trên).



Step 10 - path are external ( 13 step selection route BGP)

10- The paths are external ( chỉ xét đối với eBGP)
        => Prefer with a path was received first.
Note:
- DON'T Modify => Paths learn by eBGP, will always break at Step 10 ( cannot go to step 10,11,12)
- Modify => go to step 11 (command : " bgp bestpath compare-router-id" => when using ? )
Note:
- Using command : " clear ip bgp * soft" when you configure " bgp bestpath... "
- If RouterID is same => go to step 12 or 13


R2#show run | se router bgp
router bgp 2
 neighbor 10.1.12.1 remote-as 1
 neighbor 10.1.23.3 remote-as 3
 no auto-summary

R2#show 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
*> 8.8.8.0/24       10.1.12.1                0             0 1 i
*                             10.1.23.3                0             0 3 i
Nhận xét: R2 học mạng 8.8.8.0/24 qua R1 vì nhận được update từ R1 sớm hơn R3.
Xét từng bước:
  1. Weight: bằng nhau 0
  1. Local prefer: bằng nhau 100
  1. Perfer the path was locally..: bằng nhau
  2. AS-path: bằng nhau
  3. Origin type : bằng nhau
  4. Med: bằng nhau
  5. Prefer eBGP over iBGP: cùng eBGP
  6. Prefer with lowes IGP metric to BGP next-hop : bằng nhau
  1. Không xét ở đây.

  1. The path are external: BREAK

Step 9 - Multipath ( 13 step selection route BGP)

9- Determine if multiple paths require installation in the Routing table for "BGP Multipath"
Continue, if bestpath is not yes selected.
  • Cấu hình multipath + step 1-8 giống nhau => tất cả các route được đưa lên RIB

R2#show run | se router bgp
router bgp 2
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.12.1 remote-as 1
 neighbor 10.1.23.3 remote-as 3
 no auto-summary
R2#show ip bgp 8.8.8.8
BGP routing table entry for 8.8.8.0/24, version 9
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Flag: 0x820
  Advertised to update-groups:
        1
  1
    10.1.12.1 from 10.1.12.1 (1.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, external
  3
    10.1.23.3 from 10.1.23.3 (3.3.3.3)
      Origin IGP, metric 0, localpref 100, valid, external, best

=> R2 học mạng 8.8.8.0/24 qua R3.  Xét 13 step

Chúng ta đi kiểm tra từng bước sau:
  1. Weight: bằng nhau 0
  2. Local prefer: bằng nhau 100
  3. Perfer the path was locally..: bằng nhau
  4. AS-path: bằng nhau 1
  5. Origin type : bằng nhau
  6. Med: bằng nhau
  7. Prefer eBGP over iBGP: cùng eBGP
  1. Prefer with lowes IGP metric to BGP next-hop : bằng nhau
  1. Không xét ở đây.
  1. The path are external:  break.
-> R2 học mạng 8.8.8.0/24 vì nó nhận được update từ R3 sớm hơn R1

Cấu hình step 9:
R2#show run | se router
router bgp 2
 bgp bestpath as-path multipath-relax  // equal load balancing bwt same length but different AS Path. Cmd hidden on IOS
 neighbor 10.1.12.1 remote-as 1
 neighbor 10.1.23.3 remote-as 3
 maximum-paths 2                                 // install 2 routes into RIB

Kiểm tra RIB R2:
R2#show ip route
     8.0.0.0/24 is subnetted, 1 subnets
B       8.8.8.0 [20/0] via 10.1.23.3, 00:02:23
                       [20/0] via 10.1.12.1, 00:02:23   


=> R2 đưa 2 route lên bảng RIB