Hi All,
Could any one please help me how to assign IP to a linux box permanently.
IP should not be changed even after Rebooting the machine.
Hi All,
Could any one please help me how to assign IP to a linux box permanently.
IP should not be changed even after Rebooting the machine.
Depends on the flavour of Linux you are using:
RedHat/CentOS: modify the file /etc/sysconfig/network-scripts/ifcfg-eth0
Debian: modify the file /etc/network/interfaces
That worked up to RedHat 6.0. The next version of RedHat that I used is 6.4. On 6.4 it is now /etc/sysconfig/network-scripts/ifcfg-em1. I do not know which release between 6.0 and 6.4 started this.
After you make the change to your network file you can do:
service network restart
to set the new IP address without an immediate reboot. Or just reboot if you want.
RHEL 6.3 which we have is still using ifcfg-ent0
Robin
FWIW, In RHEL 6.5 here, it is still ifconfig /etc/sysconfig/network-scripts/ifcfg-eth[0-9]
, so maybe some installs have different names of the network devices ( ifconfig | awk '{print $1}' RS=
) depending on the types of NIC's installed..
According to the documentation, Appendix A "Consistend Network Device Naming" eth[0123...] are replaced by em[0123...] with RedHat Linux Enterprise 6.x.
Maybe the updates are responsible for the different naming schemes: "Upgrades from Red Hat Enterprise Linux 6.0 to Red Hat Enterprise Linux 6.1 are unaffected, and the old eth[0123�] naming convention will continue to be used."
It also says this:
I had to sign in as a ReHat customer to see that page. All it was is a link to here.
We are migrating to an all Dell environment. The only systems I have installed 6.4 on are PowerEdge servers and Optiplex workstations.
work for me
DEVICE=??your interface
BOOTPROTO=static
IPADDR=x.x.x.x
NETMASK=255.255.255.0
GETEWAY=x.x.x.x
ONBOOT=yes
and save
i also added dns in /etc/resolv.conf
nameserver x.x.x.x
nameserver x.x.x.x
service network restart