Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Sebastian" <netfilter@basti79.de>
To: Netfilter Mailinglist <netfilter@lists.netfilter.org>
Subject: Allow Proxy connection
Date: Wed, 18 Jun 2003 15:21:45 +0200	[thread overview]
Message-ID: <000701c3359c$925ca020$0200a8c0@basti79> (raw)

Hi list...

I've got a gateway with iptables and squid proxy. All forwarding is
DROPed, so internal clients can only use the proxy for internet
connection. I've got the following rule in INPUT/OUTPUT chains to allow
the porxy to fetch the web sites:

iptables -A OUTPUT -o eth0 -p tcp --dport 80 -m state --state
NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT  -i eth0 -p tcp --sport 80 -m state --state
ESTABLISHED     -j ACCEPT

But this works only if the webserver in the internet is running on port
80. So i tried to use the -m owner --uid-owner option to match all
packets from the proxy user. The i had to accept all ESTABLISHED packets
in the INPUT chain, because the owner match works only in OUTPUT chain.

What i did now is the following:

iptables -A OUTPUT -o eth0 -p tcp -m owner --uid-owner proxy -m state
--state NEW -j CONNARK --set-mark 1
iptables -A OUTPUT -o eth0 -m connmark --mark 1 -j ACCEPT
iptables -A INPUT  -i eth0 -m connmark --mark 1 -j ACCEPT

This seems to work, but what i wann know now:
 - Is this solution secure?
 - Anybody got a better solution?

Regards
Sebastian.



             reply	other threads:[~2003-06-18 13:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-18 13:21 Sebastian [this message]
2003-06-18 13:36 ` Allow Proxy connection Ray Leach

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='000701c3359c$925ca020$0200a8c0@basti79' \
    --to=netfilter@basti79.de \
    --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