You are not logged in.

#1 2016-01-15 08:59:53

daviid00
Member
Registered: 2016-01-15
Posts: 7

[SOLVED] Route - Default gateway deleted with systemd

Hi,

For several weeks I'm facing a very strange problem.
I am setting up on computer A my network card in /etc/systemd/network/wired.network

#######################
[Match]
Name=enp5s0

[Network]
DNS=192.168.1.7
DNS=192.168.1.8

[Address]
Address=192.1.2.95/24

[Route]
Gateway=192.1.2.22
#######################

When I boot up computer A, the network card is setup correctly.
I can then access computer via ssh with computer B
However after a while I cannot access computer A via ssh anymore.
When I connect directly to computer A, I can see that the default gateway has been somehow deleted.

After startup on computer A:
$ ip route
default via 192.1.2.22 dev enp5s0  proto static
192.1.2.0/24 dev enp5s0  proto kernel  scope link  src 192.1.2.95

After a while on computer A, when computer B cannnot accces it via ssh
$ ip route
192.1.2.0/24 dev enp5s0  proto kernel  scope link  src 192.1.2.95

I am updating my Archlinux regurlaly with "pacman -Syu" but this does not solve the problem.

Right now I have 2 solutions to reenable the default gateway
    - reboot computer A
    - reenable default gateway on computer A: # ip route add default via 192.1.2.22

Even if this works, this is pretty annoying because I loose all the benefit of my ssh connection: I am mainly using computer A from computer B via ssh.

What could delete the default gateway on computer A during runtime?
How could I solve this problem?

Regards,
David

Last edited by daviid00 (2016-02-23 12:09:40)

Offline

#2 2016-01-15 15:20:05

branch
Member
Registered: 2014-03-16
Posts: 196

Re: [SOLVED] Route - Default gateway deleted with systemd

Do you have any other network configuration services enabled besides systemd-networkd?
ex. NetworkManager, netctl, wicd, dhcpcd, dhclient

Offline

#3 2016-01-18 08:21:01

daviid00
Member
Registered: 2016-01-15
Posts: 7

Re: [SOLVED] Route - Default gateway deleted with systemd

Hi,

Thank you for your reply.

NetworkManager, wicd and dhclient are not installed on my Archlinux:

[root@drlinux drobinson]# systemctl status NetworkManager
● NetworkManager.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

[root@drlinux drobinson]# systemctl status wicd
● wicd.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

[root@drlinux drobinson]# systemctl status dhclient
● dhclient.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)


netctl and dhcpcd are disabled on my Archlinux:

