BGP Config Examples

Update-Source

router bgp 100
 neighbor 172.16.1.2 update-source loopback 0
The update-source keyword informs the router to use any operational interface as the source IP address for TCP connections. The loopback interface is commonly selected because it never goes down, which adds stability to the configuration.

Without the neighbor update-source command, BGP will use the closest IP interface to the peer. This command provides BGP with a more robust configuration, because BGP will still operate in the event the link to the closest interface fails.

You can use the neighbor update-source command with either EBGP or IBGP sessions. In the case of a point-to-point EBGP session, this command is not needed because there is only one path for BGP to use.

EBGP Multihop

By default, EBGP neighbors exchange packets with a TTL (Time To Live) set to 1. If you attempt to establish an EBGP session between loopbacks, BGP packets will be dropped due to an expired TTL.

R1
ip route 10.20.20.1 255.255.255.255 209.165.201.2
!
router bgp 64496
 neighbor 10.20.20.1 remote-as 64511
 neighbor 10.20.20.1 update-source loopback 0
Informs R1 to use the Loopback0 IP address as the source IP for all BGP TCP packets sent to R2.
 neighbor 10.20.20.1 ebgp-multihop 2
Allows for two routers that are not directly connected to establish an EBGP session. A TTL value of 2 is defined.

R2
ip route 10.10.10.1 255.255.255.255 209.165.201.1
!
router bgp 64511
 neighbor 10.10.10.1 remote-as 64496
 neighbor 10.10.10.1 update-source loopback 0
 neighbor 10.10.10.1 ebgp-multihop 2

The ebgp-multihop keyword is only used for EBGP sessions, not for IBGP.

EBGP neighbors are usually directly connected (over a WAN connection, for example) to establish an EBGP session. However, sometimes one of the directly connected routers is unable to run BGP. The ebgp-multihop keyword allows for a logical connection to be made between peer routers, even if they are not directly connected. The ebgp-multihop keyword allows for an EBGP peer to be up to 255 hops away and still create an EBGP session.

If redundant links exist between two EBGP neighbors and loopback addresses are used, you must configure ebgp-multihop. Otherwise, the router decrements the TTL before giving the packet to the loopback interface, meaning that the normal IP forwarding logic discards the packet.

IBGP Next-Hop Behavior

The EBGP next-hop attribute is the IP address that is used to reach the advertising router. For EBGP peers, the next-hop address is, in most cases, the IP address of the connection between the peers. For IBGP, the EBGP next-hop address is carried into the local AS.

R2
router bgp 64511
 neighbor 209.165.202.129 remote-as 64496 - ebgp
 neighbor 172.16.1.2 remote-as 64511 - ibgp
 neighbor 172.16.1.2 update-source loopback 0
 neighbor 172.16.1.2 next-hop-self
Allows R2 to advertise itself as the next-hop to its IBGP peer for networks learned from AS 64496. R3 will then use 172.16.1.1 as the next-hop to reach network 209.165.201.0/27 instead of using the EBGP next-hop of 209.165.202.129.

Configuring Multiprotocol BGP (MP-BGP)

  • Original BGP was designed to carry only IPv4-specific information.
  • A recent extension was defined to also support other protocols like IPv6. This extension is called MP-BGP (Multiprotocol BGP).
  • MP-BGP is the supported Exterior Gateway Protocol (EGP) for IPv6. IPv6 enhancements to MP-BGP include support for IPv6 address family configuration.
  • You can run MP-BGP over IPv4 or IPv6 transport and can exchange routes for IPv4, IPv6, or both. BGP uses TCP for peering, and this has no relevance to the routes carried inside the BGP exchanges. Both IPv4 and IPv6 can be used to transport a TCP connection on the network layer.
R1
router bgp 65500
 neighbor 2001:db8:12::2 remote-as 65501
 neighbor 192.168.1.2 remote-as 65501
 address-family ipv4 unicast
  neighbor 192.168.1.2 activate
Enables the exchange of IPv4 BGP information with R2. The IPv4 neighbors will be automatically activated, this command is optional.
  network 10.1.1.1 mask 255.255.255.255
 address-family ipv6 unicast
  neighbor 2001:db8:12::2 activate
  network 2001:db8:1::1/64

R2
router bgp 65501
 neighbor 2001:db8:12::1 remote-as 65500
 neighbor 192.168.1.1 remote-as 65500
 address-family ipv4 unicast
  neighbor 192.168.1.1 activate
  network 10.2.2.2 mask 255.255.255.255
 address-family ipv6 unicast
  neighbor 2001:db8:12::1 activate
  network 2001:db8:2::1/64

Route Reflectors

By default, a router that receives an EBGP route advertises it to its EBGP and IBGP peers. However, if it receives it through IBGP, it does not advertise it to its IBGP peers, as a loop-prevention mechanism (split horizon). Because of this behavior, the only way for all IBGP routers to receive a route after it is originated into the AS is to have a full mesh of IBGP peers. This can get complex with a large number of peers. A route reflector allows a topology to get around the IBGP limitation of having to have a full mesh.

R2
router bgp 65010
 neighbor 10.1.1.1 route-reflector-client
 neighbor 10.3.3.3 route-reflector-client

The objective is to allow R2 to advertise to R1 the 209.165.201.0/27 network learned from R3. Without these commands, R1 will never learn the 209.165.201.0/27 network unless a full-mesh IBGP topology is built.

Tags:

Leave a Reply

Related Post