From: "Nguyễn Hồng Quân" <quannguyen@mbm.vn>
To: netfilter@vger.kernel.org
Subject: iptables to redirect traffic through AP router?
Date: Tue, 25 Sep 2012 08:57:04 +0700 [thread overview]
Message-ID: <50610F70.50900@mbm.vn> (raw)
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
reply other threads:[~2012-09-25 1:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50610F70.50900@mbm.vn \
--to=quannguyen@mbm.vn \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.