Wednesday, March 22, 2017

TroubleShooting BGP Routing Issues

                         Let’s now consider common BGP Routing issues for example, we might have incorrect network statement, let’s double check to make sure that we have enter the network statement correctly, let’s make sure that we haven’t transpose to couple of numbers in the IP Address in the example but something that bit more unique to BGP is a concept of the “Next Hop Router
                           A big point to keep in mind is that when “an advertisement comes into Autonomous System and it’s advertised over IBGP connections to Routers all belonging to the same Autonomous System, by default the next Hop Router information is not updated” and it’s possible that we got a Router residing in this Autonomous System that has a no way to get to the next Hop Address that’s been advertised to in this BGP advertisement.
                            One way we could address that is to “Redistribute BGP into the IGP”, we could alternately set up the static Route to tell the Router how to get to that Next-Hop-Address however, we could go into the BGP Router Configuration of a Router and say “Neighbor” and then we give the neighbors IP Addresses or Peer Group name and then we say “Next-Hop-Self”
                           It’s going to cause a Router to advertise its IP Address as the Next Hop IP Address when it’s sending a BGP Routing update to an IBGP neighbors, those are few different ways we might be able to address an issue where a Router within an Autonomous System is not able to reach the next Hop Route advertised into BGP Advertisement.
                            Similar to EIGRP we could have a Split-Horizon issue which say’s if a Route was learned on an interface that interface is not going to advertised the Route back out and in a point to multipoint network maybe like frame-relay that could be an issue.
                    We could have Filtered Routes, we might be doing some Route Filtering maybe intentionally or maybe there is more believable Route like a Static Route in IP Routing Table and it’s possible that BGP is taking a Sub Optimal Route because of Inappropriate path Attributes
                     Infect to illustrate that bit further, let’s go out to interface and Troubleshoot a very real world issue when you got an enterprise network connected out to more than One ISP and by default we are taking a sub-optimal path and let’s see how to fix that.
                   Notice that Router R2 has a connection of 768K out of ISP1, it’s got a 1.544Mbps connection out to ISP2 and clearly, we would prefer to use the ISP that had a highest bandwidth we would prefer to use ISP2, let’s see what we using right now though, if we do a
Ø  R2#show ip route
                          I am using 9.9.9.9 as an example, of some internet destination, that’s actually a Loopback interface on my INET Router on picture, and it looks like to get there i am gonna go via 198.51.100.2, that’s actually ISP1 that’s the slower link and why is that? let’s take a look at BGP Table.
Ø  R2#show ip bgp
                     BGP knows about two different ways to get there it knows that we could get there via ISP2 or ISP1 but notice the (greater than >) sign, this is telling us that we were using ISP1 and that’s this enterprise network Autonomous System 65001 as it going out to the internet, how does it look from the internet as coming back in, let’s go to the INTERNET Router and let’s do a
Ø  INET#show ip bgp
                      Let’s look at one of Routes inside the Enterprise Autonomous System, 192.0.2.0 as an example, i can get their couple of different ways but notice the Greater than “>” sign is it looks like from the prospective of the internet we gonna go via ISP1 again we going via the slower link and underline causes most likely a lower Router ID(Next Hop Address) and in the Real World, we probably not gonna be able to do any work on the ISP Router we have to do our work on Enterprise Router in this case Router R2, and we want to be able to do Configuration just on R2 to influence both Outbound and Inbound Path Selection.
                      To influence the Outbound Path Selection let’s use the Local Preference, notice that we do not currently have a Local-Preference set for Routes that we learned via the ISP1 and ISP2 Routers, let’s change and Higher Local Preference values are preferred, to do this we create a couple of Route-Maps. I am gonna create a Route-map for ISP1
Ø  R2(config)#route-map ISP1
Ø  R2(config-route-map)#set local-preference 100
                             I am going to apply this to Routes that I am learning from ISP1, let’s create another Route-Map for ISP2 and i am gonna set the higher Local-Preference value to make it more preferable
Ø  R2(config)#route-map ISP2
Ø  R2(config-route-map)#set local-preference 200
                          Now to make this take effect we have to apply the Route Maps as a part of the neighbor statement in Router Configuration mode for BGP
Ø  R2(config)#router bgp 65001
Ø  R2 (config-router)#neighbor 198.51.100.2 route-map ISP1 in
                         I want to apply that in Inbound direction another word, as i learned Routes from that neighbor, i want to apply the ISP1 Route-Map which is going to assign those Routes to a local Preference of 100, let’s do something similar for the other neighbor for ISP2.
Ø  Router(config-router)#neighbor 198.51.100.6 route-map ISP2 in
To make this take effect, let’s reset the BGP Process
Ø  R2#clear ip bgp * soft
Ø  R2#show ip bgp
                      And look at this now in order to get to this 9.9.9.9/32 network, we gonna go via ISP2, notice the Greater than “>” sign why is that?
                       It’s because of the Local-Preference there is a Local-Preference of 200 to use ISP2, there is a Local-Preference of 100 use ISP1, we’ve now influenced Outbound Path Selection to prefer the ISP that has more bandwidth however, we now need to Influence Inbound Path Selection, host out on the internet are still coming into us based on the shortest Autonomous System Path so, let’s do this.
                         Let’s say that we want to Prepend to that Autonomous System Path some additional Instances of our own Autonomous System, that’s what i mean, let’s create another Route-Map
Ø  R2(config)#route-map ASPATH
ü  This is name, i made up that’s not some sort of Cisco iOS Keyword
I am setting the Autonomous System Path Attribute such that, i am prepending additional instances of the local Autonomous System, i am gonna add couple of additional instances
Ø  R2(config-route-map)#set aspath prepend 65001 65001
                              And i am only going to apply this Route-map to ISP1, ISP1 is going to appear to have more Autonomous System to transit in order to get into the Enterprise Network.
Ø  R2(config)#router bgp 65001
Ø  Router(config-router)#neighbor 198.51.100.2 route-map ASPATH out
                   This time it gonna be Outbound direction when i am sending Route advertisements to ISP1, i am going to be prepending two additional instances of my own Autonomous System to the ASPATH, let’s do a Soft Reset of BGP again.
Ø  R2#clear ip bgp * soft
                          And let’s go out to the INTERENT Router and see how it looks coming back in the Enterprise Network
                    Notice before, when we looking into the Enterprise network we are going via ISP1 the Autonomous System path had the same length where they went via ISP1 or ISP2, now we should update that such that, it gonna be a longer path to go via ISP1 let’s once again do a
Ø  INET#show ip bgp
                         Look at this now get to this internal 192.0.2.0 network inside of our enterprise network the best Path indicating is with Greater than “>” sign, it’s ISP2 why is that?
                        Well now the Autonomous System Path via ISP2 is significantly Shorter then the path via ISP1 and the reason is, we Prepended a couple of additional instances of our local Autonomous System to the AS Path that was being advertised out the ISP1 and that’s a very real world look at how we could Troubleshoot a scenario where we have a sub-optimal path when an Enterprise network is connecting out to more than 1 ISP remember, we need to influence both Outbound and Inbound Path Selection.



If You Like the Post. Don’t forget 
          to “Subscribe/Share/Comment”. Thank You
Read More