From: duren duren <jusdurian_jr@yahoo.com>
To: netfilter@vger.kernel.org
Subject: RE: Can I block nat'ed user with iptables?
Date: Sat, 26 Jan 2008 07:30:58 -0800 (PST) [thread overview]
Message-ID: <985036.73480.qm@web55409.mail.re4.yahoo.com> (raw)
In-Reply-To: <001101c85ff6$ffbf9bc0$ff3ed340$@info>
--- Rob Sterenborg <rob@sterenborg.info> wrote:
> > i have internet router using linux & i want only
> user1
> > can access internet & user2 can't
> > but if user1 use program like ccproxy, user2 can
> using
> > internet from user1 as proxy server
> >
> > is't possible to block user from being nat'ed with
> > iptables?
>
> Sure.
>
> INET_IP="a.b.c.d" # Your internet IP address
> USER_IP="192.168.0.11" # IP of user1
> LAN="192.168.0.0/24" # LAN where user1 is in
>
> $ipt -P FORWARD DROP
> $ipt -A FORWARD -m state --state RELATED,ESTABLISHED
> -j ACCEPT
> $ipt -A FORWARD -m state --state NEW -s $USER_IP -j
> ACCEPT
> $ipt -t nat -A POSTROUTING -s $LAN -j SNAT --to
> $INET_IP
>
> Here, it's possible to perform NAT for the entire
> LAN (see the rule for
> the nat table). However, the policy for the FORWARD
> chain in the filter
> table (which is where most of us do filtering) is
> set to DROP so every
> packet that did not match a rule that accepts a
> packet will be dropped.
> Only ESTABLISHED and RELATED packets (which will be
> the most) will be
> accepted, as well as NEW packets from user1. This
> way only user1 will be
> able to use the internet (assuming routing is setup
> correctly). It's up
> to you to get ccproxy on the PC of user1 working.
>
>
> Grts,
> Rob
>
thanks Rob, but i'm litle bit confusing about this. If
user1 install ccproxy & user2 use user1 as a proxy for
their browser & user2 can connect.
From linux server point of view, he just know, request
come from user1 IP not from user2 IP, so he will
forward it not block. is't right?
thanks for your help
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
next prev parent reply other threads:[~2008-01-26 15:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-26 5:18 Can I block nat'ed user with iptables? duren duren
2008-01-26 8:39 ` Rob Sterenborg
2008-01-26 15:30 ` duren duren [this message]
2008-01-26 16:20 ` Rob Sterenborg
2008-01-26 21:51 ` mouss
-- strict thread matches above, loose matches on Subject: below --
2008-01-26 1:18 duren duren
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=985036.73480.qm@web55409.mail.re4.yahoo.com \
--to=jusdurian_jr@yahoo.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox