netplan package ubuntu code example
Example: netplan file ubuntu
# sudo su
# cp /etc/netplan/01-netcfg.yaml /etc/netplan/01-netcfg.yaml.bak
# nano /etc/netplan/01-netcfg.yaml
#configuration example
network:
ethernets:
ens33:
dhcp4: true
optional: true
ens34:
dhcp4: false
addresses: [192.168.231.3/24]
gateway4: 192.168.231.50
nameservers:
addresses: [192.168.231.50, 8.8.8.8]
ens35:
dhcp4: true
version: 2
# netplan try
# netplan apply