PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Squid3 lässt keine Anfragen durch



user0009
21.12.13, 18:51
Hallo,

ich habe einen Laptop mit Edubuntu 13.10 aufgesetzt. Darauf läuft die aktuelle Version von squid3 (3.3.8) und dansguardian, die es für diese Distribution. Der Laptop ist ein lokaler Rechner der über ein USB Modem (Internetstick) ins Internet gehen soll. Das funktioniert auch soweit. Der Benutzer soll allerdings im Surfverhalten eingeschränkt werden, daher dansguardian. Mein Problem ist nun, dass ich bei der squid.conf etwas falsch gemacht habe und schon einiges herum probiert habe, jedoch bekomme ich immer die gleiche Fehlermeldung:


Der folgende Fehler wurde beim Versuch die URL http://orf.at/ zu holen festgestellt:

Zugriff verweigert.

Die Anfrage wurde aufgrund mangelnder Zugriffsrechte verweigert. Bitte kontaktieren Sie Ihren Dienstanbieter falls sie denken, dass dies ein Fehler ist.

Ihr Cache Administrator ist webmaster.
Alle Seiten, die auf Port 443 aufgerufen werden funktionieren ohne Probleme. Der Rechner fungiert nicht als Server. Es soll nur ein squid Proxy dafür sorgen, dass alle aufgerufenen Seiten ins Internet gehen, jedoch welche die dansguardian ausschließt sollen blockiert werden. Zusätzlich wäre auch ein Zeitfilter noch ideal. Das heißt das der Internetzugang nur zu bestimmten Zeiten möglich sein soll.
Meine squid.conf sieht so aus:


acl localnet_src src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet_srcb src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet dst 0.0.0.0/0.0.0.0
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
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
http_access allow localhost manager
http_access allow localnet_src
http_access allow localnet
http_access allow localnet_srcb
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny manager
http_port 3128 transparent
debug_options ALL,1 33,2
coredump_dir /var/spool/squid3
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
refresh_pattern .


Der access.log sieht so aus:

