How to add/Bind IP addresses to/from a single Nic In CentOS on Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.