bgp configuration – Expert Network Consultant https://www.expertnetworkconsultant.com Networking | Cloud | DevOps | IaC Fri, 16 Feb 2018 16:58:43 +0000 en-GB hourly 1 https://wordpress.org/?v=6.3.5 Understanding BGP the Routing Protocol of the Internet https://www.expertnetworkconsultant.com/expert-approach-in-successfully-networking-devices/understanding-bgp-the-routing-protocol-of-the-internet/ https://www.expertnetworkconsultant.com/expert-approach-in-successfully-networking-devices/understanding-bgp-the-routing-protocol-of-the-internet/#respond Fri, 16 Feb 2018 16:54:28 +0000 http://www.expertnetworkconsultant.com/?p=1092 Continue readingUnderstanding BGP the Routing Protocol of the Internet]]> Perhaps by now, if you haven’t already asked the question, you may have thought to yourself, how does the Internet work?

How do millions of  inter-networks route traffic through the Internet?

 

Well the answer is not far reaching as this is the point of this article to explain the Routing Protocol of the Internet called BGP, the Border Gateway Protocol.

BGP is the standardized routing protocol of the Internet with the purpose to route traffic across the Internet. For this purpose, it’s an essential protocol which could also be the hardest one to understand.

The Internet comprises of two parts: the internal fine-grained segments managed by an Interior Gateway Protocol such as the Open Short Path First (OSPF) or Extensible Interior Gateway Routing Protocol(EIGRP) and the inter-connectivity of their Autononomous Systems (AS) via the Exterior Gateway Protocol called BGP.

Now an important keyword to pay attention to before we get into the beef of our discussion is an Autonomous System. So what is an Autonomous System or AS?

 

An autonomous system (AS) is a network controlled by a single entity typically an Internet Service Provider or a very large organization with independent connections to multiple networks.

Is understanding BGP Necessary?

If the organisation you support connects to two or more ISPs as well as interconnecting with other Network Providers, then BGP knowledge is a requirement for you. Small corporate Network Administrators may not necessarily need to know the depths of configuring and administering the BGP Protocol.

BGP Basics You Should Know

  • Based on RFC4271 BGP version 4 is the most current version of the BGP Protocol.
  • BGP is based on a path-vector protocol which furnishes routing information for Autonomous Systems on the Internet utilising its AS-Path attribute(s).
  • BGP resides on TCP as a Layer 4 protocol . Comparatively, it is not as complex as OSPF, because it does not need to worry about the things TCP will handle.
  • BGP unlike other routing protocols does not utilise a discovery process meaning that it does not learn new connections therefore, peers that have been manually configured to exchange routing information will form TCP connections and become BGP fluent.
  • Medium-sized corporations utilises BGP to effectively Multi-Home for their entire network.
  • An important aspect of BGP is that the AS-Path itself is an anti-loop mechanism. Routers intelligently will not import any routes that contain themselves in the AS-Path.

Configuring BGP on Cisco Routers

The following is a step by step  approach to configuring BGP on Cisco Devices. It reinforces the required understanding of the following;

  • IBGP neighbors – when two neighbors are in the same AS;
  • EBGP neighbors – when two neighbors belong to different AS.

 

Figure 1.0 –  BGP Topology with Two Autonomous Systems AS 60010 and AS 60020

 

From the above diagram, you can see that R1 with AS10BDR and R2 with AS20BDR are IBGP neighbours while AS10BDR with AS20BDR are EBGP neighbours (because they belong to different Autonomous Systems).

 

To configure BGP start with router bgp AS which puts you in to the BGP configuration mode. AS here represents the Autonomous System to which the router belongs to or is a part of.

Next, configure bgp neighbours with neighbor (ip-address | peer-group-name) remote-as AS command.

Neighbours  are based on ip address not on peer groups as per the configuration which follows below. To tell the router what to advertise use this command: network network-number [mask network-mask] [ route-map map-tag].  Route Maps will not be used in the configuration below.

Below you see configurations according to our topology and commands described above.

R1

R1(config)#interface fa0/0
R1(config-if)#ip address 192.168.0.2 255.255.255.0
R1(config-if)#no shutdown 

R1(config)#router bgp 60010 
R1(config-router)#neighbor 192.168.0.1 remote-as 60010

AS10BDR

