Skip to main content

External BGP Configuration





BGP neighbors are routers forming TCP connections for exchanging BGP updates it’s also called BGP peers or BGP speakers.

There are two types of BGP neighbor relationship


  1. IBGP (internal BGP)
  2. EBGP (external BGP)
BGP first forms a neighbor relationship with BGP speakers (peers). Then it learns information from its peer, BGP places that information in its BGP table, and analyzes the table to choose the best working route for each subnet in the BGP table, placing those routes into the IP routing table.




  • Internal BGP (iBGP) operates within the same autonomous system.
  • External BGP (E BGP) operates in between the multiple autonomous systems


let's see the configuration: -
Topology;-





TASK:

  • configure the topology as the diagram, and assign IP addresses to their ports respectively.
  • configure IBGP in AS 65110
  • configure EBGP between router 2 and router 3
  • ensure all the routers get routes from different ASs

R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#Interface fastethernet 0/0
R1(config-if)#Ip address 10.1.1.1   255.0.0.0
R1(config-if)#No shutdown
R1(config-if)#No keepalive
R1(config-if)#Exit

R1(config)#Interface serial 3/0
R1(config-if)#Ip address  1.1.1.1 255.0.0.0
R1(config-if)#No shutdown
R1(config-if)#Exit

*Nov 24 05:49:27.155: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Nov 24 05:49:27.431: %LINK-3-UPDOWN: Interface Serial3/0, changed state to up


R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)#Interface fastethernet 0/0
R2(config-if)#Ip address 20.1.1.1   255.0.0.0
R2(config-if)#No shutdown
R2(config-if)#No keepalive
R2(config-if)#Exit

R2(config)#Interface serial 3/0
R2(config-if)#Ip address  1.1.1.2 255.0.0.0
R2(config-if)#No shutdown
R2(config-if)#Exit

R2(config)#Interface serial 3/1
R2(config-if)#Ip address  2.2.2.1 255.0.0.0
R2(config-if)#No shutdown
R2(config-if)#Exit

*Nov 24 05:51:43.775: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to up
*Nov 24 05:51:43.967: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/1, changed state to up


R3#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

R3(config)#Interface fastethernet 0/0
R3(config-if)#Ip address 30.1.1.1   255.0.0.0
R3(config-if)#No shutdown
R3(config-if)#No keepalive
R3(config-if)#Exit

R3(config)#Interface serial 3/1
R3(config-if)#Ip address  2.2.2.2 255.0.0.0
R3(config-if)#No shutdown
R3(config-if)#Exit

*Nov 24 05:53:48.991: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Nov 24 05:53:49.279: %LINK-3-UPDOWN: Interface Serial3/1, changed state to up


R1#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        10.1.1.1        YES manual up                    up
Serial3/0                    1.1.1.1         YES manual up                    up

R2#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        20.1.1.1        YES manual up                    up
Serial3/0                    1.1.1.2         YES manual up                    up
Serial3/1                    2.2.2.1         YES manual up                    up


R3#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        30.1.1.1        YES manual up                    up
Serial3/1                    2.2.2.2         YES manual up                    up



R1(config)#router bgp 65110
R1(config-router)#neighbor 1.1.1.2 remote-as 65110
R1(config-router)#network 1.0.0.0
R1(config-router)#network 10.0.0.0
R1(config-router)#no auto-summary
R1(config-router)#no synchronization
R1(config-router)#exit

*Nov 24 06:44:36.303: %BGP-5-ADJCHANGE: neighbor 1.1.1.2 Up

R2(config)#router bgp 65110
R2(config-router)#neighbor 1.1.1.1 remote
R2(config-router)#neighbor 1.1.1.1 remote-as 65110
R2(config-router)#network 1.0.0.0
R2(config-router)#network 2.0.0.0
R2(config-router)#network 20.0.0.0
R2(config-router)#neighbor 1.1.1.1 next-hop-self
R2(config-router)#neighbor 2.2.2.2 remote-as 65111
R2(config-router)#no auto-summary
R2(config-router)#no synchronization
R2(config-router)#exit

*Nov 24 06:44:36.335: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up

R3(config)#router bgp 65111
R3(config-router)#neighbor 2.2.2.1 remote-as 65110
R3(config-router)#network 30.0.0.0
R3(config-router)#network 2.0.0.0
R3(config-router)#no auto-summary
R3(config-router)#no synchronization
R3(config-router)#exit

*Nov 24 06:46:42.235: %BGP-5-ADJCHANGE: neighbor 2.2.2.1 Up





R1#show ip bgp

BGP table version is 6, local router ID is 11.0.3.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 * i 1.0.0.0          1.1.1.2                  0    100      0 i
 *>                   0.0.0.0                  0         32768 i
 *>i 2.0.0.0          1.1.1.2                  0    100      0 i
 *>  10.0.0.0         0.0.0.0                  0         32768 i
 *>i 20.0.0.0         1.1.1.2                  0    100      0 i
 *>i 30.0.0.0         1.1.1.2                  0    100      0 65111 i


R1#show ip bgp summary
BGP router identifier 11.0.3.1, local AS number 65110
BGP table version is 6, main routing table version 6
5 network entries using 720 bytes of memory
6 path entries using 480 bytes of memory
3/3 BGP path/bestpath attribute entries using 408 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1632 total bytes of memory
BGP activity 5/0 prefixes, 6/0 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.2         4        65110      26      24        6    0    0 00:16:52        4

R1#show ip route bgp
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

