ubuntu系统下,多网卡配置方法:
系统版本:ubuntu16.04
本机有4块网卡,如下表:
网卡名称 | IP地址 | 子网掩码 | 网关 |
eth0 | 192.168.0.18 | 255.255.255.0 | 192.168.0.1 |
eth1 | 192.168.10.101 | 255.255.255.0 | 192.168.10.1 |
eth2 | 192.168.20.10 | 255.255.255.0 | 192.168.20.1 |
eth3 | 10.10.1.100 | 255.255.255.0 | 10.10.1.1 |
首先在终端命令行下输入:
vim /etc/network/interfaces
在终端中进行配置各个网卡的ip地址及子网掩码,进入后按键盘上的a才能进行编辑,如图:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static