-
Command line mode Editing is required to modify network configuration through command line mode /etc/netplan/ Directory, and then regenerate the configuration file and apply the changes. The specific steps are as follows: -
Open the terminal and enter the following command to open the YAML file to be edited: sudo nano /etc/ netplan/ 01 -netcfg.yaml among 01-netcfg.yaml Is the default network profile name. -
Find the interface to be modified in the file and make necessary changes (such as static IP address, gateway, etc.). -
Press Ctrl + X Save your changes and exit the editor. -
Run the following command to apply the changes: sudo netplan apply
You can use ifconfig or ip addr Command to check whether the new network configuration takes effect. -
-
GUI mode In the Ubuntu system, you can also use GUI tools to easily modify the network configuration. The specific steps are as follows: -
Click the network icon in the upper right corner of the screen and select "Wired Settings" or "Wi Fi Settings" (depending on the type of connection you are currently using). -
Click the "Options" button in the pop-up dialog box, and then select the "IPv4" or "IPv6" tab. -
Make necessary changes in the tab, such as enabling the static IP address and entering relevant details, such as IP address, gateway, DNS, etc. -
Click the Apply button to save the changes and close the dialog box.
-