Date created: Friday, March 25, 2022 10:21:25 AM. Last modified: Wednesday, November 15, 2023 5:49:00 PM

netplan

Get the current running config:

$ netplan get
network:
version: 2
ethernets:
eth0:
match:
macaddress: "00:1e:06:42:03:e0"
addresses:
- "192.168.0.10/24"
- "fd:0:0:0::10/64"
dhcp4: false
dhcp6: true
set-name: "eth0"
routes:
- to: "default"
via: "192.168.0.254"

 

Example netplan config belows gets an IPv4 and IPv6 address via DHCP, but also has a static v4 and v6 address:

$ cat /etc/netplan/10-default.yaml
network:
    version: 2
    ethernets:
        eth0:
            dhcp4: true
            dhcp6: true
            match:
                macaddress: 22:22:33:44:55:66
            set-name: eth1
            addresses:
              - 10.0.0.8/24
              - fd:0:0:1::8/64
routes:
- to: 192.0.2.1/32
via: 10.0.0.1