Replace IPv6 Link Local address with radvd provided gateway

Issues related to configuring your network
Post Reply
vikinggeek
Posts: 18
Joined: 2011/11/15 17:34:46
Location: Redwood City, California

Replace IPv6 Link Local address with radvd provided gateway

Post by vikinggeek » 2019/10/11 00:48:17

Hi,

I need help simplifying our network configuration. We are using policy based routing and have our configuration in scripts (Network Manager is disabled). The routing is achieved by the standard:
<subnet> via <router's link local address> dev <interface name>

My challenge is that upon replacement of the router, my router's link local fe80:: address change and I need to update many, many hosts. So, I tried to figure out a better way. In IPv4 the gateway address is the IP address of the routers interface. When I try this with IPv6, routing does not work and I get (from /var/log/messages log):

Code: Select all

network: Error: either "to" is duplicate, or "2600:xxxx:xxxx:xxxx:0000:0000:0000:0001" is a garbage.
If I don't use my own routing table and have only one interface, CentOs 7 picks up the correct gateway address from the radvd in the router. How can I use the advertised gateway address (radvd) and not have to hardcode it in the route6-<interface> file? Below is the current file with the two variations (only the fe80:: version is working):

Code: Select all

2600:xxxx:xxxx:xxxx::/64 dev vlan19 src 2600:xxxx:xxxx:xxxx::87 table lan metric 1
#2600:xxxx:xxxx:xxxx::/61 via fe80::xxxx:xxxx:xxxx:xxxxc dev vlan19 table lan metric 1
2600:xxxx:xxxx:xxxx::/61  via 2600:xxxx:xxxx:xxxx:0000:0000:0000:0001 dev vlan19 table lan metric 1
#2602:xxxx:xxxx:xxxx::/60 via fe80::xxxx:xxxx:xxxx:xxxxc dev vlan19 table lan metric 1
2602:xxxx:xxxx:xxxx::/60 dev via 2600:xxxx:xxxx:xxxx:0000:0000:0000:0001 vlan19 table lan metric 1
#2600:xxxx:xxxx:xxxx::/61 via fe80::xxxx:xxxx:xxxx:xxxxc dev vlan19 metric 1
2600:xxxx:xxxx:xxxx::/61 dev via 2600:xxxx:xxxx:xxxx:0000:0000:0000:0001 vlan19 metric 1
#2602:xxxx:xxxx:xxxx::/60 via fe80::xxxx:xxxx:xxxx:xxxxc dev vlan19 metric 1
2602:xxxx:xxxx:xxxx::/60 via 2600:xxxx:xxxx:xxxx:0000:0000:0000:0001 dev vlan19 metric 1

User avatar
jlehtone
Posts: 2381
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Replace IPv6 Link Local address with radvd provided gateway

Post by jlehtone » 2019/10/11 12:43:41

First a disclaimer: I don't know radvd, have just browsed manual.

There are only two approaches to config: stored in the hosts or fetched from server.
That is independent from whether you use NM or network.service. NM does fetch by default, but can store local too.

In principle it is trivial to:
FOR EACH host DO
ssh to host the new config
DONE

For example, the ansible does that relatively easily.

However, both DHCP and radvd offer the fetch. Both can offer static routes. It makes no sense to hard-code routes in hosts when router can advertize those routes to the hosts.

Post Reply

Return to “CentOS 7 - Networking Support”