当前位置: > CentOS > CentOS入门 >

centos 7 添加永久静态路由

时间:2017-03-28 00:13来源:linux.it.net.cn 作者:IT
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 (责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容