* Block outbound host to specific port using Masq./NAT?
@ 2005-01-03 21:45 Jerry A. Applebaum
2005-01-04 13:10 ` Gavin Hamill
0 siblings, 1 reply; 2+ messages in thread
From: Jerry A. Applebaum @ 2005-01-03 21:45 UTC (permalink / raw)
To: netfilter
Hello - this is probably a dumb question....I'm using iptables for my
home network (DSL) and I have masquerading, some port forwarding,
etc., etc., and everything works great...EXCEPT....I have a situation
where I occaisionally want to block outbound traffic from a certain
host inside to a certain destination IP and/or port. For example, I'd
like to block one host from within my network from using Instant
Messenger but still allow web surfing. I've been able to dynamically
block ALL outbound access to the internet but I'm unable to restrict
access to certain destination ports.
So this works:
iptables -A INPUT -s 10.1.1.10 -j DROP
iptables -A OUTPUT -d 10.1.1.10 -j DROP
iptables -A FORWARD -d 10.1.1.10 -j DROP
And I thought I could do something like this:
iptables -A OUTPUT -s 10.1.1.10 -p tcp -m tcp --dport 5190 -j DROP
iptables -A FORWARD -d 10.1.1.10 -p tcp -m tcp --dport 5190 -j DROP
....but it has no effect.
I've tried different combinations of "-d and -s" and "--dport and
--sport" just to see if I was doing something backwards....no dice. I
was wondering if I needed to set up some kind of pre or post routing
because of the masquerading?
Any help would be appreciated.
Thanks!
--
Jerry A.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Block outbound host to specific port using Masq./NAT?
2005-01-03 21:45 Block outbound host to specific port using Masq./NAT? Jerry A. Applebaum
@ 2005-01-04 13:10 ` Gavin Hamill
0 siblings, 0 replies; 2+ messages in thread
From: Gavin Hamill @ 2005-01-04 13:10 UTC (permalink / raw)
To: netfilter
On Monday 03 January 2005 21:45, Jerry A. Applebaum wrote:
> And I thought I could do something like this:
> iptables -A OUTPUT -s 10.1.1.10 -p tcp -m tcp --dport 5190 -j DROP
> iptables -A FORWARD -d 10.1.1.10 -p tcp -m tcp --dport 5190 -j DROP
> ....but it has no effect.
You almost got it :)
Try
iptables -A FORWARD -s 10.1.1.10 -p tcp -m tcp --dport 5190 -j DROP
because the OUTPUT chain only refers to connections originating from the
firewall machine, although I can see how this is confusing since it's the
firewall machine doing the MASQ :)
Also, I would not be at all surprised if ICQ/AIM also tries to contact
login.icq.com on port 80 if 5190 fails, in the same way that MSN Messenger
does
Cheers,
Gavin.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-01-04 13:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-03 21:45 Block outbound host to specific port using Masq./NAT? Jerry A. Applebaum
2005-01-04 13:10 ` Gavin Hamill
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.