Configuration file path
In Ubuntu, network configuration files are usually located in the /etc/netplan/ directory, and their file names have the .yaml suffix. Netplan is the default network configuration tool in Ubuntu 17.10 and higher, used to configure network interfaces, IP addresses, gateways, DNS servers, etc.
We can see that the configuration file is 01-network-manager-all.yaml
Edit configuration file
Enter the editing command: This command must have a system interface. If you want to edit on the terminal, you need to use another command.
Has operating system interface
gedit 01-network-manager-all.yaml
Save the changes directly
Terminal execution (no operating system interface)
vi 01-network-manager-all.yaml
Take effect
sudo netplan apply