Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

(Solved) Routing Table Persistence (Lack Of)

Featured Replies

The custom routes I enter in the routing table do no persist a reboot. Is there a way to make them stick?

Edited by surfshack66

  • Author

Does anyone have some advice for this issue?

Let me preface this by saying i know exactly 0 about routing tables in linux and how they are modified.

 

Since the unRAID OS runs in ram and is unpacked fresh from the USB drive on boot, changes that you make to the underlying linux system at runtime do not persist. The only things that do persist across reboot are those things that the unraid GUI / Config files allow you to tweak. With that said I dont know one way or the other whether unRAID has a configuration option for static routes, but if you have looked and not found it then possibly not. In that case your only choice is to re-make the changes on every boot. I would suggest writing a script that makes the changes and then run it on startup using the CA User Scripts plugin.

2 hours ago, surfshack66 said:

Does anyone have some advice for this issue?

 

Did you even check the network settings? You can add routes there. 

  • Author
9 minutes ago, saarg said:

 

Did you even check the network settings? You can add routes there. 

Yes. I add the custom routes in the network settings page. They do not persist after rebooting. Is that normal? I figured they would persist.

I think you can add them to the go file on flash drive

3 hours ago, surfshack66 said:

Yes. I add the custom routes in the network settings page. They do not persist after rebooting. Is that normal? I figured they would persist.

 

Then it's either a bug or @bonienl made it like that for a reason. 

You can definitely do this,

Any commands you want to run after a reboot can be put in /boot/config/go

The server will run the go script at startup. There's obviously another few ways to achieve - like the CA User Scripts idea above.

You can modify the routing table directly via commands such as:

ip route add 192.168.0.0/16 via 192.168.1.111

I'm not at my machine right now but I believe you can also use files with the name route-eth# to define routes for an interface - should be placed at /etc/sysconfig/network-scripts/

So you could make a file called route-eth0 - put your desired routes in it - save to /boot/config/route-eth0 and in your go file just copy the file into place. However, you'd need to check if this worked after a reboot because the network might need cycling afterwards. The commands route or ip r might help too.

 

 

  • Author
8 hours ago, primeval_god said:

The only things that do persist across reboot are those things that the unraid GUI / Config files allow you to tweak. 

Maybe this is a bug then? The changes are made on the Network Settings page of the GUI. It's nice being able to add them there, the only issue is they don't persist.

 

Perhaps someone from unraid can confirm if this is a bug or could be a feature request...

 

EDIT: Also thanks to everyone for the help so far

Edited by surfshack66

14 hours ago, surfshack66 said:

I add the custom routes in the network settings page. They do not persist after rebooting. Is that normal?

Yes, this is normal

When adding custom routes they are only stored in RAM. Rebooting the system clears these custom routes.

To make them persistent the equivalent 'ip' commands need to be executed upon a reboot. One way to do this is using the custom scripts plugin.

  • Author

Thanks @bonienl

 

I'll use the custom scripts plugin with the command @Delarius mentioned.

 

Does the attached script look right? Currently, the custom routes entered in the GUI are associated with the gateway name, i.e. br0.10. Does that need to be included in the script as well?

 

 

Capture.JPG

Capture2.JPG

  • brickfireio changed the title to Routing Table Persistence (Lack Of)
  • Author
On 9/25/2018 at 5:40 PM, Delarius said:

You can definitely do this,

Any commands you want to run after a reboot can be put in /boot/config/go

The server will run the go script at startup. There's obviously another few ways to achieve - like the CA User Scripts idea above.

You can modify the routing table directly via commands such as:


ip route add 192.168.0.0/16 via 192.168.1.111

I'm not at my machine right now but I believe you can also use files with the name route-eth# to define routes for an interface - should be placed at /etc/sysconfig/network-scripts/

So you could make a file called route-eth0 - put your desired routes in it - save to /boot/config/route-eth0 and in your go file just copy the file into place. However, you'd need to check if this worked after a reboot because the network might need cycling afterwards. The commands route or ip r might help too.

 

 

The command doesn't seem to work properly.

I receive the following message:

 

Error: Nexthop has invalid gateway.

3 hours ago, surfshack66 said:

Error: Nexthop has invalid gateway.

Your gateway (192.168.1.111) must be part of a known network. I.e. 192.168.1.x/24 must exist.

  • Author
1 hour ago, bonienl said:

Your gateway (192.168.1.111) must be part of a known network. I.e. 192.168.1.x/24 must exist.

Sorry for the confusion. The gateway you mentioned was an example fro @Delarius.

 

My specific script is attached above, but I can attach another copy.

All of these networks exist..

 

Capture.thumb.JPG.111abf0a480ef98349c001342dac51ca.JPG

1 minute ago, surfshack66 said:

All of these networks exist..

What is the output of

ip route show

 

  • Author
18 minutes ago, bonienl said:

What is the output of


ip route show

 

Linux 4.18.14-unRAID.
Last login: Sun Oct 14 14:10:34 -0400 2018 on /dev/pts/2.
root@Tower:~# ip route show
default via 192.168.1.1 dev br0 proto dhcp src 192.168.1.2 metric 218
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
192.168.1.0/24 dev br0 proto dhcp scope link src 192.168.1.2 metric 218
192.168.20.0/24 dev br0.20 scope link metric 1
192.168.70.0/24 dev br0.70 scope link metric 1
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1

I had to manually add 192.168.20.0 and 192.168.70.0 via the Network Settings page.

Add a network by doing something like this

ip route add 192.168.10.0/24 dev br0.10

 

  • Author
3 minutes ago, bonienl said:

Add a network by doing something like this


ip route add 192.168.10.0/24 dev br0.10

 

Thank you! That worked

  • brickfireio changed the title to (Solved) Routing Table Persistence (Lack Of)
  • 4 years later...

it would be great if you could permanently save gateway / route changes in the gui
why else do i have a menu item network if something like this is not saved

  • 1 year later...

At the very least it should have a notice that they are not persistent. I just found this out the hard way and my search led me hear to a 5 year old post.

  • 1 year later...

How can this be marked "Solved"? The solution here is one of:

  1. Changes via the GUI are persisted

  2. A very big notice on the Network settings page saying "Changes to the routing table will not persist across reboots.".

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.