How to configure private IP in the Linux server

To configure private IP address in a Linux server, you need to edit the file "/etc/sysconfig/network-scripts/ifcfg-eth1" as follows:

root@server[~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=YOUR_PRIVATE_IP_ADDRESS
NETMASK=255.255.0.0

Give the actual private IP address you want to configure in the section 'IPADDR'.

root@server[~]# service network restart

Then to get the IP up immediately, or for other distros, run the following command:

root@server[~]# ifconfig eth1 PRIVATE_IP netmask 255.255.0.0

root@server[~]# ifconfig eth1 up

P.S:-

Ubuntu 7/8/9 - Add the above ifconfig commands to rc.local to automatically bring the private lan connection up after reboot.

Gentoo 2008 - Add the above ifconfig commands to etc/conf.d/local.start

Thank you.

Comments

Popular posts from this blog

SVN: File remains in conflict

12 tweakings for WHM/cPanel to speed up WordPress

HowTo: Enable extended logging for exim