Home > System Tutorial > LINUX > body text

How to add different IP segments in batches on CentOS single network card?

王林
Release: 2024-01-05 15:40:46
forward
551 people have browsed it

Add different IP segments in batches to a single network card

70.39.112.194 Add IP: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=255.255.255.224

NO_ALIASROUTING=yes

service network restart

After ifconfig, I saw IP:70.39.112.195-222 corresponding network card number: eth0:0-eth0:27,

So when adding IPs in batches, the network card only needs to start from eth0:28 or later,

The network card eth0 remains unchanged, create a new file: ifcfg-eth0-range1

vi /etc/sysconfig/network-scripts/ifcfg-eth0-range1 #Note that this will change the second time

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=static

IPADDR_START=70.39.83.226

IPADDR_END=70.39.83.254

CLONENUM_START=28       #Note that this will change the second time

GATEWAY=70.39.83.225

NETMASK=255.255.255.224

NO_ALIASROUTING=yes

The above is the detailed content of How to add different IP segments in batches on CentOS single network card?. For more information, please follow other related articles on the PHP Chinese website!

source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!