Get the App
SLTechnology News&Howtos  ›  Servers  › 

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

Shulou Source: shulou.com Published: 2022-06-01 23:37:54 10月15日 Update

This article shows you how to add different IP segments to the CentOS single network card, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

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 how to add different IP segments to the CentOS single network card. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Network card different content skills knowledge concise concise card number that is documents articles more articles industry information channels channels one bright reserve Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Tech Info Linux MySQL macOS