Ubuntu: netplan disable dhcp
After spending X amount of hours on trying to find the fix here, I decided to just disable the dhcpcd service:
root@pro-rpi-02:~# systemctl status dhcpcd.service
● dhcpcd.service - DHCP Client Daemon
Loaded: loaded (/lib/systemd/system/dhcpcd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:dhcpcd(8)
Now everything is working like I would like it to work:
root@pro-rpi-02:~# more /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses:
- 192.168.1.2/26
gateway4: 192.168.1.10
nameservers:
addresses: [192.168.1.24]
search: [hello.home]
vlans:
vlan8:
id: 8
link: eth0
dhcp4: no
dhcp6: no
addresses:
- 192.168.8.2/24
root@pro-rpi-02:~# ip a sh vlan8
4: vlan8@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether dc:a6:32:b3:45:e0 brd ff:ff:ff:ff:ff:ff
inet 192.168.8.2/24 brd 192.168.8.255 scope global vlan8
valid_lft forever preferred_lft forever
inet6 fe80::dea6:32ff:feb3:45e0/64 scope link
valid_lft forever preferred_lft forever