TTEP.CN > 手机 >
双网卡添加路由规则
双网卡添加路由规则
[root@localhost ~]# vi /etc/sysconfig/network-scripts/wtrouter.sh
route del -net 121.101.xxx.xxx netmask 255.255.255.192 dev eth1
route del -net 169.254.0.0 netmask 255.255.0.0 dev eth1
如果需要添加网卡路由,下面添加上
route add -net 172.18.2.0 netmask 255.255.255.0 dev eth0
route add -net 172.18.1.0 netmask 255.255.255.0 dev eth0
记得添加到开机启动里面
vi /etc/rc.d/rc.local
/etc/sysconfig/network-scripts/wtrouter.sh
[root@localhost ~]# vi /etc/sysconfig/network-scripts/wtrouter.sh
route del -net 121.101.xxx.xxx netmask 255.255.255.192 dev eth1
route del -net 169.254.0.0 netmask 255.255.0.0 dev eth1
如果需要添加网卡路由,下面添加上
route add -net 172.18.2.0 netmask 255.255.255.0 dev eth0
route add -net 172.18.1.0 netmask 255.255.255.0 dev eth0
记得添加到开机启动里面
vi /etc/rc.d/rc.local
/etc/sysconfig/network-scripts/wtrouter.sh
- 最近发表
- 赞助商链接