Permanently add static network route
I want to add a static route on my Centos7.5/cPanel v76.0.0 server, this works:
ip route add 192.168.101.0/24 via 192.168.35.1 dev ens224
How do I turn this into a permanent route?
I have tried creating /etc/sysconfig/network-scripts/route-ens224, no joy
-
your method is correct But I tested on one of our own boxes and no joy as well Must be something to do with the private network being on a dumb switch and no real gateway set up (guessing) or that the network manager is messing it up workaround add ip route add 192.168.101.0/24 via 192.168.35.1 dev ens224 to /etc/rc.d/rc.local chmod +x /etc/rc.d/rc.local reboot 0 -
Thanks for chiming in @dalem! @John Schmerold if that suggestion works please let us know! 0 -
yep, that works 0 -
yup. this works, but seems a hacky fix? 0
Please sign in to leave a comment.
Comments
4 comments