Debian系统绑定多个IP地址

 

1.查看系统上的网络接口:

ifconfig -a

2.修改网络配置文件:

vi /etc/network/interfaces

3.在该文件中添加如下内容,其中 eth0 为网络接口名称,192.168.1.10 和 192.168.1.11 是要绑定的两个 IP 地址:

auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
up /sbin/ifconfig eth0:0 192.168.1.11 netmask 255.255.255.0

4.重新启动网络:

/etc/init.d/networking restart

5.检查绑定的 IP 地址:

ifconfig -a

仅适用于 Debian 系列的 Linux 系统。如果您使用的是其他 Linux 发行版,您可能需要按照其他步骤操作。