Add multiple IP segments to a single network card in CentOS

Source: Internet
Author: User

Add multiple IP segments to a single network card in CentOS

Batch add different IP segments for a single Nic
Add IP address 70.39.112.194: 70.39.112.195-222/70. 39.83.226-254

Vi/etc/sysconfig/network-scripts/ifcfg-eth0-range0
DEVICE = eth0
ONBOOT = yes
BOOTPROTO = static
IPADDR_START = 70.39.112.195
IPADDR_END = 70.39.112.222
CLONENUM_START = 0
GATEWAY = 70.39.112.193
NETMASK = zookeeper
NO_ALIASROUTING = yes

Servicenetworkrestart

After ifconfig, the IP address 70.39.112.195-222 corresponds to the nic id: eth0: 0-eth0: 27,
Therefore, add IP addresses in batches. The NIC will start from eth0: 28 and later,
Nic eth0 unchanged, create new file: ifcfg-eth0-range1
++ ++
Vi/etc/sysconfig/network-scripts/ifcfg-eth0-range1 # Note this second minor change

DEVICE = eth0
ONBOOT = yes
BOOTPROTO = static
IPADDR_START = 70.39.83.226
IPADDR_END = 70.39.83.254
CLONENUM_START = 28 # Pay attention to the second minor change
GATEWAY = 70.39.83.225
NETMASK = zookeeper
NO_ALIASROUTING = yes

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.