systemd dhcp don't work on vlan

Bug #1831470 reported by Roman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

root@gwd:~# uname -a
Linux gwd 4.15.0-50-generic #54-Ubuntu SMP Mon May 6 18:46:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

root@gwd:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

root@gwd:~# cat /etc/systemd/network/enp3s0.network
[Match]
Name=enp3s0

[Link]
MACAddress=C8:D3:A3:50:02:33

[Network]
VLAN=enp3s0.2

root@gwd:~# cat /etc/systemd/network/enp3s0.2.netdev
[NetDev]
Name=enp3s0.2
Kind=vlan

[VLAN]
Id=2

root@gwd:~# cat /etc/systemd/network/enp3s0.2.network
[Match]
Name=enp3s0.2

[Network]
DHCP=ipv4

[DHCP]
UseRoutes=true

-----------------------------
No ip on enp3s0.2 after boot!
dhclient enp3s0.2 works fine, i create systemd service for it as temporary workaround

Revision history for this message
Roman (krey81) wrote :

netplan and cloud-init not used and was purged

Revision history for this message
Roman (krey81) wrote :

on same machine usb modem works fine with DHCP option

root@gwd:~# cat /etc/systemd/network/yota.network
[Match]
Name=enx0c5b8f279a64

[Network]
DHCP=yes

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

How does your vlan .netdev unit looks like?

You need something that creates the vlan device on top of the selected underlying device, ie.:

$ cat enp3s0.2.netdev
[NetDev]
Name=enp3s0.2
Kind=vlan

[VLAN]
Id=2

Without that, there won't be vlan device created (nor visiable in $ ip a), and thus no network on it either.

Changed in systemd (Ubuntu):
status: New → Invalid
status: Invalid → Incomplete
Revision history for this message
Roman (krey81) wrote :

root@gwd:~# cat /etc/systemd/network/enp3s0.2.netdev
[NetDev]
Name=enp3s0.2
Kind=vlan

[VLAN]
Id=2

Revision history for this message
Roman (krey81) wrote :

I wrote earlier that the dhclient works fine on this interface, so the problem is apparently that dhcp does not work as requested for the vlan network

Changed in systemd (Ubuntu):
status: Incomplete → New
description: updated
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Please attach output from networkd on boot prior to / without the extra dhclient unit if you can.

$ networkctl | pastebinit

$ journalctl -b -u systemd-networkd | pastebinit

Revision history for this message
Roman (krey81) wrote :

make it through crontab and redirect output

root@gwd:~# cat /root/networkctl
IDX LINK TYPE OPERATIONAL SETUP
  1 lo loopback carrier unmanaged
  2 enp2s0 ether carrier configured
  3 enp3s0 ether degraded configured
  4 wg0 none routable configured
  5 br-mgmt ether routable configured
  6 br-lan ether no-carrier configuring
  7 enp3s0.2 ether degraded configuring

7 links listed.

root@gwd:~# cat /root/journal-systemd
-- Logs begin at Sun 2018-01-28 18:58:18 MSK, end at Tue 2019-06-04 16:06:01 MSK. --
Jun 04 16:02:15 gwd systemd[1]: Starting Network Service...
Jun 04 16:02:15 gwd systemd-networkd[635]: br-lan: netdev ready
Jun 04 16:02:15 gwd systemd-networkd[635]: br-mgmt: netdev ready
Jun 04 16:02:15 gwd systemd-networkd[635]: wg0: netdev ready
Jun 04 16:02:15 gwd systemd-networkd[635]: Enumeration completed
Jun 04 16:02:15 gwd systemd[1]: Started Network Service.
Jun 04 16:02:15 gwd systemd-networkd[635]: enp2s0: Link is not managed by us
Jun 04 16:02:15 gwd systemd-networkd[635]: br-mgmt: Link is not managed by us
Jun 04 16:02:15 gwd systemd-networkd[635]: lo: Link is not managed by us
Jun 04 16:02:15 gwd systemd-networkd[635]: br-lan: Link is not managed by us
Jun 04 16:02:15 gwd systemd-networkd[635]: wg0: Link is not managed by us
Jun 04 16:02:15 gwd systemd-networkd[635]: br-mgmt: Link is not managed by us
Jun 04 16:02:15 gwd systemd-networkd[635]: lo: Link is not managed by us
Jun 04 16:02:15 gwd systemd-networkd[635]: br-lan: Link is not managed by us
Jun 04 16:02:15 gwd systemd-networkd[635]: wg0: Link is not managed by us
Jun 04 16:02:15 gwd systemd-networkd[635]: enp3s0.2: netdev ready
Jun 04 16:02:15 gwd systemd-networkd[635]: enp3s0: IPv6 successfully enabled
Jun 04 16:02:15 gwd systemd-networkd[635]: enp2s0: IPv6 successfully disabled
Jun 04 16:02:18 gwd systemd-networkd[635]: enp3s0: Gained carrier
Jun 04 16:02:18 gwd systemd-networkd[635]: enp3s0.2: Gained carrier
Jun 04 16:02:18 gwd systemd-networkd[635]: br-lan: IPv6 successfully enabled
Jun 04 16:02:18 gwd systemd-networkd[635]: br-mgmt: IPv6 successfully enabled
Jun 04 16:02:18 gwd systemd-networkd[635]: wg0: IPv6 successfully disabled
Jun 04 16:02:18 gwd systemd-networkd[635]: wg0: Gained carrier
Jun 04 16:02:18 gwd systemd-networkd[635]: wg0: Configured
Jun 04 16:02:18 gwd systemd-networkd[635]: lo: Link is not managed by us
Jun 04 16:02:19 gwd systemd-networkd[635]: enp2s0: Gained carrier
Jun 04 16:02:19 gwd systemd-networkd[635]: enp2s0: Configured
Jun 04 16:02:19 gwd systemd-networkd[635]: br-mgmt: Gained carrier
Jun 04 16:02:20 gwd systemd-networkd[635]: enp3s0: Gained IPv6LL
Jun 04 16:02:20 gwd systemd-networkd[635]: enp3s0: Configured
Jun 04 16:02:20 gwd systemd-networkd[635]: enp3s0.2: Gained IPv6LL
Jun 04 16:02:20 gwd systemd-networkd[635]: br-mgmt: Gained IPv6LL
Jun 04 16:02:20 gwd systemd-networkd[635]: br-mgmt: Configured

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Is that the full networkd config?

