vlan ip not assigned on boot but with `netplan apply`
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
New
|
Undecided
|
Unassigned | ||
Ubuntu |
New
|
Undecided
|
Unassigned |
Bug Description
Hi everyone.
This is my first time with netplan so this could be related to my inexperience, forgive me if is this the case.
This is the only yaml config file present:
```
$ cat /etc/netplan/
network:
version: 2
renderer: networkd
ethernets:
ens3:
addresses: ["192.168.1.2/24"]
gateway4: 192.168.1.1
nameservers:
addresses: ["1.1.1.1", "1.0.0.1"]
vlans:
vlan2:
id: 2
link: ens3
addresses: ["192.168.2.1/24"]
routes:
- to: 0.0.0.0/0
from: 192.168.2.0/24
via: 192.168.1.1
```
# ifupdown is not installed (I installed and then removed while installing the server).
```
$ ls /etc/network/*
/etc/network/fan
/etc/network/
resolvconf ubuntu-fan
/etc/network/
bridge ubuntu-fan vlan
/etc/network/
bridge ethtool mtuipv6 vlan
/etc/network/
000resolvconf ethtool ip mtuipv6 openssh-server ubuntu-fan vlan
# I also removed the 50_cloud_* file from here:
$ ls /etc/cloud/
05_logging.cfg 90_dpkg.cfg README curtin-
```
Now the lettuce..
If I execute: `sudo netplan apply`, everything works as expected:
```
$ ip -4 addr
1: lo: <LOOPBACK,
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,
inet 192.168.1.2/24 brd 192.168.1.255 scope global ens3
valid_lft forever preferred_lft forever
4: vlan2@ens3: <BROADCAST,
inet 192.168.2.1/24 brd 192.168.2.255 scope global vlan2
valid_lft forever preferred_lft forever
```
The problem occurs after a reboot, where the vlan2 tries to obtain an IP via DHCP and the vlan2 ip is assigned to the ens3 interface. The funny part here, is that if I manually execute `netplan apply` at this point, the right IP is assigned to the vlan2 interface, so in my case, I have "solved" this issue, putting `netplan apply` in the `/etc/rc.local` file...
```
ip -4 addr
1: lo: <LOOPBACK,
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,
inet 192.168.1.2/24 brd 192.168.1.255 scope global ens3
inet 192.168.2.1/24 brd 192.168.2.255 ...
valid_lft forever preferred_lft forever
4: vlan2@ens3: <BROADCAST,
inet 169.254.x.y/z ...
valid_lft forever preferred_lft forever
```
Am I missing something?
Thank you for the attention.
Check if the systemd service `systemd-networkd` is enabled.
systemctl status systemd-networkd
If output has string 'disabled' at reasonable place do
sudo systemctl enable systemd-networkd
Thanks for the original report
Apology for the late response
Please provide feedback