1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

iptables and MASQUERADE

Discussion in 'Tomato Firmware' started by mikester, Jul 29, 2007.

  1. mikester

    mikester Network Guru Member

    Does anybody have any experience using IPTABLES and MASQUERADE on the Tomato?

    Here's what I'm trying to do:

    iptables -I FORWARD -p tcp -m mport --dports 80,8080 -m web --host "<rejectedword>" -j MASQUERADE --to-ports 81 --to-destination <destination IP>

    Forward all <rejectedword> to a single web page on <destination IP> at port 81.
     
  2. mikester

    mikester Network Guru Member

  3. mikester

    mikester Network Guru Member

    Success!

    iptables -t nat -A PREROUTING -p tcp -d "website I want blocked.com" --dport 80 -j DNAT --to-destination <tomato-ip>:81

    I have a "website blocked" page set up on a second web server running on my tomato. When an objectionable website is accessed "website blocked" appears.
     

Share This Page