Netplan Examples

From KHicks
Revision as of 21:03, 12 September 2018 by Kevin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here are some quick examples of Netplan on Ubuntu >= 17.04.

/etc/netplan/01-netcfg.yaml

DHCP

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: yes

Static address

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      addresses:
        - 192.168.1.20/24
      gateway4: 192.168.1.1
      nameservers:
        search:
          - example.com
        addresses:
          - 192.168.1.1