linux双网卡路由转发 linux添加路由指令到指定的网卡?

linux添加路由指令到指定的网卡?方法如下:1:使用route命令添加路由机器重启或网卡重启后,用route命令添加的路由将无效。方法://route add to the host#route a

linux添加路由指令到指定的网卡?

方法如下:

1:使用route命令添加路由

机器重启或网卡重启后,用route命令添加的路由将无效。方法:

//route add to the host

#route add–host 192.168.1.11 dev eth0

#route add–host 192.168.1.12 GW 192.168.1.1

//路由添加到网络

#route add–net 192.168.1.11 netmask 255.255.255.0 eth0

#route add–net 192.168.1.11 netmask 255.255.255.0 GW 192.168.1.1

#routeadd–net 192.168.1.0/24 eth1

//添加默认网关

#route add default gw 192.168.2.1

//删除路由

#route del–host 192.168.1.11 dev eth0