BIRD / BGP / IPv6 / source address directive : auto vs link local vs GUA
Hans van Kranenburg
hans.van.kranenburg at mendix.com
Sun Mar 22 13:59:37 CET 2015
Hi Olivier,
On 03/22/2015 08:03 AM, olivier a wrote:
>
> I'm learning BGP and I'm really puzzled about the 'source address'
> directive in the context of IPv6.
> I've seen some people explicit a GUA source address
> ( example : source address 2001:db8:0:0::1; )
> Reading the documentation, watching the debug logs and playing with
> bird6c didn't help me understand.
> Leaving to auto ( no directive ) was functioning ok, but my BGP setup is
> rather simple.
> What is better ? No directive, link local or Global Unicast Address ?
>
> Thank you for any clue :-)
First of all, there's nothing wrong with a rather simple looking
confinguration. It might show that the configuration language is well
thought out and powerful. :-)
There are two different scenarios for which the source address best
practice differs: eBGP and iBGP.
In the case of eBGP, you usually have a single link to a router of an
external party, in another AS, with a little subnet in between. In this
case you use the address on your side in this little subnet as source.
AS64515 AS65517
ExternalRouter ----------- YourRouter
203.0.113.5/30 203.0.113.6/30
2001:db8::1/120 2001:db8::2/120
2001:db8:1000:1/128 (loopback)
So, e.g. IPv4 config:
protocol bgp ebgp_other {
local as 64515;
neighbor 203.0.113.5 as 65517;
}
In this case, bird will automatically choose 203.0.113.6 as source address.
Since there's only one path to that external router, it's ok to let the
connection depend on this specific interface.
For iBGP, you want to exchange information about external routes you
learned from the ExternalRouter with other routers in your own network (AS).
In this case it's best practice to use a loopback address from the
router to set up the iBGP connection. The loopback addresses are put
into your IGP (e.g. OSPF) as host-route (/32, /128).
Doing so will make sure that your IGP will always try to find the best
route to the other router within your own network, independent of which
interfaces of it are up or down, and which path to it is available.
protocol bgp ibgp_my_other_router {
import all; # learn other external routes
export all;
local as 64515;
source address 2001:db8:1000:1;
neighbor 2001:db8:1045::6 as 64515;
}
Even in a small network, where there aren't multiple possible routes
between internal routers (e.g. they are in the same vlan), I still use
it this way, to make sure any colleague or whoever needs to work with it
in the future will quickly understand how it's set up.
Link local addresses (fe80::) are usually not used by BGP, but they are
for some reason used a lot by OSPF to point to the next hop for a route.
Have fun,
--
Hans van Kranenburg - System / Network Engineer
T +31 (0)10 2760434 | hans.van.kranenburg at mendix.com | www.mendix.com
More information about the Bird-users
mailing list