Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add different IP segments to a single CentOS network card in batch

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the CentOS single network card how to add different IP segments in batches, the article is very detailed, has a certain reference value, interested friends must read it!

Add different IP segments to a single network card in batch

70.39.112.194 add IP:70.39.112.195-222Universe 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, you can see IP:70.39.112.195-222corresponding to the network card number: eth0:0-eth0:27

So add IP in batches, and the network card will start after eth0:28.

The network card eth0 remains unchanged. Create a new file: ifcfg-eth0-range1

+

Vi / etc/sysconfig/network-scripts/ifcfg-eth0-range1 # pay attention to this second 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 change

GATEWAY=70.39.83.225

NETMASK=255.255.255.224

NO_ALIASROUTING=yes

The above is all the content of the article "how to add different IP segments in batches with a single CentOS network card". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report