All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Sanchez <sjllera@ya.com>
To: Vijay Kumar <vijay@calsoftinc.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: Vijay - port 25 to be blocked
Date: Tue, 28 Dec 2004 17:23:36 +0100	[thread overview]
Message-ID: <1104251017.19129.11.camel@horus> (raw)
In-Reply-To: <E1CjK9G-0000Y9-00@mx.ya.com>



You are using INPUT, and should be using the OUTPUT chain because you
need to filter traffic comming from an external network. You can also
put the filter on the INPTU chain, in this case you shuld use --sport
instead of --dport.


So it should be:

To filter incoming traffic from a forbidden mail server.

iptables -I INPUT -i eth0 --sport 25 -d  !<ip addr of mail server>  -j
REJECT

To filter outgoing traffic to a forbidden mail server.

iptables -I OUTPUT -o eth0 --dport 25 -d  !<ip addr of mail server>  -j
REJECT

You should use the second option, but depend on your firewall ruleset
implementation, any of them will do the trick .-)

Cheers

El mar, 28-12-2004 a las 21:52 +0530, Vijay Kumar escribió:
> Hi,
> 
> I want to allow my internal network to only connect to some specific email
> servers.
> Apart from these mail server  I want to block port 25 and 110 from my
> internal network to anywhwere. I am doing the following : 
> 
> iptables -I INPUT -I eth0 --dport 25 -d  !<ip addr of mail server>  -j
> REJECT  
>  
> This does not seem to block the port 25 traffic. Where am I going wrong? 
> 
> Kindly help. 
> 
> Regards,
> Vijay Kumar
> 
>  
> 
> 
> 




       reply	other threads:[~2004-12-28 16:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1CjK9G-0000Y9-00@mx.ya.com>
2004-12-28 16:23 ` Javier Sanchez [this message]
     [not found] <544398739307937211@unknownmsgid>
2004-12-28 19:19 ` Vijay - port 25 to be blocked ASHISH
     [not found] <1581342731182665558@unknownmsgid>
2004-12-28 17:42 ` Askar
     [not found] <20041228170317.34EE82BBF8@tharbad>
2004-12-28 16:38 ` Eric Ellis
2004-12-28 16:22 Vijay Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1104251017.19129.11.camel@horus \
    --to=sjllera@ya.com \
    --cc=netfilter@lists.netfilter.org \
    --cc=vijay@calsoftinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.