Wednesday, September 28, 2011

LAB: BGP Backdoor

- Shutdown the BGP peering link between AS 100 and AS 300
- Create a new Loopback1 interface in SW1 with the IP address 150.1.77.77/24 and advertise it into BGP.
- Configure R1 and R4 so that they prefer reaching the new subnet via EIGRP as opposed to eBGP.


configuration:

SW1:
interface Loopback1
ip address 150.1.77.77 255.255.255.0
!
router eigrp 1
 network 150.1.0.0
 network 155.1.0.0
!
router bgp 300
 no synchronization
 bgp log-neighbor-changes
 network 150.1.77.0 mask 255.255.255.0
 neighbor 155.1.37.3 remote-as 200
 neighbor 155.1.67.6 remote-as 100
 neighbor 155.1.67.6 shutdown
 neighbor 155.1.79.9 remote-as 300
 no auto-summary

R1 & R4:
router bgp 100
network 150.1.77.0 mask 255.255.255.0 backdoor

verification:

before applying the backdoor command.

Rack1R1#show ip route 150.1.77.0
Routing entry for 150.1.77.0/24
  Known via "bgp 100", distance 20, metric 0
  Tag 200, type external
  Last update from 155.1.13.3 00:03:22 ago
  Routing Descriptor Blocks:
  * 155.1.13.3, from 155.1.13.3, 00:03:22 ago
      Route metric is 0, traffic share count is 1
      AS Hops 2
      Route tag 200

after applying the backdoor command:

Rack1R1#show ip route 150.1.77.0
*Mar  1 01:00:32.839: %SYS-5-CONFIG_I: Configured from console by console
Rack1R1#show ip route 150.1.77.0
Routing entry for 150.1.77.0/24
  Known via "eigrp 1", distance 90, metric 158720, type internal
  Redistributing via eigrp 1
  Last update from 155.1.146.6 on FastEthernet0/0, 00:00:19 ago
  Routing Descriptor Blocks:
  * 155.1.146.6, from 155.1.146.6, 00:00:19 ago, via FastEthernet0/0
      Route metric is 158720, traffic share count is 1
      Total delay is 5200 microseconds, minimum bandwidth is 100000 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 2

