Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: tcp packets on 25 port FORWARDING
Date: Fri, 12 Mar 2004 10:21:45 +0000	[thread overview]
Message-ID: <200403121021.45434.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <DIIE.000000F500002A22@sbgit.com>

On Friday 12 March 2004 10:03 am, peter.gehle@sbgit.com wrote:

> Try this:
>
> LAN_IP=$(ifconfig eth1|head -n 2|tail -n 1|cut -d: -f2|cut -d" " -f1)

A simpler version is `ifconfig eth1|grep inet|tr -s ': ' '\t'|cut -f4`

> iptables -t nat -A PREROUTING -i *EXT-NIC* -p tcp --dport 25 -j DNAT
> --to_destination *POSTFIX-IP*

> iptables -t nat -A POSTROUTING -o *INT-NIC* -p tcp --dport 25 -j SNAT
> --to-source $LAN_IP

Why include this rule?   It will make all email received by the Postfix 
machine appear to come from the Firewall, not the real IP address of the 
sending server.   This will make anti-spam measures more difficult / less 
effective.

> iptables -A FORWARD -i *EXT-NIC* -m state --state NEW -p tcp -d *POSTFIX-IP*
> --dport 25 -j ACCEPT

What about NEW packets from inside to outside (eg delivering mail to the 
Internet?)

Also don't forget that a mail server is likely to want to do things like DNS 
lookups.

Regards,

Antony.

-- 
Having been asked for a reference for this man,
I can confirm that you will be very lucky indeed if you can get him to work 
for you.

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



  reply	other threads:[~2004-03-12 10:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-12 10:03 tcp packets on 25 port FORWARDING peter.gehle
2004-03-12 10:21 ` Antony Stone [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-03-12  9:46 Stanislav Puffler DiS.
2004-03-12  9:57 ` Antony Stone
2004-03-12 10:47   ` Stanislav Puffler DiS.

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=200403121021.45434.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