Slightly confused why enp3s0 is degraded. Does it have a cable plugged in?

Could you tar up and share /run/systemd/netif ?

Does adding below

[DHCP]
ClientIdentifier=mac

to the enp3s0.2.network help?

Revision history for this message
Roman (krey81) wrote :

yes full config. Many cables unplugged because router not fully functional
enp3s0 connected to swithch in Tagged port, configured only with Vlan 2.
ClientIdentifier=mac not helped

my problem looks similar to https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1779721

Revision history for this message
Roman (krey81) wrote :

here is lease gained from dhclient
dhcp-lease-time present

lease {
  interface "enp3s0.2";
  fixed-address 213.141.128.50;
  option subnet-mask 255.255.224.0;
  option routers 213.141.159.252;
  option dhcp-lease-time 7200;
  option dhcp-message-type 5;
  option domain-name-servers 212.1.224.6,212.1.244.6;
  option dhcp-server-identifier 212.1.254.199;
  option vendor-encapsulated-options "http://acs.netbynet.ru";
  renew 2 2019/06/04 16:09:10;
  rebind 2 2019/06/04 17:06:44;
  expire 2 2019/06/04 17:21:44;
}

Revision history for this message
Roman (krey81) wrote :
Revision history for this message
Roman (krey81) wrote :
Revision history for this message
Roman (krey81) wrote :

here is two tcpdumps of dhcp ports

root@gwd:~# tcpdump -vv -i enp3s0 -n port 67 and port 68
tcpdump: listening on enp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes

SYSTEMD [NOT WORKED]
19:58:01.261864 IP (tos 0xc0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 300)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from c8:d3:a3:50:02:33, length 272, xid 0x495060a3, secs 1539, Flags [none] (0x0000)
          Client-Ethernet-Address c8:d3:a3:50:02:33
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Discover
            Client-ID Option 61, length 7: ether c8:d3:a3:50:02:33
            Parameter-Request Option 55, length 8:
              Subnet-Mask, Default-Gateway, Hostname, Domain-Name
              Domain-Name-Server, MTU, Static-Route, Classless-Static-Route
            MSZ Option 57, length 2: 576
            Hostname Option 12, length 3: "gwd"

DHCLIENT [WORKED]
20:02:33.187353 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from c8:d3:a3:50:02:33, length 300, xid 0x5986fc7c, Flags [none] (0x0000)
          Client-Ethernet-Address c8:d3:a3:50:02:33
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Request
            Requested-IP Option 50, length 4: 213.141.128.50
            Hostname Option 12, length 3: "gwd"
            Parameter-Request Option 55, length 13:
              Subnet-Mask, BR, Time-Zone, Default-Gateway
              Domain-Name, Domain-Name-Server, Option 119, Hostname
              Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
              NTP

Revision history for this message
Roman (krey81) wrote :

ok. bug may be closed, i locate problem.

dhcp don't get lease on discovery if where is a valid lease. After release current lease systemd dhcp discover request was answered.

Roman (krey81)
Changed in systemd (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.