BGP-Syn

Embed Size (px)

Citation preview

  • 7/30/2019 BGP-Syn

    1/11

    AS 300

    AS 600

    R1

    AS 100

    R2 R3

    R4 R5 R6

    1.0.0.0/8

    R1 is advertising network 1.0.0.0/8 in BGP to R2, the goal is to advertise this network to AS 600.

    The administrator of AS 100 decided to establish an IBGP session between R2 and R5, so when R2receives the route, it gives it to R5 and R5 can advertise it to R6 in AS 600.R1 advertises network 1.0.0.0/8 to R2, R2 advertises the network to R5, and R5 advertises this networkto R6, and R6 can see the network in its BGP table. Lets assume that next -hop reachability is handledsomehow.NOW.R6 needs to connect to network 1.0.0.0/8. The traffic goes to R5, and R5 has no choice but to gothrough R3 or R4, no matter which path it takes the traffic is dropped, because neither R3 nor R4 knowabout this network. So you can see the problem, and for this reason they came up with theSynchronization rule, and this rule has two sections/parts.

    The synchronization rule says that if I receive a route from an IBGP peer, I have to check my routing

    table, and if that same route is in my routing table, I will validate the route, if NOT I will NOT validate theroute. If the route is NOT validated, it is NOT advertised to any peer.

    The big question is how will I see the route in my routing table to begin with? I will see the route in myrouting table if the border router, in this case R2 redistributes the route/s into the IGP that I am runningin my AS.But when the number of routes reached 10,000 to 20,000, they realized that NONE of the IGPs out therecan handle that many routes, especially, when the number of routes kept on growing.

    So they decided to run BGP on all routers, and they established an IBGP sessions between R2 and R3, R2and R4, and R3 and R4 established an IBGP session with R5.

    So they were thinking that when R2 receives the route, it gives it to R3 and R4 and these routers willadvertise the route to R5 and R5 will advertise it out to AS 600. But they realized that they are runninginto a routing loop, because once R2 advertises the route to R3, R3 can advertise the route to R5, and R5can advertise it to R4 and R6, and R4 can advertise it to R2 and the cycle can repeat itself forming arouting loop.

  • 7/30/2019 BGP-Syn

    2/11

    Therefore, they came up with another rule, and they called it Split Horizon, meaning that when an IBGProuter receives a route from another IBGP peer, it will NOT advertise it to another IBGP peer, this fixedthe loop and caused all IBGP routers to have a full IBGP mesh neighbor adjacency.

    Without going on and on, lets look at the second Synchronization rule:

    1.1.1.1 /8

    F0/0

    AS 100

    10.1.12.0 /24

    AS 234

    R1 R2 R3 R4

    R5

    AS 500

    10.1.23.0 /24 10.1.34.0 /24

    10.1.45.0 /24

    F0/0F0/1

    F0/1

    Rules:

    DO NOT enable BGP Synchronization.DO NOT configure another OSPF process.DO NOT configure another static route to accomplish this task.

    Task 1

    Configure OSPF on the following routers/interfaces:

    Router Interface / IP Address Area Router-idR2 F0/1 = 10.1.23.2 /24 Area 0 0.0.0.2R3 F0/1 = 10.1.23.3/24

    F0/0 = 10.1.34.3/24

    Area 0 0.0.0.3

    R4 F0/1 = 10.1.34.4/24 Area 0 0.0.0.4

    On R2

    R2(config)# Router ospf 1

  • 7/30/2019 BGP-Syn

    3/11

    R2(config-router)# router-id 0.0.0.2 R2(config-router)# Network 10.1.23.2 0.0.0.0 area 0

    On R3

    R3(config)# Router ospf 1 R3(config-router)# router-id 0.0.0.3 R3(config-router)# Network 10.1.23.3 0.0.0.0 area 0R3(config-router)# Network 10.1.34.3 0.0.0.0 area 0

    On R4

    R4(config)# Router ospf 1 R4(config-router)# router-id 0.0.0.4 R4(config-router)# Network 10.1.34.4 0.0.0.0 area 0

    To verify the configuration:

    On R2

    R2# Show ip ospf neighbor

    Neighbor ID Pri State Dead Time Address Interface0.0.0.3 1 FULL/DR 00:00:39 10.1.23.3 FastEthernet0/1

    R2# Show ip route ospf | I O

    O 10.1.34.0 [110/2] via 10.1.23.3, 00:00:33, FastEthernet0/1

    On R3

    R3# Show ip ospf neighbor

    Neighbor ID Pri State Dead Time Address Interface0.0.0.4 1 FULL/DR 00:00:49 10.1.34.4 FastEthernet0/00.0.0.2 1 FULL/DR 00:00:49 10.1.23.2 FastEthernet0/1

    On R4

    R4# Show ip ospf neighbor

    Neighbor ID Pri State Dead Time Address Interface0.0.0.3 1 FULL/DR 00:00:59 10.1.34.3 FastEthernet0/0

  • 7/30/2019 BGP-Syn

    4/11

    Task 2

    Configure BGP AS 100 on R1 and configure this router to advertise its loopback 0 interface in this AS.This router should be configured to establish an EBGP session with R2 in AS 234. R2 should beconfigured with a BGP router-id of 2.2.2.2. These routers should establish an EBGP session using the IP

    Address of their link. The BGP Synchronization MUST be enabled on all routers.

    On R1

    R1(config)# Router bgp 100 R1(config-router)# SynchronizationR1(config-router)# Neighbor 10.1.12.2 remote-as 234 R1(config-router)# Network 1.0.0.0

    On R2

    R2(config)# Router bgp 234R2(config-router)# bgp router-id 2.2.2.2 R2(config-router)# Synchronization R2(config-router)# Neighbor 10.1.12.1 remote-as 100

    To verify the configuration:

    On R2

    R2# Show ip bgp | B Network

    Network Next Hop Metric LocPrf Weight Path*> 1.0.0.0 10.1.12.1 0 0 100 i

    Task 3

    Configure a full mesh IBGP sessions between routers R2, R3 and R4 using the IP address of their links.These routers should all be configured in AS 234. The BGP Synchronization MUST be enabled on allrouters.

    On R2

    R2(config)# Router bgp 234 R2(config-router)# Neighbor 10.1.23.3 remote-as 234 R2(config-router)# Neighbor 10.1.23.3 next-hop-self R2(config-router)# Neighbor 10.1.34.4 remote-as 234R2(config-router)# Neighbor 10.1.34.4 next-hop-self

  • 7/30/2019 BGP-Syn

    5/11

    On R3

    R3(config)# Router bgp 234 R3(config-router)# Synchronization

    R3(config-router)# Neighbor 10.1.23.2 remote-as 234 R3(config-router)# Neighbor 10.1.34.4 remote-as 234

    On R4

    R4(config)# Router bgp 234 R4(config-router)# SynchronizationR4(config-router)# Neighbor 10.1.23.2 remote-as 234R4(config-router)# Neighbor 10.1.34.3 remote-as 234

    To verify the configuration:

    On R2

    R2# Show ip bgp | B Network

    Network Next Hop Metric LocPrf Weight Path*> 1.0.0.0 10.1.12.1 0 0 100 i

    R2# Show ip bgp summary | B Neighbor

    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd10.1.12.1 4 100 12 11 2 0 0 00:08:59 110.1.23.3 4 234 6 7 2 0 0 00:02:04 010.1.34.4 4 234 4 5 2 0 0 00:00:43 0

    On R3

    R3# Show ip bgp | B Network

    Network Next Hop Metric LocPrf Weight Path* i1.0.0.0 10.1.23.2 0 100 0 100 i

    R3# Show ip bgp summary | B Neighbor

    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd10.1.23.2 4 234 7 6 1 0 0 00:02:04 110.1.34.4 4 234 4 4 1 0 0 00:00:50 0

    On R4

    R4# Show ip bgp | B Network

  • 7/30/2019 BGP-Syn

    6/11

    Network Next Hop Metric LocPrf Weight Path

    * i1.0.0.0 10.1.23.2 0 100 0 100 i

    R4# Show ip bgp summary | B Neighbor

    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd10.1.23.2 4 234 5 4 1 0 0 00:00:43 110.1.34.3 4 234 4 4 1 0 0 00:00:50 0

    Task 4

    Configure an EBGP session between R4 in AS 234 and R5 in AS 500. The BGP Synchronization MUST beenabled on all routers.

    On R4

    R4(config)# Router bgp 234 R4(config-router)# Neighbor 10.1.45.5 remote-as 500

    On R5

    R5(config)# Router bgp 500R5(config-router)# SynchronizationR5(config-router)# Neighbor 10.1.45.4 remote-as 234

    To verify the configuration:

    On R4

    R4# Show ip bgp summary | B Neighbor

    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd10.1.23.2 4 234 10 9 1 0 0 00:05:09 110.1.34.3 4 234 9 9 1 0 0 00:05:16 010.1.45.5 4 500 4 4 1 0 0 00:00:37 0

    On R5

    R5# Show ip bgp summary | B Neighbor

    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd10.1.45.4 4 234 5 5 1 0 0 00:01:09 0

  • 7/30/2019 BGP-Syn

    7/11

    Task 5

    Configure R2 such that all the other routers can see and have reachability to network 1.0.0.0/8advertised by R1 in AS 100. DO NOT disable BGP Synchronization, or configure a static route.

    On R2

    R2(config)# Router ospf 1 R2(config-router)# redistribute bgp 234 subnets

    To verify the configuration:

    On R3

    R3# Show ip route ospf | I O

    O E2 1.0.0.0/8 [110/1] via 10.1.23.2, 00:00:43, FastEthernet0/1

    R3# Show ip bgp | B Network

    Network Next Hop Metric LocPrf Weight Path* i1.0.0.0 10.1.23.2 0 100 0 100 i

    On R4

    R4# Show ip route ospf | I O

    O E2 1.0.0.0/8 [110/1] via 10.1.34.3, 00:01:10, FastEthernet0/0O 10.1.23.0 [110/2] via 10.1.34.3, 00:50:09, FastEthernet0/0

    R4# Show ip bgp | B Network

    Network Next Hop Metric LocPrf Weight Path* i1.0.0.0 10.1.23.2 0 100 0 100 i

    R4# Ping 10.1.23.2

    Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.1.23.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms

    We have reachability to the next hop IP address, but BGP does not have a best route so therefore, the greater thansign is not present (This is the > to the left of the network):

  • 7/30/2019 BGP-Syn

    8/11

    R4# Show ip bgp 1.0.0.0

    BGP routing table entry for 1.0.0.0/8, version 0Paths: (1 available, no best path)

    Not advertised to any peer10010.1.23.2 (metric 2) from 10.1.23.2 (2.2.2.2)

    Origin IGP, metric 0, localpref 100, valid, internal, not synchronized

    On R5

    R5# Show ip bgpR5#

    When redistributing between OSPF and BGP, we should review BGPs synchronization rule which states: An IBGP learned prefix will not be advertised to another BGP speaker unless that same prefix resides in the IBGPspeakers local IGP table.Basically this rule was set to stop blackholing routes. This rule is well defined in RFC 1745 and it possesses anotherrequirement, and thats when OSPF is the IGP used within the AS. This rule does not apply if the IGP is NOT OSPF.

    This RFC states that if OSPF is used as the IGP in the AS, the router ids of OSPF and BGP on the border router, whichis the router that performs the redistribution of BGP into OSPF must be the same.

    Lets check the router -ids of BGP and OSPF on R2:

    On R2

    R2# Show ip ospf | Inc IDRouting Process "ospf 1" with ID 0.0.0.2

    R2# Show ip bgp | Inc ID BGP table version is 2, local router ID is 2.2.2.2

    We can see that the router ids do not match. Lets change the router id of OSPF process on R2 to be 2.2.2.2:

    On R2

    R2(config)# Router ospf 1 R2(config-router)# router-id 2.2.2.2

    On All routers:

    Rx# Clear ip bgp *

    Rx# Clear ip ospf proc Reset ALL OSPF processes? [no]: Y

  • 7/30/2019 BGP-Syn

    9/11

    Lets verify the configuration:

    On R2

    R2# Show ip route | B GateGateway of last resort is not set

    B 1.0.0.0/8 [20/0] via 10.1.12.1, 00:04:4810.0.0.0/24 is subnetted, 3 subnets

    C 10.1.12.0 is directly connected, FastEthernet0/0C 10.1.23.0 is directly connected, FastEthernet0/1 O 10.1.34.0 [110/2] via 10.1.23.3, 00:01:05, FastEthernet0/1

    R2# Show ip bgp | B Network

    Network Next Hop Metric LocPrf Weight Path*> 1.0.0.0 10.1.12.1 0 0 100 i

    On R3

    R3# Show ip route ospf | I O

    O E2 1.0.0.0/8 [110/1] via 10.1.23.2, 00:01:40, FastEthernet0/1

    R3# Show ip bgp | B Network

    Network Next Hop Metric LocPrf Weight Pathr>i1.0.0.0 10.1.23.2 0 100 0 100 i

    We can see that 1.0.0.0 prefix has a rib failure, lets see why?

    R3# Show ip bgp rib-failure | B Network

    Network Next Hop RIB-failure RIB-NH Matches1.0.0.0 10.1.23.2 Higher admin distance n/a

    On R4

    R4# Show ip route ospf | I O

    O E2 1.0.0.0/8 [110/1] via 10.1.34.3, 00:04:46, FastEthernet0/0O 10.1.23.0 [110/2] via 10.1.34.3, 00:05:29, FastEthernet0/0

    R4# Show ip bgp | B Network

    Network Next Hop Metric LocPrf Weight Pathr>i1.0.0.0 10.1.23.2 0 100 0 100 i

  • 7/30/2019 BGP-Syn

    10/11

    Lets see if this network is adver tised to R5 in AS 500:

    On R5

    R5# Show ip bgp | B Network

    Network Next Hop Metric LocPrf Weight Path*> 1.0.0.0 10.1.45.4 0 234 100 i

    R5# Show ip route bgp | Inc 1.0.0.0

    B 1.0.0.0/8 [20/0] via 10.1.45.4, 00:06:47

    To test reachability:

    Since R1 does NOT have a route back to 10.1.45.0 /24 network, R2 is configured to advertise a default route to R1;for reachability to network 10.1.45.0 /24 in AS 234, R4 is configured to advertise network 10.1.45.0 /24 in OSPF; R4is also configured with a passive- interface so the routers in AS 500 do not see AS 234s internal routes.

    On R2

    R2(config)# Router bgp 234 R2(config-router)# Neighbor 10.1.12.1 default-originate

    On R4

    R4(config)# router ospf 1

    R4(config-router)# Network 10.1.45.4 0.0.0.0 area 0R4(config-router)# Passive-interface F0/1

    To verify the configuration:

    On R1

    R1# Show ip route bgp

    B* 0.0.0.0/0 [20/0] via 10.1.12.2, 00:01:44

    On R2R2# Show ip route ospf | I O O 10.1.45.0 [110/3] via 10.1.23.3, 00:02:08, FastEthernet0/1O 10.1.34.0 [110/2] via 10.1.23.3, 00:23:50, FastEthernet0/1

    To test the configuration:

    On R5

  • 7/30/2019 BGP-Syn

    11/11

    R5# Ping 1.1.1.1

    Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:!!!!!

    Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

    Ticket 6

    Erase the startup configuration and the vlan.dat and reload the devices before proceeding to the nextscenario.