1387637304.517 27 127.0.0.1 TCP_MISS/403 4040 GET http://orf.at/ - HIER_NONE/- text/html
1387637304.517 142 127.0.0.1 TCP_MISS/403 4150 GET http://orf.at/ - HIER_DIRECT/127.0.0.1 text/html
1387637305.762 0 127.0.0.1 TCP_MISS/403 4029 GET http://www.squid-cache.org/Artwork/SN.png - HIER_NONE/- text/html
1387637305.763 1149 127.0.0.1 TCP_MISS/403 4139 GET http://www.squid-cache.org/Artwork/SN.png - HIER_DIRECT/127.0.0.1 text/html
1387637867.059 1 127.0.0.1 TCP_MISS/403 4611 POST http://safebrowsing.clients.google.com/safebrowsing/downloads? - HIER_NONE/- text/html
1387637867.059 33 127.0.0.1 TCP_MISS/403 4721 POST http://safebrowsing.clients.google.com/safebrowsing/downloads? - HIER_DIRECT/127.0.0.1 text/html
1387637927.085 0 127.0.0.1 TCP_MISS/403 4611 POST http://safebrowsing.clients.google.com/safebrowsing/downloads? - HIER_NONE/- text/html
1387637927.086 1 127.0.0.1 TCP_MISS/403 4721 POST http://safebrowsing.clients.google.com/safebrowsing/downloads? - HIER_DIRECT/127.0.0.1 text/html
1387638739.367 34 127.0.0.1 TCP_DENIED/403 3852 GET http://orf.at/ - HIER_NONE/- text/html
1387638740.596 1111 127.0.0.1 TCP_DENIED/403 3900 GET http://www.squid-cache.org/Artwork/SN.png - HIER_NONE/- text/html
1387638744.696 0 127.0.0.1 TCP_DENIED/403 3852 GET http://orf.at/ - HIER_NONE/- text/html
1387638744.915 0 127.0.0.1 TCP_DENIED/403 3900 GET http://www.squid-cache.org/Artwork/SN.png - HIER_NONE/- text/html
1387638932.090 39 127.0.0.1 TCP_DENIED/403 3852 GET http://orf.at/ - HIER_NONE/- text/html
1387638934.632 2413 127.0.0.1 TCP_DENIED/403 3900 GET http://www.squid-cache.org/Artwork/SN.png - HIER_NONE/- text/html
1387639197.144 0 127.0.0.1 TCP_MISS/403 3981 GET http://orf.at/ - HIER_NONE/- text/html
1387639197.144 32 127.0.0.1 TCP_MISS/403 4091 GET http://orf.at/ - HIER_DIRECT/127.0.0.1 text/html
1387639197.957 0 127.0.0.1 TCP_MISS/403 4029 GET http://www.squid-cache.org/Artwork/SN.png - HIER_NONE/- text/html
1387639197.957 620 127.0.0.1 TCP_MISS/403 4139 GET http://www.squid-cache.org/Artwork/SN.png - HIER_DIRECT/127.0.0.1 text/html
1387639209.035 0 127.0.0.1 TCP_MISS/403 3976 GET http://www.squid-cache.org/ - HIER_NONE/- text/html
1387639209.036 1 127.0.0.1 TCP_MISS/403 4086 GET http://www.squid-cache.org/ - HIER_DIRECT/127.0.0.1 text/html
1387639209.171 0 127.0.0.1 TCP_MISS/403 4042 GET http://www.squid-cache.org/Artwork/SN.png - HIER_NONE/- text/html
1387639209.172 1 127.0.0.1 TCP_MISS/403 4152 GET http://www.squid-cache.org/Artwork/SN.png - HIER_DIRECT/127.0.0.1 text/html
1387639209.218 0 127.0.0.1 TCP_MISS/403 3977 GET http://www.squid-cache.org/favicon.ico - HIER_NONE/- text/html
1387639209.218 1 127.0.0.1 TCP_MISS/403 4087 GET http://www.squid-cache.org/favicon.ico - HIER_DIRECT/127.0.0.1 text/html
1387639209.226 0 127.0.0.1 TCP_MISS/403 4009 GET http://www.squid-cache.org/favicon.ico - HIER_NONE/- text/html
1387639209.226 1 127.0.0.1 TCP_MISS/403 4119 GET http://www.squid-cache.org/favicon.ico - HIER_DIRECT/127.0.0.1 text/html
1387650385.499 1 127.0.0.1 TCP_MISS/403 5366 POST http://de-mg42.mail.yahoo.com/ws/mail/v2.0/jsonrpc? - HIER_NONE/- text/html
1387650385.500 39 127.0.0.1 TCP_MISS/403 5476 POST http://de-mg42.mail.yahoo.com/ws/mail/v2.0/jsonrpc? - HIER_DIRECT/127.0.0.1 text/html
1387650385.528 0 127.0.0.1 TCP_MISS/403 5287 POST http://de-mg42.mail.yahoo.com/neo/logger - HIER_NONE/- text/html
1387650385.528 2 127.0.0.1 TCP_MISS/403 5397 POST http://de-mg42.mail.yahoo.com/neo/logger - HIER_DIRECT/127.0.0.1 text/html
1387650386.523 0 127.0.0.1 TCP_MISS/403 3981 GET http://orf.at/ - HIER_NONE/- text/html
1387650386.524 32 127.0.0.1 TCP_MISS/403 4091 GET http://orf.at/ - HIER_DIRECT/127.0.0.1 text/html
1387650387.293 0 127.0.0.1 TCP_MISS/403 4029 GET http://www.squid-cache.org/Artwork/SN.png - HIER_NONE/- text/html
1387650387.294 662 127.0.0.1 TCP_MISS/403 4139 GET http://www.squid-cache.org/Artwork/SN.png - HIER_DIRECT/127.0.0.1 text/html

Ein Auszug aus der cache.log sieht so aus:


2013/12/21 19:26:25.527| ERROR: No forward-proxy ports configured.
2013/12/21 19:26:25.527| ERROR: No forward-proxy ports configured.
2013/12/21 19:26:26| WARNING: Forwarding loop detected for:
GET / HTTP/1.1
Host: orf.at
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: identity,gzip,deflate
Cookie: POPUPCHECK=1387713291080
Via: 1.0 fabian-laptop (squid/3.3.8)
X-Forwarded-For: 127.0.0.1
Cache-Control: max-age=259200
Connection: keep-alive

