Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Jerry2A <jerry2a@gmail.com>
To: netfilter@lists.netfilter.org
Subject: Block outbound host to specific port(s) using Masq./NAT?
Date: Mon, 3 Jan 2005 16:52:32 -0500	[thread overview]
Message-ID: <5dda57be050103135225b4e665@mail.gmail.com> (raw)

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.


             reply	other threads:[~2005-01-03 21:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-03 21:52 Jerry2A [this message]
2005-01-03 22:05 ` Block outbound host to specific port(s) using Masq./NAT? Jason Opperisano
     [not found]   ` <558224e3050103150559aea7cc@mail.gmail.com>
2005-01-04  9:06     ` Fwd: " ASHISH
2005-01-04 14:13 ` Jerry2A
2005-01-05 12:41 ` Georgi Alexandrov

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=5dda57be050103135225b4e665@mail.gmail.com \
    --to=jerry2a@gmail.com \
    --cc=netfilter@lists.netfilter.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox