iptables, why won't mine work?

Ask questions about Arch Linux ARM. Please search before making a new topic.

iptables, why won't mine work?

Postby MrBlaTi » Sat Feb 20, 2016 3:32 pm

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
MrBlaTi
 
Posts: 1
Joined: Sat Feb 20, 2016 3:30 pm

Re: iptables, why won't mine work?

Postby WarheadsSE » Mon Feb 22, 2016 2:09 pm

Do you have the appropriate ability for ipv4.fowarding on?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm


Return to User Questions

Who is online

Users browsing this forum: No registered users and 24 guests