All of lore.kernel.org
 help / color / mirror / Atom feed
* Vijay - port 25 to be blocked
@ 2004-12-28 16:22 Vijay Kumar
  0 siblings, 0 replies; 5+ messages in thread
From: Vijay Kumar @ 2004-12-28 16:22 UTC (permalink / raw)
  To: netfilter

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

 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Vijay - port 25 to be blocked
       [not found] <E1CjK9G-0000Y9-00@mx.ya.com>
@ 2004-12-28 16:23 ` Javier Sanchez
  0 siblings, 0 replies; 5+ messages in thread
From: Javier Sanchez @ 2004-12-28 16:23 UTC (permalink / raw)
  To: Vijay Kumar; +Cc: netfilter



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
> 
>  
> 
> 
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Vijay - port 25 to be blocked
       [not found] <20041228170317.34EE82BBF8@tharbad>
@ 2004-12-28 16:38 ` Eric Ellis
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Ellis @ 2004-12-28 16:38 UTC (permalink / raw)
  To: Vijay Kumar; +Cc: netfilter

Vijay Kumar wrote:
> 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
> 
>  
> 
Lemme try this again,

I believe that this needs to be in the "forward" table, not the "input" 
table.

IIRC, Input is just for traffic destined to the firewall box itself, the 
mail servers that you're talking to are on the far side of the firewall, 
if I read you correctly.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Vijay - port 25 to be blocked
       [not found] <1581342731182665558@unknownmsgid>
@ 2004-12-28 17:42 ` Askar
  0 siblings, 0 replies; 5+ messages in thread
From: Askar @ 2004-12-28 17:42 UTC (permalink / raw)
  To: Vijay Kumar; +Cc: netfilter

try this ,
#iptables -A FORWARD -i eth0 -o ppp0 --dport 25 -d  !<ip addr of mail
server>  -j
DROP

don't forget to replace -i eth0 with your LAN inteface and -o ppp0
with your external interface




On Tue, 28 Dec 2004 21:52:46 +0530, Vijay Kumar <vijay@calsoftinc.com> wrote:
> 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
> 
>  
> 
> 


-- 
(after bouncing head on desk for days trying to get mine working, I'll make
your life a little easier)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Vijay - port 25 to be blocked
       [not found] <544398739307937211@unknownmsgid>
@ 2004-12-28 19:19 ` ASHISH
  0 siblings, 0 replies; 5+ messages in thread
From: ASHISH @ 2004-12-28 19:19 UTC (permalink / raw)
  To: Vijay Kumar, netfilter

Infact the rule that you have written makes no sense as any packet in
input chain with dport as 25 is meant for your machine's SMTP server.
So if your rule is translated in plain english, it would loook like

"Deny access to all IP addresses other than <ip addr of mail server>
to the mail server running on my machine".

If you are writing this rule to your gateway, just write in it's
FORWARD chain. If you are writing this rule for you company's SMTP
server (if all mail in calsoft is  forwarded to  smtp.calsoftinc.com
and this server in turn forwards it to respective mail servers on net)
then put it in that machine's output chain.


On Tue, 28 Dec 2004 21:52:46 +0530, Vijay Kumar <vijay@calsoftinc.com> wrote:
> 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
> 


-- 
cheers
Ashish
KReSIT
IIT Bombay


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-12-28 19:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
     [not found] <E1CjK9G-0000Y9-00@mx.ya.com>
2004-12-28 16:23 ` Javier Sanchez
2004-12-28 16:22 Vijay Kumar

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.