How to add multiple IP addresses to CentOS

Source: Internet
Author: User
Next, I will add multiple IP addresses to a friend's machine in the evening. next I will record how to add multiple IP addresses to Centos. if you need to know more, please refer. Log on to SSH: vi/etc/sysconfig/network-scripts/ifcfg-eth0: 0 Second IP, vi/etc/sysconfig/network-scripts/add multiple IP addresses to a friend's machine at night. next I will record how to add multiple IP addresses to Centos, for more information, see references.

Log on to SSH as follows:
Vi/etc/sysconfig/network-scripts/ifcfg-eth0: 0
The second IP address is
Vi/etc/sysconfig/network-scripts/ifcfg-eth0: 1
The third IP address is
Ifcfg-eth0: 2 (and so on)

DEVICE = eth0: 0 Nic DEVICE name
Onboot = YES random start
BOOTPROTO = static IP address allocation
IPADDR = *. * The IP address to be added
NETMASK = 255.255.255.0 subnet mask (subject to actual conditions)
GATEWAY = *. * route

If the IP address is continuous, you can use the following method.
Vi/etc/sysconfig/network-scripts/ifcfg-eth0-range
DEVICE = eth0
BOOTPROTO = static
IPADDR_START = start IP address
IPADDR_END = end IP address
CLONENUM_START = start number of the NIC
NETMASK = subnet mask
ONBOOT = yes

Save the file and restart the network service.

Vi ifcfg-eth0: 2

Enter the following content:
DEVICE = eth0: 2
BOOTPROTO = static
IPADDR = 178.252.202.179
NETMASK = 255.255.255.255.248
ONBOOT = yes

Run the following command to enable the ip address 175.252.202.179.
Ifup eth0: 2

Note:
Variables in the NIC configuration file, such as DEVICE, must be capitalized. To configure different NICs, you only need to modify
DEVICE (DEVICE name) IPADDR (IP address) NETMASK (subnet mask) the three items can be

Related Article

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.