Rack1R1#show ip bgp 150.1.77.0 
BGP routing table entry for 150.1.77.0/24, version 65
Paths: (2 available, best #2, table Default-IP-Routing-Table, RIB-failure(17))
Multipath: iBGP
  Advertised to update-groups:
     1        
  200 300, (Received from a RR-client)
    155.1.45.5 (metric 2172416) from 155.1.146.4 (150.1.4.4)
      Origin IGP, metric 0, localpref 100, valid, internal
  200 300
    155.1.13.3 from 155.1.13.3 (150.1.3.3)
      Origin IGP, localpref 100, valid, external, best
Rack1R1#

LAB: BGP BestPath Selection - DMZ Link BW

- Modify the configuration of AS 100 routers so that R1 load-balances to the paths in AS 54 proportional to the bandwidth of the links connecting R4 and R6 to AS 54 routers.



configuration:
R1:
router bgp 100
maximum-path ibgp 2

R4:
router bgp 100
bgp dmzlink-bw
neighbor 155.1.146.1 send-community extended
neighbor 204.12.1.254 dmzlink-bw
R6:
router bgp 100
bgp dmzlink-bw
neighbor 155.1.146.1 send-community extended
neighbor 54.1.1.254 dmzlink-bw
!
interface Serial 0/0
bandwidth 2000


verification:

Rack1R1#show ip bgp 112.0.0.0
BGP routing table entry for 112.0.0.0/8, version 48
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Multipath: iBGP
  Advertised to update-groups:
     1          2        
  54 50 60, (Received from a RR-client)
    204.12.1.254 (metric 2560002816) from 155.1.146.4 (150.1.4.4)
      Origin IGP, metric 0, localpref 100, valid, internal, multipath
      DMZ-Link Bw 12500 kbytes
  54 50 60, (Received from a RR-client)
    54.1.1.254 (metric 2560002816) from 155.1.146.6 (6.6.6.6)
      Origin IGP, metric 0, localpref 100, valid, internal, multipath, best
      DMZ-Link Bw 250 kbytes


Rack1R1#show ip route 112.0.0.0
Routing entry for 112.0.0.0/8
Known via "bgp 100", distance 200, metric 0
Tag 54, type internal
Last update from 204.12.1.254 00:07:21 ago
Routing Descriptor Blocks:
204.12.1.254, from 155.1.146.4, 00:07:21 ago
Route metric is 0, traffic share count is 48
AS Hops 3
Route tag 54
* 54.1.1.254, from 155.1.146.6, 00:07:21 ago
Route metric is 0, traffic share count is 1
AS Hops 3
Route tag 54

Tuesday, September 27, 2011

LAB: BGP BestPath Selection - AS Path Ignore

- Ensure that traffic from AS 200 to AS 54 prefixes takes path across AS 300.
- Do not use AS-PATH prepending to accomplish this.

 

configuration:


R2:
router bgp 200
bgp bestpath as-path ignore

R3:
router bgp 200
bgp bestpath as-path ignore

R5:
router bgp 200
bgp bestpath as-path ignore
R1:
ip as-path access-list 1 permit _54$
!
route-map TO_R3 permit 10
match as-path 1
set origin incomplete
!
route-map TO_R3 permit 100
!
router bgp 100
neighbor 155.1.13.3 route-map TO_R3 out

R4:
ip as-path access-list 1 permit _54$
!
route-map TO_R5 permit 10
match as-path 1
set origin incomplete
!
route-map TO_R5 permit 100
!
router bgp 100
neighbor 155.1.45.5 route-map TO_R5 out

SW1:
no ip as-path access-list 1
ip as-path access-list 1 permit _54$
!
route-map TO_R3 permit 10
match as-path 1
set origin igp
!
route-map TO_R3 permit 100
!
router bgp 300
neighbor 155.1.37.3 route-map TO_R3 out

SW2:
router bgp 200
bgp bestpath as-path ignore

SW4:
router bgp 200
bgp bestpath as-path ignore

verification:

Rack1R3#show ip bgp regexp _54$
BGP table version is 36, local router ID is 150.1.3.3
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
*> 28.119.16.0/24   155.1.37.7                             0 300 100 54 i
* i                 155.1.45.4               0    100      0 100 54 i
*                   155.1.13.1                             0 100 54 ?
*> 28.119.17.0/24   155.1.37.7                             0 300 100 54 i
* i                 155.1.45.4               0    100      0 100 54 i
*                   155.1.13.1                             0 100 54 ?
*> 114.0.0.0        155.1.37.7                             0 300 100 54 i
* i                 155.1.45.4               0    100      0 100 54 i
*                   155.1.13.1                             0 100 54 ?
*> 115.0.0.0        155.1.37.7                             0 300 100 54 i
* i                 155.1.45.4               0    100      0 100 54 i
*                   155.1.13.1                             0 100 54 ?
*> 116.0.0.0        155.1.37.7                             0 300 100 54 i
* i                 155.1.45.4               0    100      0 100 54 i
*                   155.1.13.1                             0 100 54 ?
*> 117.0.0.0        155.1.37.7                             0 300 100 54 i
* i                 155.1.45.4               0    100      0 100 54 i
   Network          Next Hop            Metric LocPrf Weight Path
*                   155.1.13.1                             0 100 54 ?
*> 118.0.0.0        155.1.37.7                             0 300 100 54 i
* i                 155.1.45.4               0    100      0 100 54 i
*                   155.1.13.1                             0 100 54 ?
*> 119.0.0.0        155.1.37.7                             0 300 100 54 i
* i                 155.1.45.4               0    100      0 100 54 i
*                   155.1.13.1                             0 100 54 ?

BGP table version is 37, local router ID is 150.1.5.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
*>i28.119.16.0/24   155.1.37.7               0    100      0 300 100 54 i
*                   155.1.45.4                             0 100 54 ?
*>i28.119.17.0/24   155.1.37.7               0    100      0 300 100 54 i
*                   155.1.45.4                             0 100 54 ?
*>i114.0.0.0        155.1.37.7               0    100      0 300 100 54 i
*                   155.1.45.4                             0 100 54 ?
*>i115.0.0.0        155.1.37.7               0    100      0 300 100 54 i
*                   155.1.45.4                             0 100 54 ?
*>i116.0.0.0        155.1.37.7               0    100      0 300 100 54 i
*                   155.1.45.4                             0 100 54 ?
*>i117.0.0.0        155.1.37.7               0    100      0 300 100 54 i
*                   155.1.45.4                             0 100 54 ?
*>i118.0.0.0        155.1.37.7               0    100      0 300 100 54 i
*                   155.1.45.4                             0 100 54 ?
*>i119.0.0.0        155.1.37.7               0    100      0 300 100 54 i
*                   155.1.45.4                             0 100 54 ?

Friday, September 23, 2011

LAB:BGP Bestpath Selection: Always compare MED

- Create a new Loopback1 interface on both R6 and SW3 with the IP address 1.2.3.4/32 and advertise it into BGP on both R6 and SW3.
- Using just the MED attribute configure the network so that traffic from AS 200 going to this prefix is always received by SW3.





configuration:

R1:
ip prefix-list LOOPBACK1 permit 1.2.3.4/32
!
route-map TO_R3 permit 10
match ip address prefix-list LOOPBACK1
set metric 1000
!
route-map TO_R3 permit 100
!
router bgp 100
neighbor 155.1.13.3 route-map TO_R3 out

R2:
router bgp 200
bgp always-compare-med
R3:
router bgp 200
bgp always-compare-med

R4:
ip prefix-list LOOPBACK1 permit 1.2.3.4/32
!
route-map TO_R5 permit 10
match ip address prefix-list LOOPBACK1
set metric 1000
!
route-map TO_R5 permit 100
!
router bgp 100
neighbor 155.1.45.5 route-map TO_R5 out
 
R5:
router bgp 200
bgp always-compare-med

SW1:
ip prefix-list LOOPBACK1 permit 1.2.3.4/32
!
route-map TO_R3 permit 10
match ip address prefix-list LOOPBACK1
set metric 100
!
route-map TO_R3 permit 100
!
router bgp 300
neighbor 155.1.37.3 route-map TO_R3 out

SW2:
router bgp 200
bgp always-compare-med
SW3:
interface Loopback1
ip address 1.2.3.4 255.255.255.255
!
router bgp 300
network 1.2.3.4 mask 255.255.255.255

SW4:
router bgp 200
bgp always-compare-med

verification:

Rack1R3#show ip bgp 1.2.3.4
BGP routing table entry for 1.2.3.4/32, version 42
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Flag: 0x820
  Advertised to update-groups:
     1          2          3        
  100
    155.1.13.1 from 155.1.13.1 (150.1.1.1)
      Origin IGP, metric 1000, localpref 100, valid, external
  300
    155.1.37.7 from 155.1.37.7 (150.1.7.7)
      Origin IGP, metric 100, localpref 100, valid, external, best

BGP routing table entry for 1.2.3.4/32, version 43
Paths: (2 available, best #2, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1          3        
  100
    155.1.45.4 from 155.1.45.4 (150.1.4.4)
      Origin IGP, metric 1000, localpref 100, valid, external
  300
    155.1.37.7 (metric 2172416) from 155.1.23.3 (150.1.3.3)
      Origin IGP, metric 100, localpref 100, valid, internal, best

Rack1R2#show ip bgp 1.2.3.4
BGP routing table entry for 1.2.3.4/32, version 50
Paths: (2 available, best #2, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1        
  300
    155.1.37.7 (metric 2172416) from 155.1.0.5 (150.1.5.5)
      Origin IGP, metric 100, localpref 100, valid, internal
      Originator: 150.1.3.3, Cluster list: 150.1.5.5
  300
    155.1.37.7 (metric 2172416) from 155.1.23.3 (150.1.3.3)
      Origin IGP, metric 100, localpref 100, valid, internal, best

LAB: BGP Bestpath Selection - MED

- Using MED configure AS 100 so that traffic from AS 200 going to AS 54 enters via the link between R4 and R5.


  
Configuration:

R1:
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 155.1.13.3 remote-as 200
 neighbor 155.1.13.3 route-map TO_R3 out
 neighbor 155.1.146.4 remote-as 100
 neighbor 155.1.146.4 route-reflector-client
 neighbor 155.1.146.6 remote-as 100
 neighbor 155.1.146.6 route-reflector-client
 no auto-summary
!
ip as-path access-list 1 permit _54$
!
!
route-map TO_R3 permit 10
 match as-path 1
 set metric 1000
!
route-map TO_R3 permit 100


R4:
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 155.1.146.0 mask 255.255.255.0
 aggregate-address 155.1.0.0 255.255.0.0 summary-only
 neighbor 155.1.45.5 remote-as 200
 neighbor 155.1.45.5 route-map TO_R5 out
 neighbor 155.1.146.1 remote-as 100
 neighbor 204.12.1.254 remote-as 54
 no auto-summary
!
!        
no ip http server
no ip http secure-server
!
!
route-map TO_R5 permit 10
 match as-path 1
 set metric 100
!
route-map TO_R5 permit 100

verification:

Rack1R2#show ip bgp regexp _54$
BGP table version is 39, local router ID is 150.1.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
*>i28.119.16.0/24   155.1.45.4             100    100      0 100 54 i
* i                 155.1.45.4             100    100      0 100 54 i
*>i28.119.17.0/24   155.1.45.4             100    100      0 100 54 i
* i                 155.1.45.4             100    100      0 100 54 i
*>i114.0.0.0        155.1.45.4             100    100      0 100 54 i
* i                 155.1.45.4             100    100      0 100 54 i
*>i115.0.0.0        155.1.45.4             100    100      0 100 54 i
* i                 155.1.45.4             100    100      0 100 54 i
*>i116.0.0.0        155.1.45.4             100    100      0 100 54 i
* i                 155.1.45.4             100    100      0 100 54 i
*>i117.0.0.0        155.1.45.4             100    100      0 100 54 i
* i                 155.1.45.4             100    100      0 100 54 i
*>i118.0.0.0        155.1.45.4             100    100      0 100 54 i
* i                 155.1.45.4             100    100      0 100 54 i
*>i119.0.0.0        155.1.45.4             100    100      0 100 54 i
* i                 155.1.45.4             100    100      0 100 54 i

Rack1R5#show ip bgp regexp _54$
BGP table version is 23, local router ID is 150.1.5.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
*> 28.119.16.0/24   155.1.45.4             100             0 100 54 i
*> 28.119.17.0/24   155.1.45.4             100             0 100 54 i
*> 114.0.0.0        155.1.45.4             100             0 100 54 i
*> 115.0.0.0        155.1.45.4             100             0 100 54 i
*> 116.0.0.0        155.1.45.4             100             0 100 54 i
*> 117.0.0.0        155.1.45.4             100             0 100 54 i
*> 118.0.0.0        155.1.45.4             100             0 100 54 i
*> 119.0.0.0        155.1.45.4             100             0 100 54 i


Rack1R3#show ip bgp regexp _54$
BGP table version is 31, local router ID is 150.1.3.3
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
*  28.119.16.0/24   155.1.37.7                             0 300 100 54 i
*>i                 155.1.45.4             100    100      0 100 54 i
*                   155.1.13.1            1000             0 100 54 i
*  28.119.17.0/24   155.1.37.7                             0 300 100 54 i
*>i                 155.1.45.4             100    100      0 100 54 i
*                   155.1.13.1            1000             0 100 54 i
*  114.0.0.0        155.1.37.7                             0 300 100 54 i
*>i                 155.1.45.4             100    100      0 100 54 i
*                   155.1.13.1            1000             0 100 54 i
*  115.0.0.0        155.1.37.7                             0 300 100 54 i
*>i                 155.1.45.4             100    100      0 100 54 i
*                   155.1.13.1            1000             0 100 54 i
*  116.0.0.0        155.1.37.7                             0 300 100 54 i
*>i                 155.1.45.4             100    100      0 100 54 i
*                   155.1.13.1            1000             0 100 54 i
*  117.0.0.0        155.1.37.7                             0 300 100 54 i
*>i                 155.1.45.4             100    100      0 100 54 i
   Network          Next Hop            Metric LocPrf Weight Path
*                   155.1.13.1            1000             0 100 54 i
*  118.0.0.0        155.1.37.7                             0 300 100 54 i
*>i                 155.1.45.4             100    100      0 100 54 i
*                   155.1.13.1            1000             0 100 54 i
*  119.0.0.0        155.1.37.7                             0 300 100 54 i
*>i                 155.1.45.4             100    100      0 100 54 i
*                   155.1.13.1            1000             0 100 54 i

Thursday, September 22, 2011

notes: bgp deterministic-med vs bgp always-compare-med commands.

excerpt from cisco website:
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094925.shtml


Enabling the bgp deterministic-med command ensures the comparison of the MED variable when choosing routes advertised by different peers in the same autonomous system. Enabling the bgp always-compare-med command ensures the comparison of the MED for paths from neighbors in different autonomous systems. The bgp always-compare-med command is useful when multiple service providers or enterprises agree on a uniform policy for setting MED. Thus, for network X, if Internet Service Provider A (ISP A) sets the MED to 10, and ISP B sets the MED to 20, both ISPs agree that ISP A has the better performing path to X.


Command Examples


The examples in this section demonstrate how the bgp deterministic-med and bgp always-compare-med commands can influence MED-based path selection.

 
Note: Cisco Systems recommends enabling the bgp deterministic-med command in all new network rollouts. For existing networks, the command must either be deployed on all routers at the same time, or incrementally, with care to avoid possible internal BGP (iBGP) routing loops.


For example, consider the following routes for network 10.0.0.0/8:
entry1: AS(PATH) 500, med 150, external, rid 172.16.13.1
entry2: AS(PATH) 100, med 200, external, rid 1.1.1.1
entry3: AS(PATH) 500, med 100, internal, rid 172.16.8.4
The order in which the BGP routes were received is entry3, entry2, and entry1. (Entry3 is the oldest entry in the BGP table, and entry1 is the newest one.)


Note: When BGP receives multiple routes to a particular destination, it lists them in the reverse order that they were received, from the newest to the oldest. BGP then compares the routes in pairs, starting with the newest entry and moving toward the oldest entry (starting at top of the list and moving down). For example, entry1 and entry2 are compared. The better of these two is then compared to entry3, and so on

Example 1: Both Commands Disabled


Entry1 and entry2 are compared first. Entry2 is chosen as the better of these two because it has a lower router ID. The MED is not checked because the paths are from a different neighbor autonomous system. Next, entry2 is compared to entry3. Entry2 is chosen as the best path because it is external.

Example 2:  bgp always-compare-med Enabled


Entry1 is compared to entry2. These entries are from different neighbor autonomous systems, but since the bgp always-compare-med command is enabled, MED is used in the comparison. Of these two entries, entry1 is better because it has a lower MED. Next, entry1 is compared to entry3. The MED is checked again because the entries are now from the same autonomous system. Entry3 is chosen as the best path.

Example 3: bgp deterministic-med Enabled


When the bgp deterministic-med command is enabled, routes from the same autonomous system are grouped together, and the best entries of each group are compared. The BGP table looks like this:
entry1: AS(PATH) 100, med 200, external, rid 1.1.1.1
entry2: AS(PATH) 500, med 100, internal, rid 172.16.8.4 
entry3: AS(PATH) 500, med 150, external, rid 172.16.13.1
There is a group for AS 100 and a group for AS 500. The best entries for each group are compared. Entry1 is the best of its group because it is the only route from AS 100. Entry2 is the best for AS 500 because it has the lowest MED. Next, entry1 is compared to entry2. Since the two entries are not from the same neighbor autonomous system, the MED is not considered in the comparison. The external BGP route wins over the internal BGP route, making entry1 the best route.

Example 4: Both Commands Enabled


The comparisons in this example are the same as in Example 3, except for the last comparison between entry2 and entry1. The MED is taken into account for the last comparison because the bgp always-compare-med command is enabled. Entry2 is selected as the best path.


LAB: BGP BestPath Selection - Origin

- Using Origin attribute configure AS 200 so that traffic from AS 100 going to AS 254 enters via the link between R4 and R5.



configuration

R3
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 155.1.0.5 remote-as 200
 neighbor 155.1.13.1 remote-as 100
 neighbor 155.1.13.1 route-map TO_R1 out
 neighbor 155.1.23.2 remote-as 200
 neighbor 155.1.23.2 route-reflector-client
 neighbor 155.1.37.7 remote-as 300
 neighbor 155.1.58.8 remote-as 200
 neighbor 155.1.58.8 route-reflector-client
 neighbor 155.1.108.10 remote-as 200
 neighbor 155.1.108.10 route-reflector-client
 no auto-summary
!
!
ip as-path access-list 1 permit _254$
!
!
route-map TO_R1 permit 10
 match as-path 1
 set origin incomplete
!
route-map TO_R1 permit 100

R4
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 155.1.0.2 remote-as 200
 neighbor 155.1.0.2 route-reflector-client
 neighbor 155.1.23.3 remote-as 200
 neighbor 155.1.45.4 remote-as 100
 neighbor 155.1.45.4 route-map TO_R4 out
 neighbor 155.1.58.8 remote-as 200
 neighbor 155.1.58.8 route-reflector-client
 neighbor 155.1.108.10 remote-as 200
 neighbor 155.1.108.10 route-reflector-client
 no auto-summary
!
ip as-path access-list 1 permit _254$
!
!
route-map TO_R4 permit 10
 match as-path 1
 set origin igp
!
route-map TO_R4 permit 100


verification:
Rack1R1#show ip bgp regexp _254$
BGP table version is 35, local router ID is 150.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
*>i205.90.31.0      155.1.45.5               0    100      0 200 254 i
*                   155.1.13.3                             0 200 254 ?
*>i220.20.3.0       155.1.45.5               0    100      0 200 254 i
*                   155.1.13.3                             0 200 254 ?
*>i222.22.2.0       155.1.45.5               0    100      0 200 254 i
*                   155.1.13.3                             0 200 254 ?

Rack1R4#show ip bgp regexp _254$
BGP table version is 31, local router ID is 150.1.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
*> 205.90.31.0      155.1.45.5                             0 200 254 i
*> 220.20.3.0       155.1.45.5                             0 200 254 i
*> 222.22.2.0       155.1.45.5                             0 200 254 i

R6 is a bit different because route to Sw1 has a longer path so it chooses R5, so the origin doesnt count in the decision process.


Rack1R6# show ip bgp regexp _254$
BGP table version is 18, local router ID is 150.1.6.6
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
*  205.90.31.0      155.1.67.7                             0 300 200 254 ?
*>i                 155.1.45.5               0    100      0 200 254 i
*  220.20.3.0       155.1.67.7                             0 300 200 254 ?
*>i                 155.1.45.5               0    100      0 200 254 i
*  222.22.2.0       155.1.67.7                             0 300 200 254 ?
*>i                 155.1.45.5               0    100      0 200 254 i

LAB: BGP BestPath Selection - AS Path Prepend

- Using AS-Path Prepending, configure AS 200 so that traffic from AS 100 going to AS 254 enters via the link to AS 300.


configuration:

R3
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 155.1.0.5 remote-as 200
 neighbor 155.1.13.1 remote-as 100
 neighbor 155.1.13.1 route-map TO_R1 out
 neighbor 155.1.23.2 remote-as 200
 neighbor 155.1.23.2 route-reflector-client
 neighbor 155.1.37.7 remote-as 300
 neighbor 155.1.58.8 remote-as 200
 neighbor 155.1.58.8 route-reflector-client
 neighbor 155.1.108.10 remote-as 200
 neighbor 155.1.108.10 route-reflector-client
 no auto-summary
!
ip as-path access-list 1 permit _254$
!
!
route-map TO_R1 permit 10
 match as-path 1
 set as-path prepend 200 200 200

R5:
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 155.1.0.2 remote-as 200
 neighbor 155.1.0.2 route-reflector-client
 neighbor 155.1.23.3 remote-as 200
 neighbor 155.1.45.4 remote-as 100
 neighbor 155.1.45.4 route-map TO_R4 out
 neighbor 155.1.58.8 remote-as 200
 neighbor 155.1.58.8 route-reflector-client
 neighbor 155.1.108.10 remote-as 200
 neighbor 155.1.108.10 route-reflector-client
 no auto-summary
!
ip as-path access-list 1 permit _254$
!
!
route-map TO_R4 permit 10
 match as-path 1
 set as-path prepend 200 200 200


verification

Rack1R6#show ip bgp reg
Rack1R6#show ip bgp regexp _254$
BGP table version is 23, local router ID is 150.1.6.6
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
*> 205.90.31.0      155.1.67.7                    200      0 300 200 254 ?
*> 220.20.3.0       155.1.67.7                    200      0 300 200 254 ?
*> 222.22.2.0       155.1.67.7                    200      0 300 200 254 ?

Rack1R4#show ip bgp regexp _254$
BGP table version is 28, local router ID is 150.1.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
*>i205.90.31.0      155.1.67.7               0    200      0 300 200 254 ?
*                   155.1.45.5                             0 200 200 200 200 254 ?
*>i220.20.3.0       155.1.67.7               0    200      0 300 200 254 ?
*                   155.1.45.5                             0 200 200 200 200 254 ?
*>i222.22.2.0       155.1.67.7               0    200      0 300 200 254 ?
*                   155.1.45.5                             0 200 200 200 200 254 ?

Rack1R1#show ip bgp regexp _254$
BGP table version is 29, local router ID is 150.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
*>i205.90.31.0      155.1.67.7               0    200      0 300 200 254 ?
*                   155.1.13.3                             0 200 200 200 200 254 ?
*>i220.20.3.0       155.1.67.7               0    200      0 300 200 254 ?
*                   155.1.13.3                             0 200 200 200 200 254 ?
*>i222.22.2.0       155.1.67.7               0    200      0 300 200 254 ?
*                   155.1.13.3                             0 200 200 200 200 254 ?

Wednesday, September 21, 2011

LAB: BGP Auto Summary

- Configure R4 and R6 to originate classful auto-summaries for all of your internally assigned address space.
-  BB1 and BB3 should not see any of the subnet advertisements that make up this summary.
- Ensure full reachability from your internal network to all routes learned from AS 54.
- Do not use the aggregate-address command to accomplish this and use different methods to originate routes at R4 and R6.

BGP auto-summarization is the legacy feature that automatically summarizes network prefixes to their classful boundaries when the prefixes are advertised into BGP. The automatic summarization starts working when you enable it using the command auto-summary under BGP process configuration. It only applies in
the following two cases:

1) A network command is configured with a classful subnet, e.g. network 54.0.0.0 or network 155.1.0.0 or network 192.168.1.0. In this case, the classful aggregate is installed into BGP table if there is a prefix in the IGP table that is a subnet to the classful network. For example, if you advertise network 150.1.0.0 than it would work if any of the prefixes 150.1.2.0/24 or 150.1.3.0/24 etc is in the IGP table. This is in contrary with the regular exact match requirement imposed by the BGP network statements.
 
2) Prefixes are advertised into BGP using route redistribution. All redistributed networks are subject to auto-summarization, i.e. only the major classful subnets are installed in the BGP table.
 
Since the feature is legacy, you wont seem much use of it nowadays. However, it may become handy in some tricky CCIE scenario that verifies your knowledge of BGP advertisement methods. This scenario uses both methods of route origination with prefix auto-summarization: classful network statement and route
redistribution.


R1
router eigrp 100
 network 150.1.1.1 0.0.0.0
 network 155.1.0.0
 no auto-summary
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor IBGP_PEERS peer-group
 neighbor IBGP_PEERS remote-as 100
 neighbor IBGP_PEERS update-source Loopback0
 neighbor IBGP_PEERS route-reflector-client
 neighbor 150.1.3.3 peer-group IBGP_PEERS
 neighbor 150.1.4.4 peer-group IBGP_PEERS
 neighbor 150.1.5.5 peer-group IBGP_PEERS
 neighbor 150.1.6.6 peer-group IBGP_PEERS
 no auto-summary


R3
router eigrp 100
 network 150.1.3.3 0.0.0.0
 network 155.1.0.0
 no auto-summary
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 150.1.1.1 remote-as 100
 neighbor 150.1.1.1 update-source Loopback0
 neighbor 155.1.23.2 remote-as 200
 no auto-summary

R4
router eigrp 100
 network 150.1.4.4 0.0.0.0
 network 155.1.0.0
 network 204.12.1.0
 no auto-summary
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 204.12.1.0
 redistribute connected route-map CONNECTED_TO_BGP
 neighbor 150.1.1.1 remote-as 100
 neighbor 150.1.1.1 update-source Loopback0
 neighbor 204.12.1.254 remote-as 54
 auto-summary
!
route-map CONNECTED_TO_BGP permit 10
 match interface Loopback0 FastEthernet0/1

R6
router eigrp 100
 passive-interface Serial0/0
 network 54.0.0.0
 network 150.1.6.6 0.0.0.0
 network 155.1.0.0
 no auto-summary
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 54.1.1.0 mask 255.255.255.0
 network 150.1.0.0
 network 155.1.0.0
 neighbor 54.1.1.254 remote-as 54
 neighbor 150.1.1.1 remote-as 100
 neighbor 150.1.1.1 update-source Loopback0
 auto-summary

verification 

the routes via redistribution in bgp will appear as incomplete (?).

Rack1R4#show ip bgp regexp ^$
BGP table version is 72, local router ID is 150.1.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
r>i54.1.1.0/24      150.1.6.6                0    100      0 i
* i150.1.0.0        150.1.6.6                0    100      0 i
*>                  0.0.0.0                  0         32768 ?
* i155.1.0.0        150.1.6.6                0    100      0 i
*>                  0.0.0.0                  0         32768 ?
*> 204.12.1.0       0.0.0.0                  0         32768 i

Now look up those prefixes in the BGP table. Notice that both prefixes appear as if they were NOT summarized in classic BGP sense. That is, prefixes don’t have any information about the aggregator or the atomic aggregate attribute. This is due to the fact that summarization was performed on the IGP prefixes, not the BGP networks.

Rack1R4#show ip bgp 150.1.0.0
BGP routing table entry for 150.1.0.0/16, version 70
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Flag: 0x820
  Advertised to update-groups:
     1          2        
  Local
    150.1.6.6 (metric 156160) from 150.1.1.1 (150.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, internal
      Originator: 150.1.6.6, Cluster list: 150.1.1.1
  Local
    0.0.0.0 from 0.0.0.0 (150.1.4.4)
      Origin incomplete, metric 0, localpref 100, weight 32768, valid, sourced, best

Rack1R4#show ip bgp 155.1.0.0 
BGP routing table entry for 155.1.0.0/16, version 69
Paths: (2 available, best #2, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1          2        
  Local
    150.1.6.6 (metric 156160) from 150.1.1.1 (150.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, internal
      Originator: 150.1.6.6, Cluster list: 150.1.1.1
  Local
    0.0.0.0 from 0.0.0.0 (150.1.4.4)
      Origin incomplete, metric 0, localpref 100, weight 32768, valid, sourced, best

Rack1R4#
Rack1R4#show ip bgp neighbors 204.12.1.254 advertised-routes
BGP table version is 76, local router ID is 150.1.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
r>i54.1.1.0/24      150.1.6.6                0    100      0 i
*> 150.1.0.0        0.0.0.0                  0         32768 ?
*> 155.1.0.0        0.0.0.0                  0         32768 ?
*> 204.12.1.0       0.0.0.0                  0         32768 i

Total number of prefixes 4 




the routes via network statement in bgp will appear as igp.

Rack1R6#show ip bgp regexp ^$
BGP table version is 67, local router ID is 150.1.6.6
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
*> 54.1.1.0/24      0.0.0.0                  0         32768 i
*> 150.1.0.0        0.0.0.0                  0         32768 i
*> 155.1.0.0        0.0.0.0                  0         32768 i
r>i204.12.1.0       150.1.4.4                0    100      0 i

Rack1R6#show ip bgp neighbors 54.1.1.254 advertised-routes
BGP table version is 67, local router ID is 150.1.6.6
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
*> 54.1.1.0/24      0.0.0.0                  0         32768 i
*> 150.1.0.0        0.0.0.0                  0         32768 i
r>i150.1.2.0/24     155.1.23.2               0    100      0 200 i
*> 155.1.0.0        0.0.0.0                  0         32768 i
r>i204.12.1.0       150.1.4.4                0    100      0 i
*>i205.90.31.0      155.1.23.2               0    100      0 200 254 ?
*>i220.20.3.0       155.1.23.2               0    100      0 200 254 ?
*>i222.22.2.0       155.1.23.2               0    100      0 200 254 ?

Total number of prefixes 8