linux – 试图了解在CentOS中创建静态路由的正确方法,请协助
|
我一直试图了解在CentOS 6.x机器上添加静态路由的正确方法是什么.
192.168.20.0/24 via 192.168.20.253 dev eth0 提前致谢 解决方法使用/ etc / sysconfig / network-scripts / route-device文件定义的RH样式设备相关路由导致了许多问题.所以真正的系统管理员只使用没有设备依赖的/ etc / sysconfig / static-routes文件: any net 10.0.0.0 netmask 255.255.255.0 gw 192.168.0.1 问题: >当物理设备被绑定时,您还需要记住路由设备文件 当然应该总是使用桥接设备,因此可以避免路由设备文件问题. 还要注意/ etc / sysconfig / static-routes文件中的语法,来自的sniplet # Add non interface-specific static-routes.
if [ -f /etc/sysconfig/static-routes ]; then
if [ -x /sbin/route ]; then
grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do
/sbin/route add -$args
done
else
net_log $"Legacy static-route support not available: /sbin/route not found"
fi
fi (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