B     2.0.0.0/8 [200/0] via 1.1.1.2, 00:16:52
B     20.0.0.0/8 [200/0] via 1.1.1.2, 00:16:47
B     30.0.0.0/8 [200/0] via 1.1.1.2, 00:14:23






R2#show ip bgp
BGP table version is 7, local router ID is 12.0.3.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.0.0.0          0.0.0.0                  0         32768 i
 * i                  1.1.1.1                  0    100      0 i
 *   2.0.0.0          2.2.2.2                  0             0 65111 i
 *>                   0.0.0.0                  0         32768 i
 *>i 10.0.0.0         1.1.1.1                  0    100      0 i
 *>  20.0.0.0         0.0.0.0                  0         32768 i
 *>  30.0.0.0         2.2.2.2                  0             0 65111 i

R2#show ip bgp summary
BGP router identifier 12.0.3.1, local AS number 65110
BGP table version is 7, main routing table version 7
5 network entries using 720 bytes of memory
7 path entries using 560 bytes of memory
3/3 BGP path/bestpath attribute entries using 408 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1712 total bytes of memory
BGP activity 5/0 prefixes, 7/0 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4        65110      24      27        7    0    0 00:17:35        2
2.2.2.2         4        65111      21      22        7    0    0 00:15:30        2


R2#show ip route bgp
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

B     10.0.0.0/8 [200/0] via 1.1.1.1, 00:17:45
B     30.0.0.0/8 [20/0] via 2.2.2.2, 00:15:08


R3#show ip bgp
BGP table version is 7, local router ID is 13.0.3.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.0.0.0          2.2.2.1                  0             0 65110 i
 *>  2.0.0.0          0.0.0.0                  0         32768 i
 *                    2.2.2.1                  0             0 65110 i
 *>  10.0.0.0         2.2.2.1                                0 65110 i
 *>  20.0.0.0         2.2.2.1                  0             0 65110 i
 *>  30.0.0.0         0.0.0.0                  0         32768 i

R3#show ip bgp summary
BGP router identifier 13.0.3.1, local AS number 65111
BGP table version is 7, main routing table version 7
5 network entries using 720 bytes of memory
6 path entries using 480 bytes of memory
3/3 BGP path/bestpath attribute entries using 408 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1632 total bytes of memory
BGP activity 5/0 prefixes, 6/0 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.1         4        65110      23      22        7    0    0 00:16:04        4

R3#show ip route bgp
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

B     1.0.0.0/8 [20/0] via 2.2.2.1, 00:16:18
B     10.0.0.0/8 [20/0] via 2.2.2.1, 00:16:18
B     20.0.0.0/8 [20/0] via 2.2.2.1, 00:16:18

R1#ping 30.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/60/68 ms

R1#traceroute 30.1.1.1
Type escape sequence to abort.
Tracing the route to 30.1.1.1
VRF info: (vrf in name/id, vrf out name/id)
  1 1.1.1.2 32 msec 20 msec 32 msec
  2 2.2.2.2 60 msec 60 msec 60 msec



R2#ping 30.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/28/32 ms

R2#ping 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/26/32 ms


R3#ping 20.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/44 ms

R3#ping 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/60/64 ms

R3#traceroute 10.1.1.1
Type escape sequence to abort.
Tracing the route to 10.1.1.1
VRF info: (vrf in name/id, vrf out name/id)
  1 2.2.2.1 20 msec 28 msec 24 msec
  2 1.1.1.1 [AS 65110] 60 msec 60 msec 52 msec





Comments

Popular posts from this blog

What is Classification and marking? What is IP Precedence and DSCP Values? What is AF and EF?

  Classification and Marking Classification and marking are the processes of identifying the priority of each packet. This is the first step of QOS control and should be done near the source hosts. Classification is the process of identifying and categorising traffic into classes, typically based upon incoming interface IP precedence, DSCP Source or Destination address. Application classification is the most fundamental QOS building block. Without classification, all packets are treated the same.   The table lists the criteria of classification                                  Marking  Marking is the QOS feature component that colours a packet so it can be identified and distinguished from other packets in QOS treatment. Commonly used markers: link-layer: COS (ISL, 802.1q), MPLS EXP bits,...

OSPF default routing

  OSPF Default Route Configuring OSPF Default route is not a big problem. We have couple of options when we want to OSPF default route. Here is an example R1(config)#router ospf 1  R1(config-router)#default-information originate ?   always       Always advertise default route   metric       OSPF default metric   metric-type  OSPF metric type for default routes   route-map    Route-map reference   <cr> We can change numbers of things for example metric or metric type but most of the people forget about the most important thing is the always keyword.  If we add the always command this feature advertises the default route even if we do not have in our routing table. It will look like that route is installed in routing table.   When we use the default information originate we can advertise a default route in OSPF. But OSPF won’t...

BGP Local preference configuration

BGP Local preference (Local_Pref) Path attribute gives the router inside a single autonomous system a value that they can set per-route and advertise to all iBGP routers inside the autonomous system, so that all routers in the autonomous system agree about which routers is the best exit point for packet destined for that prefix. Local preference (Local_Pref) is the second BGP attribute. We can use the local preference to choose the outbound external BGP path. Local preference is sent to all internal BGP (iBGP) routers in our autonomous system. Local preference (Local_Pref) is not exchanged between external BGP routers. It’s a well-known and discretionary BGP attribute. Default value is 100. The path with the highest local preference is desirable  Topology:- TASK: To reach 50.1.1.1, 15.0.0.1 network router 2 and router 3 using 3.1.1.2 path ( AS 65144) because it has less numbers of au...