一个网卡设置多个IP
时间:2009-06-20 来源:djstava
以ubuntu系统为例,其它的也类似,centos是以单独的配置文件进行设置。
vi /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.0.179
netmask 255.255.255.0
gateway 192.168.0.1
auto eth0
iface eth0:0 inet static
address 192.168.12.179
netmask 255.255.255.0
auto eth0:0
按eth0:0,eth0:1...,你可以设置任意多个IP。
vi /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.0.179
netmask 255.255.255.0
gateway 192.168.0.1
auto eth0
iface eth0:0 inet static
address 192.168.12.179
netmask 255.255.255.0
auto eth0:0
按eth0:0,eth0:1...,你可以设置任意多个IP。
相关阅读 更多 +