-
-
Notifications
You must be signed in to change notification settings - Fork 113
Fix Pirania issue/1206 and overall captive portal stability #1224
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
base: master
Are you sure you want to change the base?
Conversation
…irania script functionality
|
Hey, nice work @usg-ishimura! |
|
Hi @henmohr, |
|
Hello maintainers , |
As I mentioned in #886 (comment) "This is being tackled by some people right now". |
|
I saw the recent hackathon activity around Pirania going on in #1239 unfortunately that week I was fully booked with work, so I couldn’t really join or follow the implementation details. I just wanted to leave one concrete observation that came up during my tests and that might be relevant to the ongoing work, without diving into the current code changes: When a client connects through a secondary mesh node and successfully enters a voucher, the primary (WAN) node appears to receive traffic with the MAC address of the secondary node, not the client’s MAC. Since Pirania relies on MAC-based authorization at the WAN side (nftables), the voucher is accepted by the portal but the traffic remains blocked because the primary node never sees the client’s MAC in the authorized set. This seems to be why voucher access works when connecting directly to the primary node, but fails when clients attach to secondary nodes. Just wanted to share this behavior in case it helps align the authorization logic with what the WAN node actually sees. |
|
Hey @usg-ishimura you are totally right! Your script does an amazing job, thanks for putting a lot of effort in helping us to solve this! Thanks!! |
|
Hey @henmohr, thanks for the feedback! I totally agree that using shared-state as a source of truth makes a lot of sense for a mesh architecture. Having a distributed database that automatically syncs across all nodes is definitely the right approach, and I can see how it would simplify a lot of the complexity I was trying to handle manually. My script was essentially a workaround to solve the immediate problem I was facing: getting clients connected through secondary nodes to actually access internet after voucher activation. It works in my test setup, but I recognize it's more of a patch than a proper architectural solution. Looking forward to seeing the final solution merged! |
|
Hey all!!! Seems shared-state is doing its job. I tested here with 2 routers, both of them using the package About adding neighborhood nodes to a whitelist, what was done at #1239 is to control only the interface where clients' traffic are going to flow. Mesh and cable interface are not controlled by pirania. |
This PR addresses issue #1206, before this changes when a client connected to a secondary node's AP, the primary node's (wan) nftables received the source mac address of the secondary node itself instead of the client's, blocking in fact internet access for the client even after the authentication process via voucher or read for access. I chose an hybrid solution to the problem checking that ips and macs of the clients are in the authorized lists and adding secondary nodes ips and macs to the whitelists by default. So when a client connects to a secondary node AP the elements in the whitelists should be the mac address of the secondary node and the ip of the client, when a client connects to a primary node AP the elements in the whitelists should be the mac address of the client and the ip of the client. This PR contains the commits from #1219 so i'm closing that one.
This PR can be tested adding this repo in the feeds
src-git libremesh https://github.com/usg-ishimura/lime-packages.git;issue/1206
The update works with my GL-AR300M16 routers on OpenWrt v23.05.5 but it needs further testing for sure.