surfshack66 Posted September 19, 2018 Share Posted September 19, 2018 (edited) The custom routes I enter in the routing table do no persist a reboot. Is there a way to make them stick? Edited September 24, 2018 by surfshack66 Quote Link to comment
surfshack66 Posted September 25, 2018 Author Share Posted September 25, 2018 Does anyone have some advice for this issue? Quote Link to comment
primeval_god Posted September 25, 2018 Share Posted September 25, 2018 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. Quote Link to comment
saarg Posted September 25, 2018 Share Posted September 25, 2018 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. Quote Link to comment
surfshack66 Posted September 25, 2018 Author Share Posted September 25, 2018 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. Quote Link to comment
xman111 Posted September 25, 2018 Share Posted September 25, 2018 I think you can add them to the go file on flash drive Quote Link to comment
saarg Posted September 25, 2018 Share Posted September 25, 2018 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. Quote Link to comment
Delarius Posted September 25, 2018 Share Posted September 25, 2018 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. Quote Link to comment
surfshack66 Posted September 26, 2018 Author Share Posted September 26, 2018 (edited) 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 September 26, 2018 by surfshack66 Quote Link to comment
bonienl Posted September 26, 2018 Share Posted September 26, 2018 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. 1 Quote Link to comment
surfshack66 Posted September 26, 2018 Author Share Posted September 26, 2018 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? Quote Link to comment
surfshack66 Posted October 15, 2018 Author Share Posted October 15, 2018 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. Quote Link to comment
bonienl Posted October 15, 2018 Share Posted October 15, 2018 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. Quote Link to comment
surfshack66 Posted October 15, 2018 Author Share Posted October 15, 2018 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.. Quote Link to comment
bonienl Posted October 15, 2018 Share Posted October 15, 2018 1 minute ago, surfshack66 said: All of these networks exist.. What is the output of ip route show Quote Link to comment
surfshack66 Posted October 15, 2018 Author Share Posted October 15, 2018 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. Quote Link to comment
bonienl Posted October 15, 2018 Share Posted October 15, 2018 Add a network by doing something like this ip route add 192.168.10.0/24 dev br0.10 Quote Link to comment
surfshack66 Posted October 15, 2018 Author Share Posted October 15, 2018 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 1 Quote Link to comment
igi Posted February 5, 2023 Share Posted February 5, 2023 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 Quote Link to comment
Recommended Posts
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.