linux 如何绑定一个ip地址?

如题所述

一块网卡如何绑定两个ip(linuxloveu)
#cd /etc/sysconfig/network-scripts
#cp ifcfg-eth0 ifcfg-eth0:1
#vi ifcfg-eth0:1
修改IP和设备名
Debian下一个网卡绑定多个ip的方法(NetDC)
修改/etc/network/interfaces
auto eth0
iface eth0 inet static
address 172.16.3.123
netmask 255.255.255.0
network 172.16.3.0
broadcast 172.16.3.255
gateway 172.16.3.1

auto eth0:1
iface eth0:1 inet static
address 10.16.3.123
netmask 255.255.0.0
network 10.16.0.0
broadcast 10.16.255.255
修改/etc/network/ifstate
lo=lo
eth0=eth0
eth0:1=eth0:1
然后/etc/init.d/networking restart就可以了。
一个网卡绑定多ip另一法
在/etc/sysconfig/network-scripts/下创建一个文件:ifcfg-ethX-rangeX ("X"为网卡号)
文件内容:
IPADDR_START=
IPADDR_END=
CLONENUM=0
可以有256个ip
温馨提示:答案为网友推荐,仅供参考
第1个回答  2021-01-24

第2个回答  2014-11-01
Gps
相似回答