LATEST HA CORE!
I have a custom Shell_Command (Below) which executes via HA startup automation and sets a custom ROUTE to another VLAN. Everything works as expected until the unexpected after a 4-5 days the custom route disappears. Nothing in the LOGS and nothing was restarted that I am aware of.
This happens on both my development and production servers, one on RPI-3b and another on RPI 5, both systems have the latest versions of CORE and up to date on all installed addons and intigrations.
My PING automation catches the issues, and I configured that automation to re-run the Shell Script for now as a work around.
I am sure not to many people use this for adding routes, but I would like to hear from you if your experiencing something similar, or have any thoughts why the Routes would be reset.
Regards,
Bill
shell_command:
condolan: ‘ip route add 192.168.1.0/24 via 192.168.0.203 metric 600’
How is this related to HA at all? Sounds like a firewall issue or router…
Also segmented networks are not officially supported within HA.
HA is designed and expects a flat subnet to work as intended.
This is because every segmented network is different for IP’s and number of segments and firewalls and sharing rules and about 650495849085 other things.
This does not mean you can’t use them or that they can’t be made to work, it means that to get them working you are the support structure on your own subnet(s). Consider it Advanced mode…
Thanks for you reply.
It’s a HA problem because the IP Route is added in HAOS using shell command in configuration.yaml, works fine till it intermittently disappears for no reason. Very odd for linux to drop a route once its configured.
Hi Bill,
I have exactly the same behaviour (I’m also using hassio). It’s very frustrating and I agree…odd.
I’ve looked at post using nmcli via the ssh & web terminal add-on (yes the right one with protection mode). That post indicated running in protection mode allows you to access nmcli but I couldn’t get it to work.
When I’m able I’ll try using nmcli from the pi4 itself.
Just an FYI, nmcli was removed from the advanced ssh & web terminal last year…
BTW, about the only thing that comes to mind as to why a static route would disappear on its own is maybe when the device interface it uses goes down. The route as a minimum would have to be marked as stale/unusable, but I suspect it is removed when it goes down and when the interface comes backup, there is nothing to reinstall it. Also, if I remember correctly, using iproute does not persist, so a restart of the OS would remove it but I doubt that is the case here since the OP sets the route on HA startup. However using nmcli should make it persist. If you can get to the console port of the Pi or have setup HA to use ssh with port 22222 then you should be able to use nmcli.
Thanks for the reply.
I can confirm I was able to setup using nmcli from the console. I couldn’t access nmcli using ssh & web terminal even in protected mode so you were spot on that must have been removed.
Hopefully this will help anyone else who gets stuck on this.