首页 > 系统 > CentOS > 正文

CentOS单网卡如何批量添加不同IP段?

2020-07-08 12:42:25
字体:
来源:转载
供稿:网友

单网卡批量添加不同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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表