3

I'm trying to achieve the equivalent of the ip command below via networkd without success.

ip route add default via fe80::1 dev eth0

My networkd configuration looks like below and brings up the network successfully apart from the default ipv6 routing. I've tried adding and removing GatewayOnLink=yes without any success. Running the command above after startup brings up ipv6 connectivity but I would prefer to do this via networkd configuration.

/etc/systemd/network/00-eth0.network
----

[Match]
Name=eth0

[Network]
DHCP=no
DNS=8.8.8.8

[Address]
Label=static-ipv4
Address=X.X.X.X/32
Peer=Y.Y.Y.Y

[Address]
Label=static-ipv6
Address=X:X:X:X::1/64

[Route]
Gateway=fe80::1
Gateway=Y.Y.Y.Y
GatewayOnlink=yes 

This is for a Hetzner cloud server, I don't have any other IPV6 enabled machines to rule out something specific about their setup. Systemd is version 238 running on coreos.

  • ok, not sure how relevant it is :) Other than the ipv6 routing all the configuration in the file is being applied. – uvcrew Mar 29 at 15:26
  • Try removing the [Address] and [Route] headings and see if that works? – Ken Sharp Apr 27 at 2:14
0

Not the answer I'm hoping to accept since it involves configuration outside networkd, but it does bring my IPv6 routing up reliably:

~ $ cat /etc/systemd/system/ipv6-routing.service 
[Unit]
Description=Setup ipv6 routing
After=network-online.target
Requires=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/ip route add default via fe80::1 dev eth0
RemainAfterExit=true

[Install]
WantedBy=multi-user.target

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.