BGP IPv6 Router ID

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.)

what if you leave it blank? =) establish a session and see remote-id :slight_smile:

seems like router-id is just 4-byte number, expressed as IPv4 address, so I doubt it will accept IPv6 format…

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 - :slight_smile: thanks for the suggestion

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.


    1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    ±------±------------------------------±----------------------+
    | | | |
    | 0xF | AS Number | Locally allocated |
    | | | |
    ±------±------------------------------±----------------------+



    Note: 32 bit AS numbers could be introduced in the future.
    This recommended solution would then have to be adapted.

when you leave it blank - it will be selected automatically

so, as we can see, RouterID is still 32 bit value =)

I left it blank, and it seems to work nicely with all my IPv6 peers. Thanks for the help - I am now BGP’d on the IPv6 internet! Very exciting!!

Hi,

This is a very interesting question.

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.

The “BGP4 router ID for IPv6 only routers” is proposed as an IETF draft here: https://tools.ietf.org/html/draft-dupont-durand-idr-ipv6-bgp-routerid-01 .

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:

  • It considers that AS numbers are 16-bit length. However, nowadays, AS numbers can have 32 bits of length: https://www.ripe.net/manage-ips-and-asns/resource-management/faq/faq-asn32 ;

  • 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 :frowning:.

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.