All of lore.kernel.org
 help / color / mirror / Atom feed
* iptables to redirect traffic through AP router?
@ 2012-09-25  1:57 Nguyễn Hồng Quân
  0 siblings, 0 replies; only message in thread
From: Nguyễn Hồng Quân @ 2012-09-25  1:57 UTC (permalink / raw)
  To: netfilter

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-25  1:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-25  1:57 iptables to redirect traffic through AP router? Nguyễn Hồng Quân

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.