0

I am new to Networking.

I am working on a project where I need to implement a Captive Portal inside an Alpine Linux container, but there are some tricky parts to it.

The system I am working on uses two bridged LXC containers both running Alpine Linux.

The network configuration is as follows:

Container A: WLAN0/WLAN1 -> br0 -> veth(Container A) -> veth(Container B) -> br0 -> veth(Container B) -> veth(Host) -> cbr0 -> LAN2 -> LAN1/WAN

Right now I am just trying to manually adjust the routing rules to achieve the redirection and then I can implement something like Nodogsplash, but I can't even get the redirection to work. The challenge seems to be that because the containers are bridged, the traffic only happens on layer 2, so I can't apply any layer 3 rerouting rules with iptables or nftables.

I can't use broute from ebtables for some reason because Alpine doesn't support that functionality.

From my perspective, I need to find a way to get the traffic to be accessible by layer 3 somehow, but maybe there is another way.

So how can I go about doing this? Am I missing something?

The system requires this two container setup, so I can't adjust that at all. I may be able to add an additional container or run the Captive Portal on the host, but that would be a last resort move.

Any advice is appreciated :)

12
  • 1
    Is an option to route between the interfaces instead of bridging? Commented Jan 22 at 5:53
  • That may be an option. Right now I need confirmation that I am not crazy and that they way I am trying to implement the firewall is correct. Commented Jan 22 at 14:16
  • I think your analysis about layer 2 vs layer 3 is correct and I personally wouldn't continue down that rabbit hole. I think it would be technically possible, bit probably the 'wrong' way to go about it Commented Jan 22 at 20:02
  • how would you go about implementing a captive portal in this system? Commented Jan 22 at 20:04
  • I had a quick look and I have some ideas, when I have some spare time i'm happy to have a go and post back with what I come up with. Would you mind adding to your post some more details about exactly what you want a captive portal to do? just block traffic until a password is provided? Commented Jan 23 at 2:20

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.