Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: Three NICs, three LANs, only one must be MASQued
Date: Tue, 16 Mar 2004 13:32:33 +0000	[thread overview]
Message-ID: <200403161332.33438.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <BAY7-F8tCcVGtDmAkYx0006b199@hotmail.com>

On Tuesday 16 March 2004 1:20 pm, Luis Hernán Otegui wrote:

> I manage a network with a proxy server (running SQUID and IPTABLES, kernel
> 2.4.18-14) which used to have two NICs, both networks attached to those
> NICs with public IP addresses. Recently, we had to put a third NIC in the
> proxy, with private reserved (10.0.0.x) addresses. So, we had to masquerade
> all the traffic from the two "internal" networks. Here's the diagram:
>
>       INTERNET
>              |                              (public IPs network(A))
>              |                             /
> (corporative LAN)-----(proxy)<
>                                            \
>                                             (private IPs network(B))
>
> So far, so good, but the point is that I need the servers in the (A)
> network to maintain their IPs, since they're well known in the net. And
> also we need the hosts in the (B) network to be masqued, since their IPs
> cannot be routed over the internet.
> My questions are:
> a) Are there any way to masquerade only the (B) network? Currently, I have
> a line like this in the *nat section of the /etc/sysconfig/iptables file:
> -A POSTROUTING -o eth0 -j MASQUERADE
> b) Is there any better way to do this?

Sure:

iptables -A POSTROUTING -o eth0 -s 192.168.0.0/16 -j MASQUERADE

Replace 192.168.0.0/16 with whatever describes your network B subnet.

Regards,

Antony.

-- 
"Reports that say that something hasn't happened are always interesting to me, 
because as we know, there are known knowns; there are things we know we know. 
We also know there are known unknowns; that is to say we know there are some 
things we do not know. But there are also unknown unknowns - the ones we 
don't know we don't know."

 - Donald Rumsfeld, US Secretary of Defence

                                                     Please reply to the list;
                                                           please don't CC me.



      reply	other threads:[~2004-03-16 13:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-16 13:20 Three NICs, three LANs, only one must be MASQued Luis Hernán Otegui
2004-03-16 13:32 ` Antony Stone [this message]

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=200403161332.33438.Antony@Soft-Solutions.co.uk \
    --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