Configure Static IP Address - Ubuntu 14 Server in 3 Steps

In 3 steps I will explain how to configure static IP address in a Ubuntu server, without using any graphical tool.

Step 1:

The configuration file that keeps network configuration is as below:

/etc/networkinterfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static


Above file has single network interface eth0, which is getting it's IP address via dhcp. We need to change this to static.

Step 2:

Edit this file to look like below:

# vi /etc/networkinterfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.122.252
netmask 255.255.255.0
gateway 192.168.122.1



You only need to change colored text above, rest of the file is same.

Step 3:

# ifdown eth0
# ifup eth0

Above two commands will finish the task and you will get your static IP address up and running.


Comments

Popular posts from this blog

Install Puppet Client on RHEL 6.4

Install IBM Tivoli TSM 5.5 Backup Server (trial) on your Laptop using Linux KVM virtual machine

IBM TSM Client 5.x install (trial) on your Laptop using KVM Virtual Machines