deja3-(E-Mail Removed) wrote:
> Using linux as a gateway router, how does one do this? I'd like to
> prevent internal computers from making outbound port 25 connections,
> but still allow them to the linux box on port 25.
Assuming (but not stated) that you want your linux box to be able to
make outbound port 25 connections, you just need this:
iptables -A FORWARD -o eth0 -p tcp --dport 25 -j REJECT
Alternatively you can do interesting things like forcing everything
that attempts to talk to port 25 to actually end up talking to your own
port 25:
iptables -t nat A PREROUTING -i eth1 -p tcp --dport 25 -j REDIRECT
You need to be careful of this (redirect), though, and bear in mind
that it will break any attempt by a client to use Authenticated SMTP
to a remote server. I do it on my home network so that I have record of
all outbound email. However, I don't block outbound Authenticated SMTP
on port 587, nor do I block SMTP/SSL on port 465. YMMV.
Chris