Hello, I am trying to establish a BGP session over IPv6 with a peer. Trouble is, I can’t seem to find what I should be populating the “router-id” property in /routing bgp instance with. I am trying to put a IPv6 address in the router-id field, but it won’t accept it. This is a IPv6 peer - no IPv4 peering is to be expected between us.
Should the field accept a (properly expressed) IPv6 address?
(Sorry if this is a newbie question, I have read the fine manual and I have searched the wiki and the forum.)
Leaving it blank - I’m not certain that’s acceptable for my IPv6 peers! I guess my question was more of a ‘best practice’ than a technical one - thanks for the suggestion
As you already know, when setting a BGP peering, it’s necessary to set a route ID in our BGP instance.
The idea is the same used by the OSPF: We will use the same router ID in all of our interfaces. So, all of our neighbors will know that the route announcements are coming from a single router (an not from many routers).
When using IPv4 to establish BGP sessions, it’s recomended to use an IPv4 loopback address as router ID or a single public IP that uniquely identifies the router.
When using IPv6 to establish BGP sessions, we can’t use one IP as router ID (router ID is a 32-bits counter).
So, we have three choices:
Use a IPv4 address as router ID (not an elegant solution, but it will work);
Leave router ID blank (the router will automatically one router ID - I don’t know the MikroTik algorithm, but I discovered that Cisco initially tries to choose loopback address and so it fallbacks to local IPv4 address - it will work, but we won’t have control about what router ID will be choose);
Use the algorithm “BGP4 router ID for IPv6 only routers”, quoted by @changeip.
In the absence of a globally unique IPv4 address on the router,
the 32 bit routing ID may be constructed with:
4 bits set to one (as for an old reserved class E IPv4 address),
16 bits set to the AS number (a global AS number
SHOULD be used if the router ID can be seen outside the routing
domain).
12 bits manually allocated within the domain. This allows for 4096
different router IDs in each routing domain.
This draft proposes using the ASN (AS number) and a unique ID inside the AS to generate a unique IPv4 class E address. It’s a very interesting way to define router IDs, since the IPV4 class E range is not used and probably will never be used. However, it has two main problems:
Some BGP routers (including MikroTik - I’ve tested using RouterOS 6.17) doesn’t allow router IDs using IPv4 class E address;
The BGP RFCs explicitly says that IPv4 class D address (multicast address) should be refused as router IDs, but it doesn’t says nothing about IPv4 class E address (nothing about allow neither nothing about deny).
So, although the “BGP4 router ID for IPv6 only routers” is a good idea, I’m still using classic IPv4 router IDs to establish IPv6 based BGP sessions .
PS: Probably someday will be allowed to use 128-bit router IDs. In this day, there will be an intelligent way to set router IDs for IPv6 based BGP sessions.
Convert the 4 lesser bytes of the administrative MAC address to a IPv4 address. Since the first 2 MSB bytes are the vendor ID, you probably get some unique router IDs (at least for a single vendor). Those IDs are arbitrary anyway.