Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Permanently add static network route

Discussion in 'Bind/DNS/Nameserver' started by John Schmerold, Oct 19, 2018.

  1. John Schmerold

    John Schmerold Well-Known Member

    Joined:
    Apr 21, 2004
    Messages:
    74
    Likes Received:
    5
    Trophy Points:
    158
    Location:
    st. louis
    cPanel Access Level:
    Root Administrator
    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
     
  2. dalem

    dalem Well-Known Member PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,909
    Likes Received:
    127
    Trophy Points:
    368
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    cPanelLauren and John Schmerold like this.
  3. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,456
    Likes Received:
    503
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. John Schmerold

    John Schmerold Well-Known Member

    Joined:
    Apr 21, 2004
    Messages:
    74
    Likes Received:
    5
    Trophy Points:
    158
    Location:
    st. louis
    cPanel Access Level:
    Root Administrator
    yep, that works
     
    cPanelLauren likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice