centos 7 添加永久静态路由

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos 7 添加永久静态路由相关的知识,希望对你有一定的参考价值。

cat /etc/sysconfig/static-route 

any net 10.0.0.0/24 gw 192.168.1.2


注:默认情况下主机中并没有该文件,之所以可以是因为/etc/init.d/network启动脚本会调用该文件,具体调用部分代码如下:

# Add non interface-specific static-routes.
if [ -f /etc/sysconfig/static-routes ]; then
grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do
/sbin/route add -$args
done
fi


以上是关于centos 7 添加永久静态路由的主要内容,如果未能解决你的问题,请参考以下文章

linux下永久添加静态路由

Windows手动添加静态路由

WIN2008添加永久静态路由方法

Linux添加永久静态路由信息

Windows 添加永久静态路由

Windows操作系统添加永久静态路由