作者: reistlin
来源: http://www.reistlin.com/blog/390
更新时间: 2012.10
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

redhat.png

troubleshooting_ip_routing.png

一,新建路由表 wan 和 lan

vim /etc/iproute2/rt_tables

255     local
254     main
253     default
252     wan
251     lan

二,配置路由表 wan 和 lan

vim /etc/rc.local

ip route add 202.0.0.64/26 via 202.0.0.66 dev eth1 table wan
ip route add default via 202.0.0.65 dev eth1 table wan
ip rule add from 202.0.0.66 table wan

ip route add 10.0.0.0/24 via 10.0.0.2 dev eth0 table lan
ip route add default via 10.0.0.1 dev eth0 table lan
ip rule add from 10.0.0.2 table lan

三,路由表更新缓存,立即生效

ip route flush cache

标签: redhat, linux