Linux CentOS single NIC binding multi-IP method

Source: Internet
Author: User
Tags centos

Suppose that the NIC that needs to bind multiple IP is eth0, please create a file named ifcfg-eth0:0 in the/etc/sysconfig/network-scripts directory.


Examples of the content are:
Device= "eth0:0"
Nm_controlled= "Yes"
onboot= "Yes"
Ipaddr= "112.100.103.168"
Bootproto= "None"
netmask= "255.255.255.0"
Type= "Ethernet"
Gateway= "112.100.103.129"
dns1=168.100.63.1


If you want to be simpler, you can


cp/etc/sysconfig/network-scripts/eth0/etc/sysconfig/network-scripts/eth0:0


Where the device is the name of the device,
IPADDR the IP address of this device,
Broadcast is the broadcast address,
Netmask is a subnet mask,
Onboot means to start automatically when the system starts.
If you need to bind more than one IP address,
Just add a eth0:x to the file name and the device in the file.
Linux can support up to 255 IP aliases


Make sure you restart the network after the change is complete.


/etc/init.d/networking restart

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.