Ubuntu configuration static IP tutorial

One of them is relatively simple, which is graphical and can be changed directly. I won’t go into details here. Let me talk about how to change the configuration file to set a static IP:

1. Edit the configuration file:

#sudo vim /etc/netplan/01-network-manager-all.yaml

(Note: If you are not a root user, you need to add "sudo" to add administrator rights)

2. Change the configuration file, as shown in the figure:

 (Note: There is a "space" after the "colon" in the configuration file for dhcp4, IP, gateway, and DNS )

3. Execute the command to take effect

#sudo netplan apply

4. If there is an error, please check the configuration file format.

Guess you like

Origin blog.csdn.net/m0_46517962/article/details/129763004