AS10BDR(config)#interface fastEthernet 0/0
AS10BDR(config-if)#ip address 10.0.0.1 255.255.255.0
AS10BDR(config-if)#no shutdown 
AS10BDR(config-if)#interface fastethernet 0/1
AS10BDR(config-if)#ip address 192.168.0.1 255.255.255.0
AS10BDR(config-if)#no shutdown 

AS10BDR(config)#router bgp 60010
AS10BDR(config-router)#neighbor 192.168.0.2 remote-as 60010
AS10BDR(config-router)#neighbor 10.0.0.2 remote-as 60020
AS10BDR(config-router)#network 192.168.0.0 mask 255.255.255.0

AS20BDR

AS20BDR(config)#interface fastEthernet 0/0
AS20BDR(config-if)#ip address 10.0.0.2 255.255.255.0
AS20BDR(config-if)#no shutdown
AS20BDR(config-if)#interface fa0/1
AS20BDR(config-if)#ip address 192.168.100.1 255.255.255.0
AS20BDR(config-if)#no shutdown

AS20BDR(config)#router bgp 60020
AS20BDR(config-router)#neighbor 10.0.0.1 remote-as 60010
AS20BDR(config-router)#neighbor 192.168.100.2 remote-as 60020
AS20BDR(config-router)#network 192.168.100.0 mask 255.255.255.0

R2

R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 192.168.100.2 255.255.255.0
R2(config-if)#no shutdown

R2(config)#router bgp 60020
R2(config-router)#neighbor 192.168.100.1 remote-as 60020

 

Note that if you use the mask in network command then the network in routing table must match network from this command. Also note that you can advertise any network that resides in routing table and is not necessary to be directly connected.

 

You have few tools to verify bgp status:

show ip bgp;
show ip bgp summary;
show ip bgp neighbors;
show ip bgp rib-failure.

 

Also you can use debug command. Let’s show BGP neighbors on AS10BDR:

AS10BDR#show ip bgp neighbors 
BGP neighbor is 10.0.0.2,  remote AS 60020, external link
  BGP version 4, remote router ID 192.168.100.1
  BGP state = Established, up for 00:20:11

... output ommited ...

BGP neighbor is 192.168.0.2,  remote AS 60010, internal link
  BGP version 4, remote router ID 192.168.0.2
  BGP state = Established, up for 00:28:42

As you see we have two neighbors with AS10BDR one internal and one external. Let’s see the results of show ip route on R1:

R1#show ip route 
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.0.0/24 is directly connected, FastEthernet0/0
R1#

Hmmm … ! As you have seen on R1 we don’t have external route to 192.168.100.0/24 which is expected to be. This is because routing updates sent by AS20BDR, which is an external router, have address 10.0.0.2 as source ip address, but in this case R1 doesn’t have any idea how to get to 10.0.0.0 network and that’s why BGP on R1 doesn’t put in routing table a route to 192.168.100.0/24 but keep it only in BGP table (you can check it with show ip bgp command). To overcome this we have to add on AS10BDR this command: AS10BDR(config-router)#neighbor 192.168.0.2 next-hop-self, which will change source ip address of routing updates sent to R1 (will change to its fa0/1 ip address).

AS10BDR(config-router)#neighbor 192.168.0.2 next-hop-self

The same you need to do on AS20BDR to change update source to neighbor R1.

AS20BDR(config-router)#neighbor 192.168.100.2 next-hop-self

And now let’s see again routing table on R1

R1#show ip route 
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.0.0/24 is directly connected, FastEthernet0/0
B    192.168.100.0/24 [200/0] via 192.168.0.1, 00:02:42
R1#

And a ping from R1 to R2

R1#ping 192.168.100.2

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

Do I know this already?

Refer to the exhibit. Router RIP is attempting to establish BGP neighbor relationships with routers RT1 and RT3. On the basis of the information that is presented in the exhibit, which two statements are true? (Choose two)

 

A – RTR has a BGP password set but neighbor 10.0.0.1 does not
B – RTR has a BGP password set but neighbor 10.0.0.5 does not
C – RTR has a BGP password set but neighbor 10.0.0.1 has an incorrect password set
D – RTR has a BGP password set but neighbor 10.0.0.5 has an incorrect password set
E – Neighbor 10.0.0.1 has a BGP password set but RTR does not
F – Neighbor 10.0.0.5 has a BGP password set but RTR does not
]]>
https://www.expertnetworkconsultant.com/expert-approach-in-successfully-networking-devices/understanding-bgp-the-routing-protocol-of-the-internet/feed/ 0