Static IPs with netplan

From lxadm | Linux administration tips, tutorials, HOWTOs and articles
Jump to: navigation, search

eth0 is static, eth1 is DHCP:

root@app:~# cat /etc/netplan/10-lxc.yaml 
network:
  ethernets:
    eth0:
     dhcp4: no
     dhcp6: no
     addresses: [10.178.171.21/24]
     gateway4: 10.178.171.1
     nameservers:
       addresses: [10.0.0.53]
    eth1: {dhcp4: true}
  version: 2