Web Hosting Talk







View Full Version : How do you add IPs to a server


Wilbo
10-16-2002, 11:18 PM
I just bought my own server and am going to send it to a datacenter for a colo deal. The datacenter said they will give me the IP block ( 10 numbers ) and I have to configure the machine so that all they have to do is plug the machine in and connect it to the net. I know how to do this with webmin, but I will have to do this via the command line I guess. So my question is how do I do this? I really only have to add 1 ip, then when it gets connected to the net I can install webmin and input the rest of them.

OllieVH
10-16-2002, 11:34 PM
Assuming your network connection is labeled eth0, you can edit the following file to add the IP, Subnet Mask, Gateway, Broadcast, Network, and boot protoco:

/etc/sysconfig/network-scripts/ifcfg-eth0

You can add your name server info at:

/etc/resolv.conf

From there, I agree, bring the server up via the network and add the rest via webmin, it is a lot less painfull :)

This info is based on a RedHat distro.

Wilbo
10-16-2002, 11:49 PM
Thanks OllieVH, that was just the answer I was looking for :-)

bitserve
10-17-2002, 09:19 PM
I think on Red Hat, your gateway will actually go in /etc/sysconfig/network.

Your nameservers would go in /etc/resolv.conf and not /etc/hosts.

You'll need to use ifconfig to set the IP addresses, and then you can store the settings in /etc/sysconfig/network-scripts so that they are readded during reboot.

Of course you didn't say which OS you're using. It might be easier to refer to the manual. I think that Red Hat Linux's manual covers this initial configuration type stuff in good detail.

OllieVH
10-18-2002, 12:25 AM
Originally posted by bitserve
I think on Red Hat, your gateway will actually go in /etc/sysconfig/network.

Your nameservers would go in /etc/resolv.conf and not /etc/hosts.

You'll need to use ifconfig to set the IP addresses, and then you can store the settings in /etc/sysconfig/network-scripts so that they are readded during reboot.

Of course you didn't say which OS you're using. It might be easier to refer to the manual. I think that Red Hat Linux's manual covers this initial configuration type stuff in good detail.

Thanks for pointing that out, I didn't even realize I typed the wrong thing until now, that is the second time today I did that. Gateway is not in the /network-scripts as I wrote earlier, and i goofed with the /etc/resolv.conf part too. I need to check my posts more closely. RTFM is definetely a good suggestion. Using ifconfig is correct also. The way I did it was quick and dirty to get his IP address added since RH most likely did the ifconfig on the install and bound something to eth0. Regardless, from his reply it seems to have worked. Thanks for pointing out my mistake, I can't believe I made such a newbie mistake. Heh.. Oh well, it happens to all of us.

bitserve
10-18-2002, 08:10 PM
Agreed, the installer should do most of this.

Wilbo
10-18-2002, 10:34 PM
Well it didn't work yet, the server hasn't arrived. Thank you all for replying, I'm sure I'll be able to do it next week when I get my hands on the server.

Netbridge
10-19-2002, 06:39 AM
Wilbo,


What control panel will you be running on it?

Wilbo
10-19-2002, 09:18 AM
Webmin, but I have to just get one IP in before I ship it so they can connect it to the net and I can get to it via ssh to configure the rest. I've never even seen a server in person before much less loaded the OS and configured it. I've gotten servers from Rackshack and Unitedcolo before, but they already had the OS and IP# installed. I'm looking forward to this as a learning experience.