I set up my iptables on my raspberry pi to redirect ALL traffic to localhost where my landing page is hosted, so that people on my AP can't access internet without logging in(correctly) first. On the back end there's a java servlet running where I possibly have to do all this. How can I make it so that when someone has a valid login, the iptable(NAT) rules get altered which grants them internet access?

  • I doubt you can use IPTABLES (easily) for per "session" rules Jan 14 '19 at 1:25
  • There is really everything unclear. You are talking about AP, RasPi, NAT, landing page on localhost (is localhost a device?), login, back end, iptables, java servlet, internet access without any visible context. Can you please explain?
    – Ingo
    Jan 14 '19 at 21:36
  • What you want is called a captive portal, and implementing one was already discussed here, here and here Jan 15 '19 at 8:18

Browse other questions tagged or ask your own question.