/etc/netplan/50-cloudinit.yaml
(or other, higher-numbered file):
network:
version: 2
ethernets:
ens192:
dhcp4:false
addresses:
- 192.168.1.19/24
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses: [192.168.1.5]
search: [example.com]
match:
macaddress: 00:11:22:33:44:55
set-name: ens192
tip Vim Magic You can use
vim
’s:r[ead]
command to read in the mac address without having to copy/paste, bounce between terminals, or memorize it:
<Esc>:r /sys/class/net/ens192/address
sudo netplan apply