CentOS服务器如何快速绑定多个IP? 其实一个配置文件即可!
在/etc/sysconfig/network-scripts下创建一个range文件
比如,vi /etc/sysconfig/network-scripts/ifcfg-eth0-range0
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:1c:c0:fd:0f:27
IPADDR_START=64.120.228.163
IPADDR_END=64.120.228.166
CLONENUM_START=1
NETMASK=255.255.255.248
ONBOOT=yes
TYPE=Ethernet
CLONENUM_START — 网络克隆接口的启始号. # eg “1″ 生成的网络接口会从 eth0:1开始。
然后重启网络让IP生效: service network restart
NETMASK 子网掩码 参考表:
/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
IP段/28举例: 64.120.220.224/28
The first two IPs (network & gateway) and the last IP (broadcast) in your assignment are unusable for you.
Network: 64.120.220.224
Gateway: 64.120.220.225
Broadcast: 64.120.220.239
Useable IPs: 64.120.220.226-238 (13 useable)
NETMASK = 255.255.255.240
阅读(979) | 评论(0) | 转发(0) |