From: Alex Satrapa <alex@lintelsys.com.au>
To: netfilter@lists.netfilter.org
Subject: Re: How to block sending mail from local network.
Date: Mon, 09 Feb 2004 08:42:05 +1100 [thread overview]
Message-ID: <4026AD2D.7060305@lintelsys.com.au> (raw)
In-Reply-To: <4024C335.7080705@ergolight-sw.com>
David Harel wrote:
> $IPTABLES -A INPUT -p ALL -i $LAN_IFACE -s $LAN_IP_RANGE -j ACCEPT
This only means that all machines on the local network can make connections to this machine itself.
If this machine is a router, and you want it to block outgoing SMTP connections, first identify which machine on your network is the authorised SMTP relay. If it's not the firewall itself, then you need to add a rule to accept forwarded packets for the SMTP relay, and block everyone else. You'll need two rules like this:
$IPTABLES -I FORWARD -p TCP -i $LAN_IFACE -s $SMTP_RELAY -j ACCEPT
$IPTABLES -I FORWARD -p TCP -i $LAN_IFACE -s $LAN_IP_RANGE -j REJECT --reject-with icmp-net-prohibited
I use "icmp-net-prohibited" since if someone is monitoring SMTP attempts, they'll see the ICMP packet telling them exactly why they can't make the connection. An alternative like -j DROP would mean the SMTP connections disappear into nothingness, and give the troubleshooter no hints as to what the problem is.
> I tried a command:
> $IPTABLES -A OUTPUT -p TCP -i $LAN_IFACE -s $LAN_IP_RANGE --dport smtp
> -j DROP
> but it did nothing.
This only prohibits this machine from making SMTP connections to other hosts on the local network.
The INPUT chain is used for connections to this host, OUTPUT is used for connections from this host, while FORWARD is used for packets being forwarded by this host on behalf of other machines.
HTH
Alex Satrapa
next prev parent reply other threads:[~2004-02-08 21:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-07 10:51 How to block sending mail from local network David Harel
2004-02-07 20:15 ` Sven Schuster
2004-02-08 9:39 ` David Harel
2004-02-07 20:17 ` Rob Sterenborg
2004-02-08 15:31 ` Tarek W.
2004-02-08 21:42 ` Alex Satrapa [this message]
2004-02-08 22:40 ` Mark Weaver
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=4026AD2D.7060305@lintelsys.com.au \
--to=alex@lintelsys.com.au \
--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.