Skip to content

Instantly share code, notes, and snippets.

@ravexina
Created April 1, 2019 16:41
Show Gist options
  • Select an option

  • Save ravexina/da388a40e27593fe819beda037a7b31f to your computer and use it in GitHub Desktop.

Select an option

Save ravexina/da388a40e27593fe819beda037a7b31f to your computer and use it in GitHub Desktop.
Netplan example configuration and simple usage
# - - - - - - - - - - - - - - - - - -
# > $ sudo netplay try
# > $ sudo netplan apply
# > $ ip link set ens3 down/up
# > $ ip addr show ens3
# - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - -
# Static configuration
# - - - - - - - - - - - - - - - - - -
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: false
dhcp6: false
addresses: [192.168.1.10/24]
gateway4: 192.168.1.254
nameservers:
addresses: [8.8.4.4, 8.8.8.8]
# - - - - - - - - - - - - - - - - - -
# DHCP Configuration
# - - - - - - - - - - - - - - - - - -
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: true
dhcp6: false
optional: true
ens4:
dhcp4: true
dhcp6: false
optional: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment