Netplan Static IP

Configuring a static IP with netplan

02-24-22

Ubuntu Server (Raspberry Pi)

/etc/netplan/01-netcfg.yaml

network:
    ethernets:
        eth0:
            dhcp4: no
            dhcp6: no
            addresses: [<device IP>/24]
            routes:
             - to: default
             via: <router IP>
            nameservers:
              addresses: [1.1.1.1]
    version: 2
    renderer: networkd

Remove 50-cloud-init.yaml.

sudo netplan apply

Regular Ubuntu Server may be /etc/netplan/00-installer-config.yaml, unsure.


Tagged: homelab linux networking