Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routing loop due to ignoring linkdown #111

Closed
DanielG opened this issue Oct 27, 2023 · 3 comments
Closed

routing loop due to ignoring linkdown #111

DanielG opened this issue Oct 27, 2023 · 3 comments

Comments

@DanielG
Copy link
Contributor

DanielG commented Oct 27, 2023

Hi Juliusz,

here's a routing loop I just ran into. I have sysctl net.ipv6.conf.all.ignore_routes_with_linkdown=1 on my router this is to ignore routes via interfaces that are down at the link level (but administratively up).

babeld doesn't seem to know about this kernel feature so it will export routes which are ignored by the kernel. In my case this caused a routing loop. babeld exports a specific route, say /64, another router will use this route to send us traffic, but since the kernel ignores the linkdown /64 it falls back to the default route instead, which in my case forms a loop.

We might wan to add an option to honor the linkdown route attribute or one to ignore routes on any interfaces that are linkdown.

--Daniel

@jech
Copy link
Owner

jech commented Oct 27, 2023

So what you are saying is that there's a sysctl that tells the kernel to disobey the routing table? I don't see how we could possibly avoid routing loops if the kernel is not obeying the routing table.

We might wan to add an option to honor the linkdown route attribute or one to ignore routes any interfaces that are linkdown.

Does the link-detect option do what you want? If you find it useful, we might make it into a per-interface option.

@DanielG
Copy link
Contributor Author

DanielG commented Oct 27, 2023 via email

@jech
Copy link
Owner

jech commented Dec 7, 2023

I'd say babeld's model of how the Linux routing table works is incomplete :)

The role of the routing daemon is not to model the Linux routing table. It's role is to construct a routing table and instruct the kernel to forward packets according to that routing table. If the kernel is configured to ignore the routing daemon's instructions, then routing is going to break.

I belive (but haven't checked) the kernel will send route change netlink events when routes become ignored, the linkdown (RTNH_F_LINKDOWN) should be set in those. So it ought to be easy for babeld to react to routes becoming ignored in this way.

I'm not opposed to accepting a (tested!) patch that does that. However, I think we should simply document that babeld is not compatible with ignore_routes_with_linkdown, and that people should be using link-detect instead.

(As a side note, the reason why link-detect is not the default is that it's unreliable on WiFi hardware. I think it might be an improvement to make it into a per-interface option, and to enable it automatically when the interface is known to support it reliably. But that's a different matter.)

Closing this issue, please feel free to reopen it if you think there's anything actionable about it.

@jech jech closed this as completed Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants