Linux‎ > ‎Linux-Networking‎ > ‎

Basics - Changing IP

posted Oct 7, 2012, 9:36 PM by Joe Bieber
To change the IP address of a networking adapter, you need to modify the /etc/network/interfaces file.
Open a terminal and use your favorite text editor to make your changes.
In a graphical desktop environment, like Ubuntu, Mint, Etc. you can right-click on the network icon on the panel and select "edit connections". 

sudo gedit /etc/network/interfaces
sudo pluma /etc/network/interfaces

In a non-gui server environment, I like to use 'nano'(It's easy) or you can use 'vim'(takes a bit to get used to).

sudo nano /etc/network/interfaces

sudo vi /etc/network/interfaces

example:
auto eth0 
iface eth0 inet static 
    address 192.168.2.100 
    netmask 255.255.255.0 
    network 192.168.2.1 
    broadcast 192.168.2.255

Once you've saved your changes, you need to restart networking in order for your new settings to take effect.
Here's how:

sudo /etc/init.d/networking restart

Use ifconfig to confirm your settings have changed.