Knowledgebase

Howto add IP permanently to your dedicated CentOS server?

Posted by pj1s, 08-11-2007, 07:11 PM
Any straight up easy way. So they stay permanent? Can I simply use system-config-network and add each IP one at a time.

Posted by StevenG, 08-11-2007, 07:32 PM
The network files are in /etc/sysconfig/network-scripts/ifcfg-eth0 , /etc/sysconfig/network-scripts/ifcfg-eth0:1 ifcfg-eth0:2 etc Once added, just up them with # ifup eth0:1 (for example) they will up themselves at reboot or network start. Make a new file for each virtual interface or add a range to 1.

Posted by pj1s, 08-12-2007, 08:16 AM
Thank you. I'm not sure how to add a range --- but I guess different files work just as well.

Posted by StevenG, 08-12-2007, 08:36 AM
You can add a range using something like File: /etc/sysconfig/network-scripts/ifcfg-eth0-range IPADDR_START=xxx.xxx.xxx.xxx IPADDR_END=xxx.xxx.xxx.xxx CLONENUM_START=0 # ifup ifcfg-eth0-range (Replace xxx.xxx.xxx.xxx with your IP's as required)

Posted by pj1s, 08-12-2007, 10:02 AM
Thanks again. I deleted the ifcfg-eth0:x files I made - but with reboot the server doesn't come up... would this really break the boot? Anyway - only access I have is a debian rescue system ... I'm guessing there must be a way to troubleshoot this issue ie setting auto DHCP on boot or something. Any help on how I can boot the server? Was the mistake simply not running ifdown on the new eth0:x before rebooting..?

Posted by gbjbaanb, 08-12-2007, 03:11 PM
I would check that you didn't delete all the eth0 files, its easily done after all. Even so, the server should reboot, just without any networking. Watch the console as it boots and you might get a better idea of what's gone wrong.

Posted by svb123, 04-03-2012, 07:08 PM
I really wish I'd read the rest of this post before I tried this. The EXACT same thing happened to me, network restart crashed network, now the server won't come online. Or at least the networking won't come online, so I have absolutely NO ACCESS to my server or any of its files.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
XeHost.Net Down (Views: 692)
OpenVZ Problem (Views: 608)


Language:

Client Login

Email

Password

Remember Me

Search