CentOS Configuration IP Address How to add multiple IP addresses

Source: Internet
Author: User

To do this, log in to SSH:

Vi/etc/sysconfig/network-scripts/ifcfg-eth0:0

The second IP is a

Vi/etc/sysconfig/network-scripts/ifcfg-eth0:1

A third IP is the
Ifcfg-eth0:2 (from this analogy)

Device=eth0:0  NIC device name Onboot=YES random start Bootproto=  static statically assigned ipipaddr=*.* . * * the IP address to add netmask=255.255. 255.0 Subnet Mask (subject to actual) GATEWAY=*.*.*.* Routing

If the IP is contiguous, you can use the following method.

vi/etc/sysconfig/network-scripts/ifcfg-eth0-Rangedevice=Eth0bootproto=static  Ipaddr_start= start ipipaddr_end= end Ipclonenum_start= network card start number netmask= Subnet Mask onboot =yes

Saving the file and then restarting the Network service takes effect.

The following is the Ubuntu

192.168. 0.2 255.255. 255.0 ifconfig add eth0: 1 192.168. 0.2 255.255. 255.0 ifconfig add eth0: 2 192.168. 0.2 255.255. 255.0 where Eth0:1 and Eth0:2 are the two IPs added. You must join the startup item after it is added, or the virtual add IP will be lost after the reboot. Add the above command to:/etc/rc.d/rc.local.

How to add multiple IP addresses to the CentOS configuration IP address

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.