Centos 配置静态路由
临时配置,重启网卡或系统后失效
route add -net 172.31.0.0 netmask 255.255.248.0 gw 10.33.42.10
永久配置
echo "172.31.0.0/21 via 10.33.42.10 dev em2" >> /etc/sysconfig/network-scripts/route-eno1
route add -net 172.31.0.0 netmask 255.255.248.0 gw 10.33.42.10
echo "172.31.0.0/21 via 10.33.42.10 dev em2" >> /etc/sysconfig/network-scripts/route-eno1