红联Linux门户
Linux帮助

ubuntu 15.10配置网卡和路由

发布时间:2016-01-23 15:02:31来源:linux网站作者:alantop

手动设置服务器的路由:

route add -net 192.168.4.0/24 gw 192.168.4.1 dev eth0


注意:手动添加的路由,服务器重启后不生效;可以把上面的语句添加到开机自启动文件中/etc/rc.local;


vim /etc/network/interfaces

root@ks-desktop:/etc/network# vim /etc/network/interfaces
root@ks-desktop:/etc/network# vim /etc/network/interfaces

auto eth0
iface eth0 inet static
address 61.129.111.222
netmask 255.255.255.248
gateway 61.129.111.221

auto eth1
iface eth1 inet static
address 192.168.10.144
netmask 255.255.255.0
gateway 192.168.10.254


本文永久更新地址:http://www.linuxdiyf.com/linux/17598.html