# systemd-networkd doesn't work, for me [SOLVED]

## mounty1

I want to use systemd-networkd to set up my network so:

```
total 4

-rw-r--r-- 1 root root 37 Jun 30 03:42 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.

```
  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.

----------

## Logicien

Have-you check what say

```
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.

```
[Match]

Name=eth0

[Network]

DHCP=ipv4
```

----------

## mounty1

```
● 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.

----------

## Logicien

Do you have any dhcp client installed who systemd.network can use, dhcpcd, dhclient, etc?

----------

## mounty1

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.

```
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...
```

----------

## Logicien

What output give those commands

```
ls -al /etc/systemd/network

ip link show

ip route list
```

----------

## mounty1

```
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
```

```
[Match]

Name=en*

[Network]

DHCP=yes
```

```
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
```

```
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.

----------

## mounty1

Kernel without CONFIG_PACKET, so dhclient couldn't run.

----------

