Linux Netfilter discussions
 help / color / mirror / Atom feed
* selective filter
@ 2003-12-03  9:07 Admin
  2003-12-03  9:23 ` Antony Stone
  0 siblings, 1 reply; 2+ messages in thread
From: Admin @ 2003-12-03  9:07 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]

Dear community,
I am new to this branch (Linux I mean) and as a new user it was my turn to install a new server.
I installed RedHat 8 on a system with 2 LAN cards.
The server works as a mailserver, apache, proxy and firewall.
The first 3 problems are solved. It work really fine.
The last daemon is the problem.
IPTABLES is installed but it is only with the default settings and with some settings made by the ISP.
The problem is that my bosses ask me to do some access list to restrict the access to some users on internet.
I "composed" some rules in squid.conf and everything works just fine until "a smart guy" discovered that if he doesn't
put the mark on "use proxy server" he have internet access.
In this case, I'm not verry sure, but I guess it is an iptables problem. I read something about this topic, but I didn't
find anything related to this specific problem.
Here are my data:
eth0: 193.2xx.xxx.xxx
eth1: 192.168.1.254

I want to restrict all users EXCEPT this 3 addresses: 192.168.1.100, 192.168.1.200, 192.168.1.21

How can I do that?
All that I found in all documentation that I read it was related to restricting all addresses.
Please, consider that I am a beginer and be a little more detailed on your help.
Do you have another ideea about solving this problem?

Thank you for your help!

Rares

[-- Attachment #2: Type: text/html, Size: 2767 bytes --]

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

* Re: selective filter
  2003-12-03  9:07 selective filter Admin
@ 2003-12-03  9:23 ` Antony Stone
  0 siblings, 0 replies; 2+ messages in thread
From: Antony Stone @ 2003-12-03  9:23 UTC (permalink / raw)
  To: netfilter

On Wednesday 03 December 2003 9:07 am, Admin wrote:

> Dear community,
> I am new to this branch (Linux I mean) and as a new user it was my turn to
> install a new server. I installed RedHat 8 on a system with 2 LAN cards.
> The server works as a mailserver, apache, proxy and firewall.
> The first 3 problems are solved. It work really fine.
> The last daemon is the problem.
> IPTABLES is installed but it is only with the default settings and with
> some settings made by the ISP. The problem is that my bosses ask me to do
> some access list to restrict the access to some users on internet. I
> "composed" some rules in squid.conf and everything works just fine until "a
> smart guy" discovered that if he doesn't put the mark on "use proxy server"
> he have internet access.
> In this case, I'm not verry sure, but I guess it is an iptables problem. I
> read something about this topic, but I didn't find anything related to this
> specific problem.
> Here are my data:
> eth0: 193.2xx.xxx.xxx
> eth1: 192.168.1.254
>
> I want to restrict all users EXCEPT this 3 addresses: 192.168.1.100,
> 192.168.1.200, 192.168.1.21
>
> How can I do that?
> All that I found in all documentation that I read it was related to
> restricting all addresses. Please, consider that I am a beginer and be a
> little more detailed on your help. Do you have another ideea about solving
> this problem?

It is important that you remember that the squid proxy, and the netfilter 
packet filtering firewall, are separate systems on your machine.

Therefore if someone has the proxy settings selected in their browser, squid 
will determine what they can do; if they do not then netfilter will determine 
what they can do.   Also, squid is for http only (and ftp over http in 
client-proxy mode), whereas netfilter can be used to control access to all IP 
services, including ones which don't even use TCP or UDP (such as VPNs).

Anyway, here are two answers to your question.

1. How to block all users from bypassing the squid proxy except 192.168.1.21, 
192.168.1.100 and 192.168.1.200:

iptables -A FORWARD -s 192.168.1.21 -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -s 192.168.1.100 -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -s 192.168.1.200 -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -p tcp --dport 80 -j REJECT

2. An alternative solutions, which will force all your internal users to go 
via squid (whether they've selected "use proxy" in their browser or not), 
therefore the access control of who is allowed to do what is now completely 
handled by squid:

iptables -A PREROUTING -t nat -s 192.168.1.0/24 -p tcp --dport 80 -j REDIRECT 
--to 3128

This will redirect all TCP port 80 requests (to anywhere) to go to TCP port 
3128 on the local machine (the one running squid) instead of reaching the 
external server.   This is called "transparent proxying" and is not the 
recommended way of using squid, but will generall work for the people who try 
to bypass "use proxy" in their browsers.

Hope this helps,

Antony.

-- 
Normal people think "If it ain't broke, don't fix it".
Engineers think "If it ain't broke, it doesn't have enough features yet".

                                                     Please reply to the list;
                                                           please don't CC me.



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

end of thread, other threads:[~2003-12-03  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-03  9:07 selective filter Admin
2003-12-03  9:23 ` Antony Stone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox