BGP - update-source command
The update-source
command used with BGP configuration on Cisco routers is used to specify which interface's IP address should be used as the source IP address for BGP sessions. This is particularly important when a router has multiple interfaces.
In BGP, establishing and maintaining a stable session between peers (neighboring routers) is required. Peers are typically configured using their interface IP addresses. If a router has multiple interfaces, it may not be clear which interface's IP address should be used for BGP communication. By default, the router will use the IP address of the outgoing interface that it uses to reach the peer.
However, using the update-source
command, you can explicitly specify an interface or an IP address to be used as the source of BGP packets. This helps ensure that the BGP session remains stable and does not depend on the reachability of the default outgoing interface. It's particularly useful in scenarios where:
- The direct connection interface to a BGP peer is not the desired source interface (e.g., in multihome setups).
- The router has multiple paths to reach a peer, and you want to use a loopback interface as a stable, always-up source IP address for BGP sessions, ensuring BGP session stability regardless of physical interface states.
Here’s a typical usage in a BGP configuration:
router bgp 100 neighbor 192.168.1.1 remote-as 200 neighbor 192.168.1.1 update-source Loopback0
In this example, BGP will use the IP address assigned to Loopback0
as the source for BGP packets sent to the neighbor at 192.168.1.1
, ensuring that BGP session stays up as long as the router itself is up, irrespective of the status of other physical interfaces.
Links
https://networklessons.com/bgp/internal-bgp-border-gateway-protocol-explained https://networklessons.com/bgp/ebgp-multihop