Solved

How to block port 25 for all machine except the mailserver

Posted on 2009-03-31
2
867 Views
Last Modified: 2013-12-06
I like to block the port 25 on our firewall so no other than the real email server can send emails

Considering that the mail server address is 10.0.0.1, the gateway is 10.0.0.254 and the gateway that connects to the internet through the router has the IP of 192.168.0.100
So the machine that is running IPTables is on 10.0.0.254 and the external nic is 192.168.0.100
What should my rule look like?

TIA,

Tom
0
Comment
Question by:tom_szabo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
Blaz earned 500 total points
ID: 24036457
iptables -I FORWARD -p tcp --dport 25 -j DROP
iptables -I FORWARD -s 10.0.0.1 -p tcp --dport 25 -j ACCEPT

This rules will drop every connection to port 25 if not comming from your email server. Note that I wrote "-I" which means insert at the beginning - the rules will be reversed in the FORWARD chain.
0

Featured Post

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sql Server Firewall Problems 2 83
Checkpoint Endpoint Managment 3 106
Videos Blocked on espn.com 7 326
Help With Shell Script Centos 6 6 115
After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question