1. 查看
route -n
2. 添加
route add -net 9.123.0.0 netmask 255.255.0.0 gw 9.123.0.1
3. 删除
route del -net 9.123.0.0 netmask 255.255.0.0 gw 9.123.0.1
有些童鞋问怎么加永久路由,很简单,把 “route add -net 9.123.0.0 netmask 255.255.0.0 gw 9.123.0.1” 写到/etc/rc.local最后就行了,
或者复制编辑好执行也可以:
echo “route add -net 9.123.0.0 netmask 255.255.0.0 gw 9.123.0.1” >> /etc/rc.local
实际中发现,CentOS7.4默认环境下,rc.local中不会执行,需要赋权才可以
chmod +x /etc/rc.local
http://www.cppblog.com/isware/archive/2011/06/01/147825.aspx