静态路由配置
ubuntu
sudo gedit /etc/network/interfaces
*********************************
auto eth0
iface eth0 inet static
address 192.168.0.30
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
up route add -net 192.168.1.0 netmask 255.255.255.0 eth1
*********************************
重启网络配置
sudo /etc/init.d/networking restart
ubuntu
sudo gedit /etc/network/interfaces
*********************************
auto eth0
iface eth0 inet static
address 192.168.0.30
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
up route add -net 192.168.1.0 netmask 255.255.255.0 eth1
*********************************
重启网络配置
sudo /etc/init.d/networking restart