Jump to content

block port 25 using shorewall


mudfish
 Share

Recommended Posts

Hi mudfish,

 

you can edit your /etc/shorewall/rules file and add two lines like this:

 

DROP $FW net tcp SMTP

DROP $FW net udp SMTP

 

$FW is your standard firewall zone, net is the zone you're connected to the internet with in this example. For more on zones and options, see additional info in the rules and zones file in /etc/shorewall.

 

@SoulSe: Maybe he only wants to use port 465?

 

HTH,

 

scoonma

Link to comment
Share on other sites

iptables -A INPUT -p tcp -m tcp --dport 25 -j DROP

 

just incase you feel like doing it from the command line

He... he understands iptables. This must be the man the prophecies foretold...

 

:gossip:

Link to comment
Share on other sites

hi all

 

ty for the quick and informative replies.it really helps us a lot newbies gain new knowledge from experienced linux users.im a bit new to shorewall as im used to using firestarter with just a few clicks and its done.i am blocking port 25 on the firewall because i am not running a mail server..(am i doing right?i mean closing port 25 does not mean i can no longer check my email account on yahoo right?? greetz goes to scoonma,soulse and paul.

 

:thanks:

Link to comment
Share on other sites

On a server it is always a good idea to shut off the ports you don't need imho.

 

Remember that in Linux iptables is your firewall tool, things like Shorewall are just applications that address iptables. So if you can get your head around iptables you can go direct and cut out the middle-man :P

 

EDIT: Blocking off port 25 will not stop you from reading email from web-sites, no. Since that just needs your http and https ports to be open (80 and... 443... if I remember correctly)

Link to comment
Share on other sites

Just to clarify things a little, blocking ports in the INPUT chain will stop incoming connections to your machine, so blocking port 25 there will prevent outside machines to connect to your smtp port. This will not stop you from checking or sending webmails or normal mails. On the other hand, blocking ports on the OUTPUT chain will stop outgoing connections, so if you block port 25 there you will still be able to check mails but you won't be able to send mail through the standard smtp port.

Being it a server or a desktop computer it's always a good idea to block all the incoming ports and only open those you'll be using.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...