Posts

Showing posts from September, 2012

BGP Origin Code Attribute

Image
  MED or Multi Exit Discriminator is non-transitive attribute and is used to discriminate between two entry point of AS The lower MED value is preferred In our topology, both R5 and R6 will generate the same prefixes through BGP to R7 10.1.65.0/30 10.1.65.4/30 10.1.65.8/30 As we can see R7 is using R5 to route to these prefixes because the router-id is lower for R5 than R6 Using Origin-code attribute modify R5  so R7 route through R6 to reach these prefixes As we know  if Weight, Local preference, Originate and AS-PATH attribute for a route are the same BGP will compare the origin code attribute Origin Code is well know mandatory attribute where IGP is preferred over EGP over incomplete we has these routes  advertised through the network statement in the BGP process on R5 so I we change the origin to incomplete i.e redistribute them this will change their origin code to incomplete and therefore R7 will prefer R6 routes This can be seen from the BGP table on R7 below

BGP Local Preference

Image
  In the above topology R3 will generate these 2 prefixes 3.3.0.0/24 and 3.3.1.0/24 and R4 will generate these 2 prefixes 4.4.0.0/24 and 4.4.1.0/24 into BGP Our goal is to use local preference to force R1 to route to 3.3.0.0/24 through R4 Now let’s check the BGP routing table of R1 and R2 before doing any changes   As we can see both  R1 and R2 are using R3 to route to 3.3.0.0/24 now to apply local preference we need to match the prefix with a prefix list and then use a route-map to apply the route-map inbound to R4 on R1 (we want to influence outbound traffic so route-map should be applied inbound) R1(config)#ip prefix-list R3_NET permit 3.3.0.0/24 R1(config)#route-map LOCAL_PREF permit 10 R1(config-route-map)#match ip address prefix-list R3_NET R1(config-route-map)#set local-preference 200 R1(config-route-map)#route-map LOCAL_PREF permit 100     R1(config)#router bgp 100 R1(config-router)#neighbor 10.1.14.4 route-map LOCAL_PREF in Remember to clear the BGP ne

BGP Weight Attribute

Image
Before we start the lab let's see the BGP path selection process If the path specifies a next hop that is inaccessible, drop the update. •Prefer the path with the highest weight. •If the weights are the same, prefer the path with the largest local preference. •If the local preferences are the same, prefer the path that was originated by BGP running on this router. •If no route was originated, prefer the route that has the shortest AS_path. •If all paths have the same AS_path length, prefer the path with the lowest origin code (where IGP is lower than EGP, and EGP is lower than incomplete). •If the origin codes are the same, prefer the path with the lowest MED attribute. •If the paths have the same MED, prefer the external path over the internal path. •If the paths are still the same, prefer the path through the closest IGP neighbor. •Prefer the path with the lowest IP address, as specified by the BGP router ID. I read this on CCIE Pursuit blog We Love Oranges As O

OSPF Filter Inter-area routes

Image
Topology consist of 3 OSPF areas Router R2 generates the following routes into Area 0 2.2.0.0/24 2.2.1.0/24 2.2.2.0/24 2.2.3.0/24 Router 5 generates the following routes into Area 135 5.5.0.0/24 5.5.1.0/24 5.5.2.0/24 5.5.3.0/24 Router 6 generates the following routes into Area 146 4.4.0.0/24 4.4.1.0/24 4.4.2.0/24 4.4.3.0/24 So let’s see how we can filter some Inter area routes Task 1 Filter these 2 prefixes 2.2.0.0/24 and 2.2.3.0/24 form being propagated outside area 0 and allow any other routes So do that we create a prefix list to deny these 2 routes and allow everything else ip prefix-list FROM_AREA0 seq 5 deny 2.2.0.0/24 ip prefix-list FROM_AREA0 seq 10 deny 2.2.3.0/24 ip prefix-list FROM_AREA0 seq 15 permit 0.0.0.0/0 le 32 then we apply a filter list under the ospf configuration   on R1, the filtering has to be done on the ABR routers We need to filter these routes out from Area 0 so the filter list will be applied outbound

BGP disable-connected-check

Image
All routers are running OSPF as IGP iBGP is configured between R1 and R3 eBGP is configured between R1  and R2 and R3 and R2 eBGP between R1 and R2 should be configured using their loopback interfaces, one way to achieve this  is to configure eBGP multihop where TTL values of the BGP packets is increased. Another way of doing it  is to use the   disable-connected-chec k   command under the BGP configuration, this will allow the two routers to become neighbours but only through direct connected links since the TTL is not touched  let's check the configurations on R1 and R2 R1(config-router)#do sh run | sec router bgp router bgp 100  no synchronization  bgp log-neighbor-changes  neighbor 2.2.2.2 remote-as 200  neighbor 2.2.2.2 disable-connected-check  neighbor 2.2.2.2 update-source Loopback0  neighbor 10.1.13.3 remote-as 100  no auto-summary R2(config-router)#do sh run | b router bgp router bgp 200  no synchronization  bgp log-neighbor-chan