知識庫
客戶系統 > 知識庫 > Ascend Servers > Dedicated Server Support > Linux OS Based Articles > How do i Bind my Additional IPs?
How do i Bind my Additional IPs?
These instructions are for CentOS / Fedora specifically.
By default, Citadel Servers only binds your first primary IP address. This is because there are different methods of applying your additional IPs that may require that they not be bound originally.
Below we show two methods of binding IP addresses to your server.
Method one: Editing the eth adaptor file
By default the main ip (Primary eth adaptor) for your server is stored in:
/etc/sysconfig/network-scripts/ifcfg-eth0
To add additional IPs to your server you need to increment the end of this file from eth0 to eth1 per addtional eth adaptor. Here are some examples:
Your primary IP\First IP would remain as:
/etc/sysconfig/network-scripts/ifcfg-eth0
So your Secondary\1st additional IP set would be:
/etc/sysconfig/network-scripts/ifcfg-eth0:0
So your 4rd IP set would be:
/etc/sysconfig/network-scripts/ifcfg-eth0:3
This will allow you to add a an additional IP address to your server. In this example we will add a 2nd additional IP to the server.
In this example we will use the default linux editor, VI.
This will copy the file ending with eth0 to a new file ending with (eth0:1)
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1
We will now open the newly created file with the VI text editor:
vi /etc/sysconfig/network-scripts/ifcfg-eth0:1
You should see the text below. Edit your IP address, netmask and gateway and increment the Device field to match file name (eth0:1 in this example)
Press the insert button on your keyboard to type.
DEVICE="eth0:1"
BOOTPROTO="static"
IPADDR="IP.FAIL.OVER"
NETMASK="255.255.255.255"
ONBOOT="yes"
BROADCAST="IP.FAIL.OVER"
DNS1=192.99.37.204
DNS2=192.99.37.205
Press Esc then type :wq
Restart the network service
/etc/init.d/network restart
type ifconfig to make sure it is all set correctly.
You should now be able to ping the outside world
ping citadelservers.com
Method two: Using Grep
Find out which interface is your public
1
2
|
[root@CS-D####~]#route|grep -v"10."|grep -m1"255.255"|awk'{ print $8 }'
eth1
|
This shows that my public interface (does not have a “10.” address) is eth1.
2) Create the route file
Before running the command below, change “eth1” to your public interface from step 1 and set your START and END IP addresses in the range.
Note:Your IPADDR_START should be your second usable IP as your primary is already bound. The IPADDR_END value is your last usable IP. If you are unsure what these values are please check your welcome e-mail or open a support ticket.
1
2
3
|
echo "IPADDR_START=123.123.123.4
IPADDR_END=123.123.123.5
CLONENUM_START=0">>/etc/sysconfig/network-scripts/ifcfg-eth1-range0
|
3) Restart your network interface
1
|
servicenetworkrestart
|