When we use VPS in the United States, sometimes there will be two IP addresses, some friends SEO needs multiple IP addresses to support, the United States IP address is very cheap, generally a few dollars a month. After installing the system, the service provider usually binds only one IP address. Other IP addresses purchased later must be manually bound. In fact, there are a lot of tutorials in this area, but some of them are complicated. However, today we are going to introduce and learn a method that I personally think is relatively simple, how to bind a single IP address and multiple IP addresses in batch.
1. Add a single IP address. First, open the putty software and connect to the server to log on to the server. Then, enter:
Cd/etc/sysconfig/network-scripts # enter the NIC configuration directory
Cp ifcfg-eth0 ifcfg-eth0: 0 # copy a NIC configuration file
Vi ifcfg-eth0: 0 # edit with vi Editor
After opening it with vi, you can see
DEVICE = eth0: 0 # Add: 0 here, keep consistent with the file name, add multiple IP addresses in turn increase
ONBOOT = yes # activate
BOOTPROTO = static # static IP address. If you need DHCP, enter dhcp.
IPADDR = 192.168.1.2 # change the IP address to be added here
NETMASK = 255.255.255.0 # modify the subnet mask based on your actual situation
After editing is complete, save the settings (press the keyboard I before editing is complete, and then press Esc input: wq to save), restart the NIC to make the settings take effect, or restart the server.
Restart Nic command: service network restart
Restart server command: reboot
As long as the settings are correct, the newly added ip address takes effect after restart.
Check whether the IP address is effective: ifconfig
Ii. IP address disconnection
Add ip segments:
1cd/etc/sysconfig/network-scripts/
Ifcfg-eth0-range0 2vi
DEVICE = eth0
ONBOOT = yes
BOOTPROTO = static
IPADDR_START = 192.168.2.2 # Start IP Address
IPADDR_END = 192.168.2.254 # end IP Address
CLONENUM_START = 1 # indicates that the IP network card number starts from eth0: 1.
NETMASK = 255.255.255.0
After editing, restart the NIC or server as above to check whether the server is successfully edited.
Source: http://www.vpsjy.com/177.html