2013/12/21 19:26:26| ERROR: No forward-proxy ports configured.
2013/12/21 19:26:26| ERROR: No forward-proxy ports configured.
2013/12/21 19:26:27| WARNING: Forwarding loop detected for:
GET /Artwork/SN.png HTTP/1.1
Host: www.squid-cache.org
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: identity,gzip,deflate
Referer: http://orf.at/
Via: 1.0 fabian-laptop (squid/3.3.8)
X-Forwarded-For: 127.0.0.1
Cache-Control: max-age=259200
Connection: keep-alive

2013/12/21 19:26:27| ERROR: No forward-proxy ports configured.
2013/12/21 19:26:27| ERROR: No forward-proxy ports configured.
2013/12/21 19:26:41.302| client_side.cc(777) swanSong: local=127.0.0.1:3128 remote=127.0.0.1:50272 flags=33
2013/12/21 19:27:25.802| client_side.cc(777) swanSong: local=127.0.0.1:3128 remote=127.0.0.1:50274 flags=33
2013/12/21 19:27:26.803| client_side.cc(777) swanSong: local=127.0.0.1:3128 remote=127.0.0.1:50275 flags=33
2013/12/21 19:27:27.804| client_side.cc(777) swanSong: local=127.0.0.1:3128 remote=127.0.0.1:50276 flags=33


Die netdb.state sieht folgendermaßen aus:


194.232.104.0 1 1 8.00000 28.00000 1387309745 1387309446 orf.at
198.186.193.0 1 1 11.00000 132.00000 1387309746 1387309446 www.squid-cache.org
194.232.104.0 1 1 8.00000 31.00000 1387390699 1387390433 orf.at
209.169.10.0 1 1 12.00000 223.00000 1387390700 1387390506 www.squid-cache.org
194.116.243.0 1 1 10.00000 21.00000 1387390806 1387390506 derstandard.at
194.232.104.0 1 1 8.00000 31.00000 1387390699 1387390433 orf.at
209.169.10.0 1 1 12.00000 223.00000 1387390700 1387390506 www.squid-cache.org
194.116.243.0 1 1 10.00000 21.00000 1387390806 1387390506 derstandard.at
194.232.104.0 1 1 8.00000 31.00000 1387390699 1387390433 orf.at
209.169.10.0 1 1 12.00000 223.00000 1387390700 1387390506 www.squid-cache.org
194.116.243.0 1 1 10.00000 21.00000 1387390806 1387390506 derstandard.at
194.232.104.0 1 1 8.00000 24.00000 1387639497 1387639197 orf.at
209.169.10.0 1 1 12.00000 224.00000 1387639497 1387639209 www.squid-cache.org
194.232.104.0 1 1 8.00000 24.00000 1387639497 1387639197 orf.at
209.169.10.0 1 1 12.00000 224.00000 1387639497 1387639209 www.squid-cache.org
194.232.104.0 1 1 8.00000 24.00000 1387639497 1387639197 orf.at
209.169.10.0 1 1 12.00000 224.00000 1387639497 1387639209 www.squid-cache.org
194.232.104.0 1 1 8.00000 24.00000 1387639497 1387639197 orf.at
209.169.10.0 1 1 12.00000 224.00000 1387639497 1387639209 www.squid-cache.org


Iptables wird als Firewall eingesetzt. iptables -L ergibt:



Chain INPUT (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere LOG level debug prefix "BANDWIDTH_IN:"

Chain FORWARD (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere LOG level debug prefix "BANDWIDTH_OUT:"
LOG all -- anywhere anywhere LOG level debug prefix "BANDWIDTH_IN:"

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere LOG level debug prefix "BANDWIDTH_OUT:"


Was mache ich falsch, dass Anfragen vom Laptop nicht lokal weitergeleitet werden?
Kann mir jemand mit der squid.conf helfen? Danke

L00NIX
30.12.13, 08:30
Hi,

Da stehe was von


2013/12/21 19:26:27| WARNING: Forwarding loop detected for ...


Wie ist denn die IP-Adresse vom Proxy und wie sieht denn die NAT-Table aus, also die Ausgabe von


# iptables -t nat -nvL


Ich vermute mal, dass der Proxy selbst via Transparent Proxy Regel auf sich selbst verbindet. Der Server mit Squid muss natürlich direkt ins Internet können, d.h. hier darf nicht geNATet werden.

Teste zuerst Squid separat und wenn das funktioniert, teste Dansguardian mit Squid als Parent Proxy.

Gruß
L00NIX