Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If it is a proxy then it would be giving access in the first place without running an smtp proxy on that port, which is unlikely if you don't already know. so you'd need to be routing, not proxying, the traffic on it, and that would be where firewalls, including iptables / netfilter would be used to block traffic.
Sorry but now your confusing me a lot. In your original post you state
how do i block port 25 on this server so that anyone from ip range 172.20.x.x cannot access via telnet,etc.using this port.
To which I gave you
iptables -A INPUT -s 172.20.0.0 -p tcp -dport 25 -j DROP
as a solution to block all traffic from your LAN on port 25.
Following you said
yes i want to block all except my internal lan??
Today 12:59 PM
so the rule changed to
iptables -A INPUT -s !172.20.0.0 -p tcp -dport 25 -j DROP
that blocks all traffic except from your LAN.
And now you change your mind again to blocking all access from your LAN?
Could you PLEASE state what exactly you want to do:
1. block access to port 25 from anywhere
2. block access to port 25 from anywhere except your LAN
3. block access to port 25 ONLY from your LAN
4. something else??
You have to restart iptables for it to take effect. If it works, you also have to save the iptables settings, otherwise a reboot will revert to the original settings.
Note also that if you want to 'block' access to port 25 from 'anywhere', then you don't need iptables, you just don't run a server (presumably mailserver eg sendmail) on port 25; no server listening on port 25 = no way to connect on port 25, regardless of iptables.