How can I set up a static IP address on Ubuntu?
In Ubuntu system, you can configure a static IP address using the following method:
- Configure using a graphical interface.
- Click on the network icon in the top right corner and select “Network Settings”.
- In the network settings window, locate and choose the network interface that is currently connected (such as Ethernet or Wi-Fi).
- Click on the “gear” icon to access settings, then choose the “IPv4” tab.
- In the IPv4 settings, select the “manual” option and then click on the “add” button.
- Enter the desired IP address, subnet mask, and gateway information that you want to set up.
- Click the “Apply” button to save the settings.
- Configure using command line:
- Open the terminal.
- Edit the network configuration file using the following command: sudo nano /etc/network/interfaces.
- Locate the configuration section for the current network interface (such as eth0) in the file.
- Add the following lines in the configuration section: address [IP address] netmask [subnet mask] gateway [gateway IP address]
- Save and close the file.
- Restart the networking service using the following command: sudo systemctl restart networking.
Please make sure to have a clear understanding of the network environment and network parameter settings before configuring a static IP address.