Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Gáspár Lajos" <swifty@freemail.hu>
To: Netfilter IPtableMailinglist <netfilter@lists.netfilter.org>
Subject: Re: drop all out going SMTP connection bar two
Date: Wed, 02 Aug 2006 14:02:24 +0200	[thread overview]
Message-ID: <44D09450.8060606@freemail.hu> (raw)
In-Reply-To: <44CFDAC2.6010601@simonloewen.com>

Simon Loewen :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
>
>
> Hi,
>
> I would like to drop all out going SMTP connections through our router
> except smtp1.internal and smtp2.internal on all of the outbound
> interfaces.  I would like to filter on the destination port 25.
>
> Would this be easy to do?
>
> Thanks for any advise,
> S.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.4 (GNU/Linux)
>
> iD8DBQFEz9rCkcP1ZXUvpGURCrZ7AJ4haVmH4Hypjq6LjgBFRNFav6EQ1QCgkMkk
> m4I4NLc3u12NXg2cOwdrCxE=
> =kQ8+
> -----END PGP SIGNATURE-----
>
Try this:

iptables -t filter -A FORWARD -j ACCEPT -p tcp -d ip.of.smtp1 --dport 25
iptables -t filter -A FORWARD -j ACCEPT -p tcp -d ip.of.smtp2 --dport 25
iptables -t filter -A FORWARD -j DROP -p tcp --dport 25

In our network I have redirected all smtp traffic to our internal SMTP 
server and then allowed that server to send e-mails... :)



      reply	other threads:[~2006-08-02 12:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-01 22:50 drop all out going SMTP connection bar two Simon Loewen
2006-08-02 12:02 ` Gáspár Lajos [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=44D09450.8060606@freemail.hu \
    --to=swifty@freemail.hu \
    --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