Home Linux How to Configure IP Address on Ubuntu 16.04

How to Configure IP Address on Ubuntu 16.04

How can I configure a network interface on ubuntu from command line ??

To configure the IP address on Ubuntu 16.04, there are two methods. By graphically or with the help of the terminal. This article will show you how to configure IP addresses on the Ubuntu system.

Assign Static IP Address on Ubuntu 16.04

1. Graphical Method

To configure IP address graphically, just click on the network icon present at the desktop. As shown in the below snapshot.

Network Settings on Ubuntu

Moreover, if you did not find the network icon at the desktop, go to settings and click on network.

After it, new pop up will open. As shown in the below image. Edit the network interface to give static IP address.

Available network interface

Finally, go to IPv4 settings. Here you can also select DHCP IP address option to assign automatically IP address. Along with it, you can see the manual option. Click on manual and add IP address for your Ubuntu system. Below screenshot is attached.

Assign static IP AddressAssign static IP Address

2. Command Line Method

Next method to show you how to assign IP address through the terminal. First, check the network interface attached to the system. For this just run the ifconfig command from the terminal.

To assign an IP address, edit the file /etc/network/interfaces.

        Edit /etc/network/interfaces file

Comment the line ending with the name DHCP or loopback and add the few lines as shown in the above screenshot.

Where ens33 = Network Interface Name.

NOTE:- Here on my Ubuntu network interface name is ens33. So you can use the network interface name as per your machine. You can check the attached network interface to your machine by running the ifconfig command.

Save the file and exit. So now you can restart the network service and if still not get the new IP address, just reboot the system.

# sudo /etc/init.d/networking restart

Assign IP address carefully because if you mistakenly configured an incorrect IP address on the remote system, you can be in great trouble.

Finally, run the ifconfig command and check the IP address on Ubuntu 16.04.

Conclusion: You have perfectly learned how to configure IP address on Ubuntu 16.04 system. For any doubts or feedback, kindly write in below comment box.


Please enter your comment!
Please enter your name here