[root@drlinux drobinson]# systemctl status netctl
● netctl.service - (Re)store the netctl profile state
   Loaded: loaded (/usr/lib/systemd/system/netctl.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

[root@drlinux drobinson]# systemctl status dhcpcd
● dhcpcd.service - dhcpcd on all interfaces
   Loaded: loaded (/usr/lib/systemd/system/dhcpcd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

If I am correct, all the above services are inactive and should not change the route default gateway.

Offline

#4 2016-01-18 08:47:32

tom.ty89
Member
Registered: 2012-11-15
Posts: 608

Re: [SOLVED] Route - Default gateway deleted with systemd

systemctl list-unit-files --state enabled

No need to check one by one. Also it could be those "@" services (e.g. dhcpcd@enp3s0), this could help checking too.

Offline

#5 2016-01-18 12:36:48

daviid00
Member
Registered: 2016-01-15
Posts: 7

Re: [SOLVED] Route - Default gateway deleted with systemd

Please find here below all the services enabled on my Archlinux

[root@drlinux drobinson]# systemctl list-unit-files --state enabled
UNIT FILE                                                     STATE
autovt@.service                                          enabled
dbus-org.freedesktop.network1.service enabled
dbus-org.freedesktop.resolve1.service enabled
getty@.service                                            enabled
nfs-server.service                                       enabled
sshd.service                                                enabled
systemd-networkd.service                        enabled
systemd-resolved.service                         enabled
tftpd.service                                                 enabled
rpcbind.socket                                            enabled
systemd-networkd.socket                         enabled
remote-fs.target                                          enabled

12 unit files listed.

Offline

#6 2016-01-18 13:15:42

x33a
Forum Moderator
Registered: 2009-08-15
Posts: 3,424
Website

Re: [SOLVED] Route - Default gateway deleted with systemd

@daviid00, please use code tags to make your output more readable.

https://wiki.archlinux.org/index.php/Fo … s_and_code

Offline

#7 2016-01-18 16:53:23

branch
Member
Registered: 2014-03-16
Posts: 196

Re: [SOLVED] Route - Default gateway deleted with systemd

First I would try disabling systemd-networkd.socket. While I am not sure exactly what this does, it is disabled by default, systemd.networkd does not depend on it, and it does "things" dynamically on rtnetlink events.

If the above does not help, I would try disabling systemd-networkd and configuring the network with a oneshot systemd service that makes the desired settings directly with /usr/bin/ip.  This would tell you if it is systemd-networkd misbehaving or if something else is running on the system that is doing this.

Offline

#8 2016-01-20 10:03:16

tom.ty89
Member
Registered: 2012-11-15
Posts: 608

Re: [SOLVED] Route - Default gateway deleted with systemd

No it's normal:

[tom@localhost ~]$ sudo systemctl disable systemd-networkd.service
Removed symlink /etc/systemd/system/multi-user.target.wants/systemd-networkd.service.
Removed symlink /etc/systemd/system/sockets.target.wants/systemd-networkd.socket.
[tom@localhost ~]$ sudo systemctl enable systemd-networkd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/systemd-networkd.service to /usr/lib/systemd/system/systemd-networkd.service.
Created symlink from /etc/systemd/system/sockets.target.wants/systemd-networkd.socket to /usr/lib/systemd/system/systemd-networkd.socket.

Offline

#9 2016-01-20 16:23:41

branch
Member
Registered: 2014-03-16
Posts: 196

Re: [SOLVED] Route - Default gateway deleted with systemd

Right you are. I must have messed up my search the first time.

$ find -L /usr/lib/systemd/system -type f -exec grep -Hn "networkd.socket" {} +
/usr/lib/systemd/system/dbus-org.freedesktop.network1.service:37:Also=systemd-networkd.socket
/usr/lib/systemd/system/systemd-networkd.service:37:Also=systemd-networkd.socket

Offline

#10 2016-01-28 09:15:04

daviid00
Member
Registered: 2016-01-15
Posts: 7

Re: [SOLVED] Route - Default gateway deleted with systemd

Hi

There is defnitely something changing my network settings during run-time.
The DNS infomration are also changed...

At start-up:

$ cat /etc/resolv.conf
# This file is managed by systemd-resolved(8). Do not edit.
#
# Third party programs must not access this file directly, but
# only through the symlink at /etc/resolv.conf. To manage
# resolv.conf(5) in a different way, replace the symlink by a
# static file or a different symlink.

nameserver 192.168.1.7
nameserver 192.168.1.8

After a while:

$ cat /etc/resolv.conf
# This file is managed by systemd-resolved(8). Do not edit.
#
# Third party programs must not access this file directly, but
# only through the symlink at /etc/resolv.conf. To manage
# resolv.conf(5) in a different way, replace the symlink by a
# static file or a different symlink.

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2001:4860:4860::8888
# Too many DNS servers configured, the following entries may be ignored.
nameserver 2001:4860:4860::8844

Any idea what could change the DNS settings during run-time?

Offline

#11 2016-01-28 09:40:53

x33a
Forum Moderator
Registered: 2009-08-15
Posts: 3,424
Website

Re: [SOLVED] Route - Default gateway deleted with systemd

Whatever updates the DNS entries is probably logging it to the journal as well. Inspect your systemd journal and see if anything relevant gets logged.

Offline

#12 2016-02-01 14:04:43

daviid00
Member
Registered: 2016-01-15
Posts: 7

Re: [SOLVED] Route - Default gateway deleted with systemd

I've took a look at journalctl.
It appears that I have a lot of occurences of this message:

systemd-networkd[235]: enp5s0: Starting DHCPv6 client after NDisc timeout failed: Invalid argument

Lookink at this topic, I've found a way to disable this message with  IPv6AcceptRouterAdvertisements=0:
http://archlinuxarm.org/forum/viewtopic.php?f=60&t=9636

Before setting this value in /etc/systemd/network/wired.network I had:

$ journalctl -b -u systemd-networkd
-- Logs begin at Mi 2015-05-27 14:41:27 CEST, end at Mo 2016-02-01 14:39:20 CET. --
Feb 01 14:35:47 drlinux systemd[1]: Starting Network Service...
Feb 01 14:35:47 drlinux systemd-networkd[235]: Enumeration completed
Feb 01 14:35:47 drlinux systemd-networkd[235]: enp5s0: Renamed to eth0
Feb 01 14:35:47 drlinux systemd-networkd[235]: enp3s0: Renamed to eth1
Feb 01 14:35:47 drlinux systemd-networkd[235]: eth0: Renamed to enp5s0
Feb 01 14:35:47 drlinux systemd-networkd[235]: eth1: Renamed to enp3s0
Feb 01 14:35:47 drlinux systemd[1]: Started Network Service.
Feb 01 14:35:51 drlinux systemd-networkd[235]: enp5s0: Gained carrier
Feb 01 14:35:52 drlinux systemd-networkd[235]: enp5s0: Gained IPv6LL
Feb 01 14:36:05 drlinux systemd-networkd[235]: enp5s0: Starting DHCPv6 client after NDisc timeout failed: Invalid argument
Feb 01 14:36:05 drlinux systemd-networkd[235]: enp5s0: Configured
Feb 01 14:39:20 drlinux systemd-networkd[235]: enp5s0: Starting DHCPv6 client on NDisc request failed: Invalid argument
Feb 01 14:39:20 drlinux systemd-networkd[235]: Could not send rtnetlink message: Invalid argument
Feb 01 14:39:20 drlinux systemd-networkd[235]: Could not remove route: Invalid argument

By disabling IPv6AcceptRouterAdvertisements I now have:

$ journalctl -b -u systemd-networkd
-- Logs begin at Mi 2015-05-27 14:41:27 CEST, end at Mo 2016-02-01 14:59:09 CET. --
Feb 01 14:58:59 drlinux systemd[1]: Starting Network Service...
Feb 01 14:58:59 drlinux systemd-networkd[248]: Enumeration completed
Feb 01 14:58:59 drlinux systemd[1]: Started Network Service.
Feb 01 14:58:59 drlinux systemd-networkd[248]: enp3s0: Renamed to eth0
Feb 01 14:58:59 drlinux systemd-networkd[248]: enp5s0: Renamed to eth1
Feb 01 14:58:59 drlinux systemd-networkd[248]: eth1: Renamed to enp5s0
Feb 01 14:58:59 drlinux systemd-networkd[248]: eth0: Renamed to enp3s0
Feb 01 14:59:03 drlinux systemd-networkd[248]: enp5s0: Gained carrier
Feb 01 14:59:04 drlinux systemd-networkd[248]: enp5s0: Gained IPv6LL
Feb 01 14:59:04 drlinux systemd-networkd[248]: enp5s0: Configured

I will let you know if my network configuration is stable after several days.

Last edited by daviid00 (2016-02-01 14:05:20)

Offline

#13 2016-02-12 15:05:22

daviid00
Member
Registered: 2016-01-15
Posts: 7

Re: [SOLVED] Route - Default gateway deleted with systemd

Since setting IPv6AcceptRouterAdvertisements=0 the problem has disapeared.
This is a bug known in systemd : https://github.com/systemd/systemd/issues/1982
This bug was introduced in Archlinux in November 2015 with  systemd-228-3.

I've made today a pacman -Syu, systemd has change to version  systemd-228-4.
I have also removed the  IPv6AcceptRouterAdvertisements=0.

My journalctl now shows:

$ journalctl -b -u systemd-networkd
-- Logs begin at Wed 2015-05-27 14:41:27 CEST, end at Mon 2016-02-15 08:50:41 CET. --
Feb 12 19:11:34 drlinux systemd[1]: Starting Network Service...
Feb 12 19:11:35 drlinux systemd-networkd[281]: Enumeration completed
Feb 12 19:11:35 drlinux systemd[1]: Started Network Service.
Feb 12 19:11:35 drlinux systemd-networkd[281]: enp5s0: Renamed to eth0
Feb 12 19:11:35 drlinux systemd-networkd[281]: enp3s0: Renamed to eth1
Feb 12 19:11:35 drlinux systemd-networkd[281]: eth0: Renamed to enp5s0
Feb 12 19:11:35 drlinux systemd-networkd[281]: eth1: Renamed to enp3s0
Feb 12 19:11:38 drlinux systemd-networkd[281]: enp5s0: Gained carrier
Feb 12 19:11:40 drlinux systemd-networkd[281]: enp5s0: Gained IPv6LL
Feb 12 19:11:53 drlinux systemd-networkd[281]: enp5s0: Starting DHCPv6 client after NDisc timeout failed: Invalid argument
Feb 12 19:11:53 drlinux systemd-networkd[281]: enp5s0: Configured

There is still the annoying message starting with "Starting DHCPv6...".
However this message is not repeated 40 hours after reboot., while it was repeated continuously with systemd-228-3.
Now I do have my default gateway unchanged.

To prevent the deletion of default gateway:
- systemd-228-3 => set IPv6AcceptRouterAdvertisements=0 in /etc/systemd/network/*
- systemd-228-4 => bug fixed

Last edited by daviid00 (2016-02-15 08:09:00)

Offline

#14 2016-02-23 12:11:20

daviid00
Member
Registered: 2016-01-15
Posts: 7

Re: [SOLVED] Route - Default gateway deleted with systemd

Hi,

After deveral days I faced the same issue with systemd-228-4.
I had to set IPv6AcceptRouterAdvertisements=0 again.

Offline

Board footer

Powered by FluxBB