ubuntu 單網(wǎng)卡雙 ip
局域網(wǎng)一套物理網(wǎng)絡(luò)里有兩個(gè) ip 段,單網(wǎng)卡設(shè)置多 ip 可實(shí)現(xiàn)同時(shí)訪問(wèn)兩個(gè)網(wǎng)段。
$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto eth0
iface eth0 inet static
address 192.168.9.250
gateway 192.168.9.1
netmask 255.255.255.0
auto eth0:1
iface eth0:1 inet dhcp
啟用添加 的 ip
sudo ifup eth0:1
以上設(shè)置兩個(gè) ip,其中一個(gè)靜態(tài),另一個(gè) dhcp 獲取。

浙公網(wǎng)安備 33010602011771號(hào)