Ubuntu Change IP

Q. How do I change IP address under Ubuntu Linux using GUI and command line options?

A. You can change IP address using GUI tool called network-admin or by editing /etc/network/interfaces configuration file.

Ubuntu Linux Change IP Using Network Administration GUI Tool

The Network Administration Tool allows you to specify the way your system connects to other computers and to internet.

How do I start Network Administration Tool to change TCP/IP settings?

You can start Network Administration Tool by clicking on System menu > Choose Administration > Network tool.

Alternatively, open terminal (command line) and execute the following command:
$ network-admin &

When you start Network Administration Tool, you will be prompted for the administrator password, this is necessary because the changes done with this tool will affect the whole system. If not prompted for password click on Unlock button:

Network Administration Tool main window

The Network Administration Tool main window contains four tabbed sections:

  1. Connections : Shows all network interfaces, it also allows you to modify their settings.
  2. General : Allows you to modify your system host name and domain name.
  3. DNS : Contains two sections, the DNS servers are what your computer use for resolving the IP addresses from the domain names. The search domains are the default domains in which your system will search any host when no domain is specified.
  4. Hosts : Shows the list of aliases for accessing other computers.

To change IP address select Wired or wireless connection and click on properties button:

Click on OK > Close to save the changes.

Ubuntu Linux Change IP Using Command Line Config File

Open terminal and type the following command:
sudo vi /etc/network/interfaces
sudo gedit /etc/network/interfaces
Find eth0 section and setup IP address as follows:

auto eth0
iface eth0 inet static

Save and close the file. Once done, restart network:
$ sudo /etc/init.d/networking restart
Verify new IP address:
$ ifconfig eth0
$ ifconfig

For further information see this tutorial.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 7 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
7 comments… add one
  • Nikhil Trivedi Jun 13, 2011 @ 7:05


  • Indra Saputra Ahmadi Oct 26, 2011 @ 14:18

    but what about the latest version of the ubuntu? if these steps will be used?

  • abdul wahab Nov 22, 2011 @ 12:41

    i hav installed network-admin but it is not showing the connections tab it shows only the general,dns and host tab . i have also tried from /etc/network/interfaces file but the file contains only two lines and i hav not found the ip address to change tell me what to do i have tried all above options please help

  • Nisse Feb 14, 2012 @ 11:59

    unless the server is a gateway you also need to add gateway to the configuration

    Find eth0 section and setup IP address as follows:
    auto eth0
    iface eth0 inet static

  • Anil Nov 21, 2012 @ 0:49

    Thanks a lot.

  • joao Nov 5, 2015 @ 23:01

    de computer does not respond the restart command
    “$ sudo /etc/init.d/networking restart”
    returning the prompt
    I tried to use
    “$ network-admin &”
    and nothing happens only answer ” cannot open display”
    what do I???

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum