4

I am having a hell of a time getting IPv6 address connectivity set up on my new VPS. I thought I knew what I was doing but apparently networkd disagrees, I keep getting issues when trying to add a default route.

Here is the networking information provided to me by my ISP:

Subnet 2001:19f0:6:2::/64 Gateway 2001:19f0:6::1 Nameserver 2001:4860:4860::8888 Nameserver 2001:4860:4860::8844 Interface: ens3 OS: Ubuntu 18.04.02 Systemd version: 237 

Current Setup

I can easily set up my IP address and add a route to the gateway with the following systemd file:

[Match] Name=ens3 [Network] Address=209.222.17.197/26 Gateway=209.222.17.193 DNS=8.8.8.8 [Network] Address=2001:19f0:6:2::1337/64 [Route] Destination=2001:19f0:6::1 

I get no errors in journalctl, I can successfully ping 2001:19f0:6::1, but of course I don't have a default gateway or internet access. I can easily use 2001:19f0:6::1 as my default gateway with the following command: sudo ip -6 route add default via 2001:19f0:6::1

This gives me full ipv6 routing, I can ping ipv6.google.com.

The Problem

I can't seem to get the default gateway set up in networkd, I've spent so many hours trying different combinations of options I think this might be a bug. For example, if I amend my configuration to look like this:

[Match] Name=ens3 [Network] Address=209.222.17.197/26 Gateway=209.222.17.193 DNS=8.8.8.8 [Network] Address=2001:19f0:6:2::1337/64 [Route] Destination=2001:19f0:6::1 [Route] Gateway=2001:19f0:6::1 GatewayOnlink=true 

I get the following error in the journalctl log:

May 27 19:31:46 public-NY systemd-networkd[2452]: ens3: Could not set route: No route to host 

I always see that damn error "no route to host", if there's no route to 2001:19f0:6::1 then why the hell can I ping it?!

I'm fed up with this issue, but I'd like to use netplan and therefore systemd-networkd for my networking. Am I just doing something stupid or is something as critical as networkd really this broken?

1
  • Destination is a network with prefix. I assume you should do something like: [Route] Destination=2001:19f0:6::/48 Gateway=2001:19f0:6::1 When you can pink it you have already a route. ip -6 route show would be help full. Commented Aug 7, 2019 at 20:23

1 Answer 1

0

It's probably the GatewayOnLink that's causing the problem, because as far as I can see, that gateway is not on link. Your on-link subnet is 2001:19f0:6:2::/64, while the gateway address is not in that subnet -- the /64 that it is in is 2001:19f0:6:0::/64 (extra:0` added for clarity).

Now, how you can manage to ping that gateway address I couldn't tell you -- most likely it's being picked up via RA, which is odd, but not unknown, in a hosting environment -- but in any event, it's not an on-link route, and so therefore networkd is, quite rightly, telling you there is no route to that host using the parameters you have given.

1
  • The GatewayOnlink=yes is required in some cases, even if the gateway address is not in the subnet. As an example, my on-link subnet is HE tunnel routed prefix 2001:470:19:400::/64, while my gateway is 2001:470:18:402::1/64; but I have to add GatewayOnlink=yes to add the default route and gain IPv6 connectivity. This might be a networkd bug; see also unix.stackexchange.com/a/495038/324313. Commented Aug 18, 2020 at 9:34

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.