PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Squid, Zugriffsverwaltung



detonation997
30.07.02, 19:32
Hallo!

Heut hab ich Squid mehr oder weniger erfolgreich eingerichtet. Probleme hat es bei der Zugriffsverwaltung gegeben.
Hier meine Konfigurationsdatei (Auszug):

=========================================
#/usr/local/squid/etc/squid.conf

<...>

#Recommended minimum configuration:
acl officenet src 192.168.6.0/24
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

<...>

#Recommended minimum configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
http_access allow officenet
#
# And finally deny all other access to this proxy
http_access deny all

<...>
=========================================

Mein Problem ist nun, dass ich keine HTTP-Verbindung aufbauen kann (Access denied). Ich schätze, dass das "http_access deny all" am Schluss alles einfach zudreht bzw. alle Verbindungen ablehnt (die Antwort auf eine HTTP-Anfrage kommt eindeutig vom Squid-Cache).
Um das Problem zu umgehen, hab ich einfach die Zeile "http_access deny all" auskommentiert. Damit funktioniert der Cache an sich. Nur möchte ich jetzt keinen public-Proxy aufmachen, damit meine IP als Absender in beliebigen TCP-Packln steht.

Wie kann ich nur Benutzern vom Klasse C - Netzwerk 192.168.6.0 / 255.255.255.0 Zugriff auf meinen Proxy gewähren?
Danke schon im Voraus!

rasi
30.07.02, 21:11
vi /etc/squid.conf

acl localnet src 192.168.6.0 / 255.255.255.0
und vor
http_access deny all

http_access allow localnet

reinschreiben

testen !!!!! ;)

cya
RB

Jinto
30.07.02, 21:13
@detonation997

Also deine squid.config sieht soweit eigntlich i.O. aus. Welche IP hat den der Rechner, der die Anfrage stellte? und Poste hier mal den Eintrag der Squid log-Datei.

detonation997
31.07.02, 16:19
Von jeder Antwort hab ich ein bisschen was brauchen können. Hier nun meine Konfigurationsdatei:

=========================================
#/usr/local/squid/etc/squid.conf

<...>

#Recommended minimum configuration:
#DIESER BEREICH IST UNVERÄNDERT!!!
acl localnet src 192.168.6.0/24
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

<...>

#Recommended minimum configuration:
#DA HAT SICH WAS GEÄNDERT!!!
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
http_access allow localnet

###JETZT KOMMTS!!!###
http_access allow localhost
###ACHTUNG###

#
# And finally deny all other access to this proxy
http_access deny all

<...>
=========================================

Mein Problem war eigentlich nur der localhost (siehe "JETZT KOMMTS!!!" im Config-File). Ich hab den Remote-Zugriff (Zugriff aus dem lokalen Netz) noch gar nicht ausprobiert, als ich mein Problem im Forum gepostet habe. Der müsste nämlich auch damals schon funktioniert haben. Mit der "localhost" Section kann ich jetzt auch von dem Rechner, auf dem der Squid läuft auf HTTP-Verbindungen zugreifen.

Danke vielmals!

mfg Rainer

HuanSen
31.07.02, 19:47
1. Ich bin mir gar nicht sicher, ob bei mir squid automatisch gestartet wird (SuSE 8.0). Habe einen Eintrag in rc.config: START_SQUID=yes gemacht und SuSEconfig ausgeführt. Wie kann ich feststellen, ob squid nun läuft?

2. Wenn ich squid start eingebe, folgt:
2002/07/31 20:36:23| aclParseIpData: WARNING: Netmask masks away part of the specified IP in '192.168.1.2/255.255.255.0'

Das soll der Client-Rechner (Win2000) sein.

Meine squid.conf sieht so aus:

acl sorka src 192.168.1.2/255.255.255.0 # Client, Win2000
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to unknown ports
http_access deny !Safe_ports

# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
http_access allow sorka

# And finally deny all other access to this proxy
http_access allow localhost
http_access deny all

Was bedeutet die Meldung oben bei squid start?

Was ich bisher auch mache, der Client findet keine Seite, obwohl er richtig konfiguriert ist.

*schluchz* :(

detonation997
31.07.02, 20:46
Hallo!

Gleich einmal vorweg - verwende möglichst Distributionsunabhängige Tools zur Serververwaltung (die rc.local ist speziell für SuSE). In jedem besseren Linuxhandbuch findest du im Kapitel zum Systemstart Anleitungen, wie du Programme beim Hochfahren automatisch starten lässt.

So, nun zu deinen Fragen:

1.) Wenn du wissen willst, welche Prozesse gerade am System laufen, dann erfährst du dies stets mit "ps -aux". Mit "killall prozessname" kannst du eine ganze Prozessstruktur beenden. Willst du gezielt einen Prozess beenden, dann tust du das mit "kill -9 pid". PID steht dabei für Process Identity.
Willst du nun squid beenden, dann tippe "killall squid", und die Sache müsste soweit erledigt sein (dass das eleganter geht, weiß ich).

2.) Die Meldung heißt, dass er aufgrund deiner Subnet-Mask die letzte Stelle ("2") durch eine "0" ersetzt (also die Adresse fürs Klasse C Netzwerk).
Ich glaub, dass es "acl sorka src 192.168.1.2/255.255.255.255" oder "acl sorka src 192.168.1.2/32" lauten müsste.
Wenn du ein ganzes Subnet zugreifen lassen willst, dann schau dir einmal meine Configfile an (Abschnitt "localnet").

Und nochwas - ich hab meinen Squid nach einer Anleitung konfiguriert. Da steht, dass du die Zeilen (in squid.conf) mit:

A) httpd_accel_host virtual
B) httpd_accel_with_proxy on
C) httpd_accel_uses_host_header on

wie oben lautend ergänzen musst.

Weiters musst du

"mkdir /usr/local/squid/cache"
"chown -R nobody.nogroup /usr/local/squid/cache"
"/usr/local/squid/bin/squid -z"
"chown -R nobody.nogroup /usr/local/squid/logs"

ausführen. Damit änderst du die Zugriffsrechte für das Log-Datei Verzeichnis und erstellst das Cache-Verzeichnis samt Zugriffsrechte.

Kommt deine Meldung sicher von Squid? ("Acces denied" und "Generated by linuxserver.linuxdomaene..." - sowas (linuxserver.linuxdomaene wird anders aussehen) müsste auf der erscheinenden Seite ganz unten stehn, dann läuft dein Squid soweit einmal)