Hello,
I got a fairly simple project running(RaspPi with Arch, opening an Accesspoint and running a lightweight webserver) And intendet to implement a lil' Captive Portal, to redirect any request in that Network to the webserver.
I thought I'd gotten the hung of iptables and tried some different approaches
iptables -t nat -A PREROUTING -i ap0 -p tcp --dport 80 -j DNAT --to-destination 192.168.12.1:80
iptables -t nat -A PREROUTING -i ap0 -p tcp --dport 80 -j DNAT --to-destination 192.168.12.1
iptables -t nat -A PREROUTING -i ap0 -p tcp --dport 80 -j REDIRECT
iptables --table nat --append PREROUTING --match iprange --src-range 192.168.12.2-192.168.12.255 --protocol tcp --dport 80 --jump DNAT --to-destination 192.168.12.1
iptables --table nat --append PREROUTING --match iprange --src-range 192.168.12.2-192.168.12.255 --protocol tcp --dport 80 --jump DNAT --to-destination 192.168.12.1:80
But none of em worked. I was still able to access the webserver via the correct address, so the target isn't messed up. It's rather like, the tcp packages aren't even caught.
Is there anyone who can show me my, probably dumb, mistake?
Best regards,
MrBlaTi