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.
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
Post a Comment