[Contents] [Prev] [Next] [Index] [Report an Error]

Specifying a Source Address for a BGP Session

By default, BGP uses the IP address of the outgoing interface toward the peer as the source IP address for the TCP connection over which the BGP session runs. If the outgoing interface goes down, the BGP session is dropped because the IP source address is no longer valid. This is appropriate behavior for EBGP sessions because the EBGP peers typically can reach each other only by virtue of being connected to a common subnet.

For IBGP sessions, however, you typically want BGP sessions to be automatically rerouted around interfaces that are down. You can issue the neighbor update-source command to accomplish this. This command instructs BGP to use the IP address of a specified interface as the source address of the underlying TCP connection. Typically, a loopback interface is used because it is inherently stable.

For example, you can specify that BGP use loopback interface 2 as the source for messages that it sends to peer 192.50.30.1:

host1(config)#neighbor 192.50.30.1 update-source loopback 2

neighbor update-source

The source address that you specify with the neighbor update-source command is also used by BGP as the default value for the next hop address advertised for IPv4 or IPv6 prefixes.

The source addresses and next hop address that result from using the neighbor update-source command vary depending on the configuration of the command. Table 14 lists the results for different configurations.

Table 14: Source Addresses and Default Next Hop Addresses for Various Configurations

Configured Neighbor Address

Configured Update Source Address

Source Address used for TCPv4 and TCPv6 Connection

Default Next Hop Value for IPv4 Prefixes

Default Next Hop Value for IPv6 Prefixes

IPv4 neighbor address

IPv4 source address

IPv4 source address

IPv4 source address

IPv4 source address mapped to an IPv6 address

IPv4 neighbor address

IPv6 source address

Not allowed

Not allowed

Not allowed

IPv4 neighbor address

Interface name

IPv4 address of the interface. If the interface does not have an IPv4 address, then the session does not come up.

IPv4 address of the interface

IPv6 address of the interface. If the interface does not have an IPv6 address, then the IPv4 address of the interface is mapped to an IPv6 address.

IPv6 neighbor address

IPv6 source address

IPv6 source address

0.0.0.0

IPv6 source address

IPv6 neighbor address

IPv4 source address

Not allowed

Not allowed

Not allowed

IPv6 neighbor address

Interface name

IPv6 address of the interface. If the interface does not have an IPv6 address, then the session does not come up.

IPv4 address of the interface. If the interface does not have an IPv4 address, then 0.0.0.0.

IPv6 address of the interface

You can override a native IPv6 next-hop address with either the neighbor update-source command or an outbound route map.

When you specify an interface with the neighbor update-source command, the IPv4-mapped IPv6 address of the interface is used instead of the native IPv6 address for the next hop.

host1(config)#interface loopback 0
host1(config-if)#ip address 10.1.1.1/32
host1(config-if)#exit
host1(config)#router bgp 100
host1(config-router)#neighbor 2::2 update-source loopback 0

In this example, the IPv4-mapped IPv6 address of the loopback 0 interface is the next-hop address sent when IPv6 prefixes are advertised. However, if loopback 0 has an IPv6 address, then that address is used as the default next hop for advertising IPv6 prefixes.


[Contents] [Prev] [Next] [Index] [Report an Error]