News Ticker

Manual Static IP Address Configuration in Linux Server by Terminal

By Ajay Verma - Sunday 4 September 2016 No Comments
hello friends,
today i am going to write about how to manually configure static IP address in Linux Server using Terminal.
This is useful when you need a bridge connection in virtual machine, as well as working on server.
First of all login on server using terminal or/and ssh.
You can Check Current IP Configuration by below command in terminal:
ifconfig

The IP Configuration stored in interfaces file stored in:
/etc/network/interfaces

change to above directory:
cd /etc/network/

Before changing anything make a backup of interfaces file:
sudo cp interfaces interfaces.ud64

Now the most important part find below line
auto eth0
iface eth0 inet dhcp

and replace by your IP details for exaple:
auto eth0
iface eth0 inet static
address 192.168.3.166
netmask 255.255.0.0
gateway 192.168.3.1
dns-nameservers 8.8.8.8


Now its time to restart Ethernet interface:
Stop the network interface eth0:
ifdown eth0

Start the network interface eth0:
ifup eth0

Don't confuse with the following command, which restarts all the networks services :
/etc/init.d/networking restart

To see your various network interfaces, use the command:
/sbin/ifconfig -a

Now check your IP using ifconfig, you will get new static IP.
if you have any doubt or problem you can leave a comment below, i love to solve.

No Comment to " Manual Static IP Address Configuration in Linux Server by Terminal "