Skip to content

linux commands


netplan

The below config is stored in /etc/netplan/01-netcfg.yaml

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no # disable dhcp
      addresses:
        - 192.168.1.2/24 # give a fixed IP
      routes:
        - to: default
          via: 192.168.1.1 # internet via router
      nameservers:
        addresses:
          - 192.168.1.1 # dns via router
          - 8.8.8.8
  wifis: {}  # keeps Wi-Fi disabled

All files in /etc/netplan/ are loaded into the config. - The number at the start of the file gives the priority. - A default file is loaded on new install (might have to remove).

Load new settings:

sudo netplan apply

Change access to root access only:

sudo chmod 600 /etc/netplan/01-netcfg.yaml

See also