Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
systemd-networkd doesn't work, for me [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 768
Location: Queensland

PostPosted: Wed Jun 29, 2016 10:09 pm    Post subject: systemd-networkd doesn't work, for me [SOLVED] Reply with quote

I want to use systemd-networkd to set up my network so:
ls -l /etc/systemd/network:
total 4
-rw-r--r-- 1 root root 37 Jun 30 03:42 wired.network
cat /etc/systemd/network/wired.network:
[Match]
Name=en*

[Network]
DHCP=yes
but although systemd-networkd is enabled (and NetworkManager.service is disabled, to prevent interference) the interface is not set up.
systemctl | grep systemd-networkd:
  systemd-networkd.service                                                                 loaded    active running   Network Service
  systemd-networkd.socket                                                                  loaded    active running   Network Service Netlink Socket
I believe the DHCP server is working because another machine on the same LAN (with the same configuration) does obtain an address. Yes, there are plenty more addresses available.

Why would systemd-networkd.service silently and instantly fail? -- which it does if I run systemctl restart systemd-networkd.
_________________
Michael Mounteney


Last edited by mounty1 on Sun Jul 03, 2016 3:49 am; edited 1 time in total
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Thu Jun 30, 2016 12:08 am    Post subject: Reply with quote

Have-you check what say
Code:
systemctl status systemd-networkd.service

Here I have the exact interface to configure and use ipv4 as value instead of yes. I am connected every time to Internet as this machine is the gateway.
Code:
[Match]
Name=eth0

[Network]
DHCP=ipv4

_________________
Paul
Back to top
View user's profile Send private message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 768
Location: Queensland

PostPosted: Thu Jun 30, 2016 12:44 am    Post subject: Yes, it looks OK Reply with quote

systemctl status systemd-networkd.service:
● systemd-networkd.service - Network Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2016-06-30 16:02:38 AEST; 5h 20min left
     Docs: man:systemd-networkd.service(8)
 Main PID: 354 (systemd-network)
   Status: "Processing requests..."
   CGroup: /system.slice/systemd-networkd.service
           └─354 /usr/lib/systemd/systemd-networkd

Jun 30 16:02:38 localhost systemd[1]: Starting Network Service...
Jun 30 16:02:38 localhost systemd-networkd[354]: Enumeration completed
Jun 30 16:02:38 localhost systemd[1]: Started Network Service.
Jun 30 16:03:04 localhost systemd-networkd[354]: enp0s25: Gained IPv6LL

I tried DHCP=ipv4 as welll; no difference.

I am currently working-around this matter by ifconfig enp0s25 192.168.1.63 so the interface is obviously up and working.
_________________
Michael Mounteney
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Thu Jun 30, 2016 6:46 am    Post subject: Reply with quote

Do you have any dhcp client installed who systemd.network can use, dhcpcd, dhclient, etc?
_________________
Paul
Back to top
View user's profile Send private message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 768
Location: Queensland

PostPosted: Thu Jun 30, 2016 9:08 am    Post subject: Yes Reply with quote

Both dhcpcd and dhclient are available.

Also, systemctl restart systemd-networkd causes the previously-set static address to be lost; so it's doing something.

journalctl -r output:
enp0s25: Could not drop address: No such process
Network configuration changed, trying to establish connection.
Started Network Service.
Synchronized to time server 192.168.1.1:123 (cortex).
Network configuration changed, trying to establish connection.
Enumeration completed
enp0s25: Gained IPv6LL
Starting Network Service...
Stopped Network Service.
Synchronized to time server 192.168.1.1:123 (cortex).
Stopping Network Service...

_________________
Michael Mounteney
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Thu Jun 30, 2016 11:09 am    Post subject: Reply with quote

What output give those commands
Code:
ls -al /etc/systemd/network
ip link show
ip route list

_________________
Paul
Back to top
View user's profile Send private message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 768
Location: Queensland

PostPosted: Thu Jun 30, 2016 9:51 pm    Post subject: Here it all is Reply with quote

ls -al /etc/systemd/network/:
total 12
drwxr-xr-x 2 root root 4096 Jun 30 03:56 .
drwxr-xr-x 6 root root 4096 Jun 30 16:06 ..
-rw-r--r-- 1 root root   37 Jun 30 03:42 wired.network
cat /etc/systemd/network/wired.network:
[Match]
Name=en*

[Network]
DHCP=yes
ip link show:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1
    link/sit 0.0.0.0 brd 0.0.0.0
3: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 00:1c:7e:f1:af:ab brd ff:ff:ff:ff:ff:ff

ip route list:
default via 192.168.1.1 dev enp0s25
192.168.1.0/24 dev enp0s25  proto kernel  scope link  src 192.168.1.63

The current IP and route were set by me statically.

The other point to mention is that I started the kernel configuration with make allnoconfig for a minimal kernel, then added bits one at a time as required. Just for completeness, here is my config.
_________________
Michael Mounteney
Back to top
View user's profile Send private message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 768
Location: Queensland

PostPosted: Sun Jul 03, 2016 3:50 am    Post subject: Fault was driving dhclient Reply with quote

Kernel without CONFIG_PACKET, so dhclient couldn't run.
_________________
Michael Mounteney
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum