Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: Nat
Date: Sun, 8 Sep 2002 22:00:06 +0100	[thread overview]
Message-ID: <20020908210010.EEJJ5047.mta06-svc.ntlworld.com@there> (raw)
In-Reply-To: <3D7BB687.6010300@iol.it>

On Sunday 08 September 2002 9:43 pm, Mattia Martinello wrote:

> Hi.
>
> I wish to create a nat with masquerading to allow my LAN to access to
> Internet.
> I have two LANs: 192.168.1.x and 192.168.2.x. The server wich will make
> the masquerading has both two LANs with two ethernet card.
> How I can allow only one LAN to access Internet with ppp0 on the server?
> I tried these lines, but it doesn't work:
>
> iptables -t nat -F POSTROUTING
> iptables -t nat -A POSTROUTING -j DROP

Never, never set a default policy other than ACCEPT on the nat or mangle 
tables !

> iptables -t nat -A POSTROUTING -s 192.168.1.0/255.255.255.0 -o ppp0 -j
> MASQUERADE

That should work fine.   A pity you can't use the -i option to specify the 
input interface in the POSTROUTING chain, but there you go....

> What I can do?

You could alternatively filter out packets from 192.168.2.0/24 going to ppp0, 
and then just MASQUERADE everything exiting ppp0 ?

Antony.

-- 

It is also possible that putting the birds in a laboratory setting
inadvertently renders them relatively incompetent.

 - Daniel C Dennett


  reply	other threads:[~2002-09-08 21:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-08 20:43 Nat Mattia Martinello
2002-09-08 21:00 ` Antony Stone [this message]
2002-09-08 21:27 ` Nat R. Sterenborg
2002-09-08 21:49 ` Nat Anders Fugmann
  -- strict thread matches above, loose matches on Subject: below --
2007-07-03  6:52 NAT Martin Schiøtz
2007-07-03  7:27 ` NAT Grant Taylor
2007-07-03  7:55   ` NAT Martin Schiøtz
2007-07-03 14:29     ` NAT Robert LeBlanc
2004-06-06 17:36 Nat mafioso1823
2004-06-07  7:38 ` Nat Antony Stone
2003-11-26  5:31 nat Paul Fontenot
2003-11-26  6:33 ` nat Daniel Chemko
2003-10-01 11:11 NAT tlussnig
2003-10-03 10:22 ` NAT Harald Welte
2002-06-14  8:29 nat saied tabandeh

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=20020908210010.EEJJ5047.mta06-svc.ntlworld.com@there \
    --to=antony@soft-solutions.co.uk \
    --cc=netfilter@lists.netfilter.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