Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2013
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. iptables -F
  2. iptables -X
  3.  
  4. iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
  5. iptables -t mangle -N internet
  6. iptables -t mangle -A internet -j MARK --set-mark 99
  7.  
  8. iptables -t mangle -A PREROUTING -i wlan0 -p tcp -m tcp --dport 1:65535 -j internet
  9. iptables -t nat -A PREROUTING -i wlan0 -p tcp -m mark --mark 99 -m tcp --dport 1:65535 -j DNAT --to-destination 10.0.0.254
  10.  
  11. # put some rules here to add the exceptions for the packets from being redirected to 10.0.0.254
  12. # the '-t mangle -I internet 1' argument means that we insert this rule to the beginning of mangle table
  13. # so that if the rule hit then no further processing in mangle table will be taken to the packet.
  14.  
  15. iptables -t mangle -I internet 1 -p tcp -m tcp -s [source IP address to unblock] --dport 80 -j RETURN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement