Default route disappears after every reboot

I have CentOS installed on multiple Linodes running FreePBX. Every time I reboot the Linode, I lose the default route and I have to program it. Does anybody have a fix to make the default route permanent?

The command is:
route add default gw (IP-Address-of-gateway) eth0

2 Replies

I have this in /etc/networks/interfaces:

iface eth0 inet static
    address <redacted>
    gateway <redacted>

I believe this is explained by this guide:

https://www.linode.com/docs/guides/network-helper/

-- sw

In my list of Linodes, when I click on the ellipses, I do not see SETTINGS.

I changed the settings in the Configuration Pane to ENABLE Auto-Configure Networking, but that did not help.

The contents of /etc/sysconfig/network-scripts/ifcfg-eth0 show some variables in the for of: VAR="value". Which VAR do I use for default V4 Gateway?

Thank you kindly.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct