All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Opperisano <opie@817west.com>
To: netfilter@lists.netfilter.org
Subject: Re: Restrict LAN users to send mail to Internet but allow to send mail to other LAN user.
Date: Wed, 27 Oct 2004 12:54:58 -0400	[thread overview]
Message-ID: <20041027165458.GA177@bender.817west.com> (raw)
In-Reply-To: <20041027145828.9818.qmail@web60402.mail.yahoo.com>

On Wed, Oct 27, 2004 at 07:58:28AM -0700, ads nat wrote:
> Hi,
> I will elaborate my problem.
> 
> I am looking for solution for following problem.
> 
> I have A Linux interent gateway server having 3 NIC
> cards 
> 1) eth0 connected to internet.
> 2) eth1 connected to private LAN (192.168.0.1.)
> 3) eth2 connected to DMZ server.(10.0.0.1)
> 
> DMZ server is with one LAN card (eth0 : 10.0.0.2)
> 
> On DMZ, DNS, Web and sendmail are installed.
> Iptables prerouting rules are set on Gateway server so
> that users from LAN 192.168.0.0 can acess web as well
> as mail server.
> 
> Now I want to allow LAN users to send emails to each
> other on LAN but want to allow some LAN users to send
> email to Internet(Outside world).
> Is there any way using Linux iptables firewall to
> acieve this requirement.
> 
> thanks for support.

  # allow all LAN users to connect to DMZ mail server
  iptables -A FORWARD -i eth1 -o eth2 -p tcp --syn --dport 25 \
    -s 192.168.0.0/24 -d 10.0.0.2 -j ACCEPT

  # allow special machine to send mail directly to internet
  iptables -A FORWARD -i eth1 -o eth0 -p tcp --syn --dport 25 \
    -s $special_machine_IP -j ACCEPT

assuming you're running a "deny all, allow specific" type rulebase,
you're done.  if you're running an "allow all" rulebase, you'll need to
add:

  iptables -A FORWARD -i eth1 -p tcp --syn --dport 25 -j REJECT

-j

-- 
Jason Opperisano <opie@817west.com>


  reply	other threads:[~2004-10-27 16:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27 14:58 Restrict LAN users to send mail to Internet but allow to send mail to other LAN user ads nat
2004-10-27 16:54 ` Jason Opperisano [this message]
2004-10-27 18:20 ` Aleksandar Milivojevic
2004-10-28 15:35   ` ads nat
2004-10-28 15:48     ` Jason Opperisano
2004-10-28 16:42     ` Aleksandar Milivojevic
  -- strict thread matches above, loose matches on Subject: below --
2004-10-27 18:55 Gary Smith
2004-10-27 19:16 ` Aleksandar Milivojevic
2004-10-27 20:47 Gary Smith

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=20041027165458.GA177@bender.817west.com \
    --to=opie@817west.com \
    --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 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.