[转]centos 绑定单个ip方法和快速批量绑定多个ip方法 |
centos 绑定单个ip方法和快速批量绑定多个ip方法
依次运行命令: 注意:每增加一个ip创建一个文件,如第二个为:cp ifcfg-eth0 ifcfg-eth0:1 ========================================================
然后重启网络让ip生效: service network restart
在/etc/sysconfig/network-scripts下创建一个range文件 比如,vi /etc/sysconfig/network-scripts/ifcfg-eth0-range0 加入以下内容:
device=eth0 ====================================
clonenum_start — 网络克隆接口的启始号. # eg “1″ 生成的网络接口会从 eth0:1开始。 然后重启网络让ip生效: service network restart
/29 (5 usable) netmask = 255.255.255.248 /28 (13 usable) netmask = 255.255.255.240 /27 (29 usable) netmask = 255.255.255.224 /26 (61 usable) netmask = 255.255.255.192 /25 (125 usable) netmask = 255.255.255.128 /24 (253 usable) netmask = 255.255.255.0 |