![]() |
Blocking Port 25 On Proxy Server!!!
Hi everyone,
This is varun here, i am using a proxy server 172.20.x.x, 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. Please help. Thanks! |
Hello,
What proxy are you using? Do you have iptables installed/configured? Kind regards, Eric |
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.
|
Yes i have iptables installed and configured however i am not able to block the port may be i am not putting the command right!
eg. iptables -A INPUT -s 172.20.x.x/20 -d proxyserver -p TCP --dport 25 i also tried; iptables -A FORWARD -s 172.20.x.x/20 -d proxyserver -p TCP --dport 25 Please HELP!!! |
iptables -A INPUT -s 172.20.0.0 -p tcp -dport 25 -j DROP
That should block all traffic on port 25 from 172.20.0.0 network. But do you want to block all access to that port? Kind regards, Eric |
yes i want to block all except my internal lan??
|
Ah ok, all except your internal LAN, sorry for the misunderstanding
Code:
iptables -A INPUT -s !172.20.0.0 -p tcp -dport 25 -j DROPKind regards, Eric |
Quote:
i did it but when i tried this, telnet 172.20.x.x 25 it connected,it is giving access via telnet on port 25 i want to stop that too? |
Are you on the same LAN or one of the subnets? I assume you are if you can connect.
Kind regards, Eric |
Yes i am on the same lan but i want to stop access via telnet on port 25.
|
Sorry but now your confusing me a lot. In your original post you state
Quote:
Code:
iptables -A INPUT -s 172.20.0.0 -p tcp -dport 25 -j DROPFollowing you said Quote:
Code:
iptables -A INPUT -s !172.20.0.0 -p tcp -dport 25 -j DROPAnd 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?? Kind regards, Eric |
sorry for the misunderstanding..
i want to; 1. block access to port 25 from anywhere Thanks, |
No worries.
Try this Code:
iptables -A INPUT -p tcp -dport 25 -j DROPEric |
its not working??
|
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. HTH |
| All times are GMT -5. The time now is 08:12 PM. |