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:

  1. Configure using a graphical interface.
  2. Click on the network icon in the top right corner and select “Network Settings”.
  3. In the network settings window, locate and choose the network interface that is currently connected (such as Ethernet or Wi-Fi).
  4. Click on the “gear” icon to access settings, then choose the “IPv4” tab.
  5. In the IPv4 settings, select the “manual” option and then click on the “add” button.
  6. Enter the desired IP address, subnet mask, and gateway information that you want to set up.
  7. Click the “Apply” button to save the settings.
  8. Configure using command line:
  9. Open the terminal.
  10. Edit the network configuration file using the following command: sudo nano /etc/network/interfaces.
  11. Locate the configuration section for the current network interface (such as eth0) in the file.
  12. Add the following lines in the configuration section: address [IP address] netmask [subnet mask] gateway [gateway IP address]
  13. Save and close the file.
  14. 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.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds