Need help with new IP configuration!

mikelato

Verified User
Joined
Jan 25, 2010
Messages
74
Hello,

I just recently got a new block of IPs for my server and I have attempted to set up the server to work with the new block of IPs. I have done everything I am aware I should do yet I cannot figure out why nothing is working correctly.

I need to know exactly what files to edit and what to put in each file if the information from my ISP is as follows.

IP: xx.xx.xx.185-9
Gateway: xx.xx.xx.190
Netmask: 255.255.255.248
DNS1: xx.xx.xx.226
DNS2: xx.xx.xx.242

If someone could post sample configuration files for me that would be a huge help. I would like to know what to put in the resolv.conf, ifcfg-eth0, /etc/HOSTNAME, /etc/hosts, and any other files I need to configure. I also would like to know what I need to put for static routes to get this to work properly. Thanks in advance for your time. Let me know if you need any more information.

-Mike
 
You should not need to edit any files. Just add the ip's via DirectAdmin.
 
My old IP is not longer active so I am replacing it therefor directadmin does not work right now. I need instructions to change the IP in the server from one IP to a completely new IP.

Thanks,
Mike
 
Thanks again for trying to help but I was looking for the server configuration not how to change directadmin over to the new IPs.

Boot the server with the new server ip. Do this the same way you did originally for the old server IP. This should be done in your system's network settings and not in DirectAdmin (yet). Do not add the IP to DA through the IP Manager.

It just says to do it how you did it before. My issue was that I did not know what I was doing wrong because I had thought I did it right. I ended up figuring it out this morning.

In case anyone else has a similar problem here is what I did to set up the server with a new static IP.

1) I modified /etc/sysconfig/network-scripts/ifcfg-eth0 with the IP and network settings provided to me through my ISP.

BOOTPROTO=none
PEERDNS=yes
IPV6INIT=no
TYPE=Ethernet
DEVICE=eth0
NETMASK=255.255.255.XXX (Provided by ISP)
BROADCAST=XXX.XXX.XXX.255 (This should end with the highest value)
IPADDR=XXX.XXX.XXX.XXX (Provided by ISP)
NETWORK=XXX.XXX.XXX.0 (This should end with the lowest value)
ONBOOT=yes
USERCTL=no
GATEWAY=XXX.XXX.XXX.XXX (Provided by ISP)

2) I edited /etc/resolv.conf and made sure the DNS servers were set to the ones provided to me through my ISP.

; generated by /sbin/dhclient-script
nameserver XXX.XXX.XXX.XXX (Primary nameserver provided by ISP)
nameserver XXX.XXX.XXX.XXX (Secondary nameserver provided by ISP)
search abc.abc.abc.abc (This depends on your ISP but tells the server where to search for the nameservers).

3) I changed /etc/sysconfig/network to have the correct network settings for my new gateway.

NETWORKING=yes (Leave set to yes)
HOSTNAME=hostname.domain.com (Your server hostname)
GATEWAY="XXX.XXX.XXX.XXX" (Provided by ISP)

4)Finally, I had to add the default route to the server in order to get the network to function properly. Run the following command.

route add -net default gw XXX.XXX.XXX.XXX dev eth0
Note: Replace XXX.XXX.XXX.XXX with your gateway IP.

5) Run the following command to restart your networking, or reboot, and you server should come up working properly with the new IP.

service network restart

Hope this helps someone,
Mike
 
Last edited:
I run my own personal server and am not a linux expert. I am a directadmin customer and if that post were there when I was setting my IP up it would have been helpful. And rebooting never hurts as some software may have issues. Sorry it is not a useful post to you.
 
Back
Top