Question : Trying to block outbound SMTP port 25 with iptables...not sure if it's working

Hi, I would like to temporarly block all outbound SMTP traffic through my iptables firewall.  I've tried both these commands:

iptables -A OUTPUT --protocol tcp --dport 25 -j DROP

and

iptables -A OUTPUT --protocol tcp --dport 25 -j REJECT

but when those rules are in place, I can still telnet to an smtp server on port 25.  I wouldn't think I'd be able to.  Is something wrong with my rules?

Answer : Trying to block outbound SMTP port 25 with iptables...not sure if it's working

Use FORWARD rather than OUTPUT since the traffic isn't originating on the server self but rather being forwarded from another host:

iptables -A FORWARD --protocol tcp --dport 25 -j DROP
Random Solutions  
 
programming4us programming4us