歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

Linux系統單網卡批量添加不同IP

單網卡批量添加不同IP段
70.39.112.194 添加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

ifconfig 後 看到 IP:70.39.112.195-222 對應網卡號:eth0:0-eth0:27,
所以再批量添加IP,網卡從eth0:28以後開始就行,
網卡eth0不變,創建新文件:ifcfg-eth0-range1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
vi /etc/sysconfig/network-scripts/ifcfg-eth0-range1 #注意這個第二次要變

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR_START=70.39.83.226
IPADDR_END=70.39.83.254
CLONENUM_START=28 #注意這個第二次要變
GATEWAY=70.39.83.225
NETMASK=255.255.255.224
NO_ALIASROUTING=yes

Copyright © Linux教程網 All Rights Reserved