andenker Posted March 2 Share Posted March 2 How can I make a static route persist in Unraid? I have been using "ip route add" in my /boot/config/go, however, it merely runs the command after a reboot. A truly persistent route is more than that. For example, if you unplug the network cable and plug it back in or reboot the router/switch Unraid server is plugged into, the custom routes will be gone. There are other scenarios when this can happen. There should be a way to add the static route to the network subsystem, so that it's re-added during any network events. I've looked into dhcpcd hooks, there is /usr/share/dhcpcd/hooks/ directory. But it didn't work. Looks like it's a stripped down or modified version of dhcpcd. I'm well versed in Linux but not in Slackware particularly. Just by poking around, I see /etc/rc.d/rc.inet1 and rc.inet2 seem to be the scripts handling the networking. I played with those too; they don't re-run in a scenario with unplugged cable as an example. I couldn't find any useful information about how Unraid internals work in regards to networking. Quote Link to comment
sephallen Posted March 3 Share Posted March 3 You can set up some routing via the UI by navigating to: Settings -> Network Settings and scrolling down to the "Routing Table" section at the bottom. I'm not sure if this will fit your needs though! Quote Link to comment
andenker Posted March 4 Author Share Posted March 4 I wish it were that simple... The UI configuration doesn't save routes anywhere, it's just in-memory. It won't survive a reboot or other scenarios I described. After posting this, I looked at the issue from a different angle. I used DHCP option 121 on my MikroTik router to supply the static route to Unraid via DHCP. Worked flawlessly. I actually like this approach better since the routing stuff belongs to, well, a router. Still, there must be a way to do this in Unraid. Not everyone has an advanced router. It's not only about static routes either, I can see a need to run a custom script on Unraid server whenever the network connection goes down or up. Quote Link to comment
sephallen Posted March 4 Share Posted March 4 6 hours ago, andenker said: After posting this, I looked at the issue from a different angle. I used DHCP option 121 on my MikroTik router to supply the static route to Unraid via DHCP. Worked flawlessly. I actually like this approach better since the routing stuff belongs to, well, a router. I like this solution a lot - I too have a MikroTik router, I think I will need to have a play around with this! 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.