iptables to redirect traffic through AP router?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

I run a wifi router in AP mode and want to setup iptables rule to redirect
traffics to Google AdSense to a proxy. I added this chain and rule to
NAT table:
1. Create GoogleAds chain
-N GoogleAds
2. Append this chain to PREROUTING chain
-A PREROUTING -j GoogleAds
3. In GoogleAds chain, I make some rules:
-A GoogleAds -d 74.125.235.25/32 -p tcp -m tcp --dport 80 -j REDIRECT
--to-ports 8888
-A GoogleAds -d 74.125.235.26/32 -p tcp -m tcp --dport 80 -j REDIRECT
--to-ports 8888
-A GoogleAds -d 74.125.235.13/32 -p tcp -m tcp --dport 80 -j REDIRECT
--to-ports 8888

But the problem is that no traffic is driven to those rules, though it
is driven to GoogleAds chain
Screenshot: http://i.imgur.com/bpRBE.png

I suspect this is related to AP mode of router. I tried on OpenWrt on
VirtualBox and successful.

How should right iptables rule is?

(I brought the GoogleAds chain to POSTROUTING, but got error ip_tables:
REDIRECT target: bad hook_mask 0x10/0x9)

Thanks.

-- 
Regards,
Quân

Y!IM: ng_hquan_vn
GTalk: ng.hong.quan

--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux