Add a single IP to CentOS (Linux) and add multiple IP local methods in bulk

Source: Internet
Author: User

One, add a single IP address:

In/etc/sysconfig/network-s/, the new file ifcfg-eth0:*,* is a numeric ordinal, and multiple IPs are incremented
Take 0 As an example to establish a file ifcfg-eth0:0

cd/etc/sysconfig/network-s/
VI ifcfg-eth0:0

Input content format:

device=eth0:0
Type=ethernet
Onboot=yes
Bootproto=static
Ipaddr= to add the IP address of the binding
netmask= Subnet Mask
gateway= Gateway Address

Second, batch add multiple IP address:
Create a new file in/etc/sysconfig/network-s/ifcfg-eth0-range0

Vi/etc/sysconfig/network-s/ifcfg-eth0-range0

Enter the following file content format:

Device=eth0
Onboot=yes
Bootproto=static
ipaddr_start= Start IP Address
ipaddr_end= End IP Address
Clonenum_start=0
gateway= Gateway Address
netmask= Subnet Mask
No_aliasrouting=yes

Once saved, run the service network restart to restart the Web services!

Jiangsu Three AI Network Technology Co., Ltd.

Add a single IP to CentOS (Linux) and add multiple IP local methods in bulk

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.