How do I configure and add IP addresses to my Linux Dedicated Server ?
Posted by - NA -, Last modified by on 21 July 2009 05:29 AM
When your dedicated server is provisioned you are given a block of 8 (or more) ip addresses. On an standard 8 IP block assigned to your server (called a /29 "slash 29" in network lingo, or netmask 255.255.255.248 block of IPs) only 5 can be used by your operating system because of how network routing works (the first IP is called a 'network' address, the next IP is your gateway address, and then the last IP is your broadcast address. So 3 of the IP's you are initialy provisioned used to provide your dedicated server network connection, and the rest of the IP's can be used by your operating system for things like web hosting, email hosting, and more).|
If your server has a control panel such as cPanel, Plesk, ServerCP, etc - you will access the control panel to configure your IP addresses (just click on the link that says 'add ip address').
If you are on a Linux dedicated server, without a control panel, you can configure the additional IP's via the command line (login via SSH as 'root' and edit/create the following files):
For example, your server was assigned the following /29 (8 total IP's)
220.127.116.11 (the 'network' address, you can't use this)
18.104.22.168 (this is the gateway IP, you do not use this either)
22.214.171.124 - this is your server's main IP already configured
126.96.36.199 - this is a usable IP (not yet configured)
188.8.131.52 - this is a usable IP (not yet configured)
184.108.40.206 - this is a usable IP (not yet configured) 220.127.116.11 - this is a usable IP (not yet configured)
18.104.22.168 (the 'broadcast' address, you can't use this)
The server's main IP is configured for you ahead of time in this file:
This file is your main IP for the server, and should NEVER be modified, it should look something like this:
# Intel Corporation 82566DC Gigabit Network Connection DEVICE=eth0 BOOTPROTO=static DHCPCLASS= HWADDR=00:1C:C0:B9:83:5D
Now, as mentioned, on a standard server you get 5 total usable IP's to work with. So to make your server utilize the 4 extra IP's, you need to create the following file:
The file should read something like this:
If you were assigned additional IP blocks to your server, you need to create another 'range' file like this:
The above will create '8' more IP's (for a 2nd /29), and will utilize the server's main gateway/ip addresses so you can actually utilize all 8 IP's on this block.
Finally, to have the server load the new configuration, type:
service network restart &
Be sure to put that "&" at the end of that line, before hitting return, or you may accidenty loose your connection.