linux配置双网卡IP地址

配置双网卡IP地址

sudo vim /etc/network/interfaces

打开网络的配置文件,修改对应的eth0(外网) 与eth1(内网)的内容,格式如下:

auto eth0
iface eth0 inet static
address 124.115.x.x
netmask 255.255.255.0
#broadcast 192.168.16.255
gateway 124.115.x.x


auto eth1
iface eth1 inet static
address 192.168.1.x
netmask 255.255.255.0
#broadcast 192.168.16.255

保存退出后,为使配置生效
sudo /etc/init.d/networking restart

你可能感兴趣的:(linux配置双网卡IP地址)