mwan3: route updates ignored unless tracking is enabled
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 4.6k
- Forks
- 4k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 134
Description
Maintainer: @feckert @aaronjg
Environment: Linksys E8450 / aarch64 / OpenWrt 22.03.3
Description:
Hello, I have mwan3 running on a router with Strongswan with xfrm. When a new road warrior Strongswan client connects, a /32 route is added to send traffic to the xfrm interface where the Strongswan client lives. The local networks attached to the router are fine, but WAN is inaccessible (packet leaves router, but the returning packets from wan cannot be routed back to road warrior. tcpdump shows egress packet to wan, response packet from wan ingress, then the router sends ICMP destination unreachable back to wan after 1sec). A /etc/init.d/mwan3 restart then grants access to wan for the client.
I found that adding track_ip to the wan interface fixes the problem. I think that's because of https://github.com/openwrt/packages/commit/8d4e202fa4aa7c3a549472ead942c976e218dd31#diff-8a37c6770c4fcad6a416392044a5e3bc4a9624592ca319cb9a4036c60a49e7f5R110-R114.
if [ -n "$iface" ] && [ "$(mwan3_get_mwan3track_status $iface)" != "active" ]; then
LOG debug "interface $iface is disabled - skipping '$route_line'";
return
fi
The original code that was there was checking if the interface is online, so I believe the code should be calling mwan3_report_iface_status instead of mwan3_get_mwan3track_status? I'm not sure if this is intended; if it is unintended, I'd be happy to try to come up with a PR to fix - I didn't want to change intended behaviour.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the route-update logic in /etc/init.d/mwan3, especially the conditional using mwan3_get_mwan3track_status and the related mwan3_report_iface_status function. Reproduce a route update with tracking disabled, then confirm that routes are processed for an online interface without breaking tracked-interface behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100