Funktioniert mein Firefox über squid überhaupt? Wie kann ich das prüfen?

cabriofahrer

Well-Known Member
Ich habe soeben squid installiert (pkg install squid). Der Service startet m. E. korrekt, squid -z hatte ich auch dürchgeführt, An der squid.conf habe ich nichts geändert.
Normalerweise sollte der Firefox über squid laufen, wenn man in den Einstellungen manuell Proxy mit der IP 127.0.0.1 und Port 3128 eingibt. Ich habe gelesen, dass squid standardmäßig jeglichen Verkehr ins Internet blockt, also erwarte ich eigentlich, dass Firefox nicht mehr ins Internet kommt, es sei denn, ich ändere die squid.conf, richtig?
Firefox geht aber trotzdem ins Internet. Hier die squid.conf:

Code:
$ more /usr/local/etc/squid/squid.conf
#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 0.0.0.1-0.255.255.255  # RFC 1122 "this" network (LAN)
acl localnet src 10.0.0.0/8             # RFC 1918 local private network (LAN)
acl localnet src 100.64.0.0/10          # RFC 6598 shared address space (CGN)
acl localnet src 169.254.0.0/16         # RFC 3927 link-local (directly plugged) machines
acl localnet src 172.16.0.0/12          # RFC 1918 local private network (LAN)
acl localnet src 192.168.0.0/16         # RFC 1918 local private network (LAN)
acl localnet src fc00::/7               # RFC 4193 local private network range
acl localnet src fe80::/10              # RFC 4291 link-local (directly plugged) machines

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

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

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

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

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

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

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

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

# Squid normally listens to port 3128
http_port 3128

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/squid/cache 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/squid/cache

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320
$
 
Erstmal kannst Du mit `sockstat | grep 3128` nachsehen welche Prozesse den Port benutzen. Das sollten natürlich squid und firefox sein.
 
Danke! Sieht eigentlich gut aus:

Code:
 # sockstat | grep 3128
werner   firefox    848   44 tcp4   127.0.0.1:60513       127.0.0.1:3128
werner   firefox    848   68 tcp4   127.0.0.1:35020       127.0.0.1:3128
werner   firefox    848   75 tcp4   127.0.0.1:17981       127.0.0.1:3128
werner   firefox    848   86 tcp4   127.0.0.1:56412       127.0.0.1:3128
werner   firefox    848   96 tcp4   127.0.0.1:10148       127.0.0.1:3128
werner   firefox    848   126 tcp4  127.0.0.1:34991       127.0.0.1:3128
werner   firefox    848   131 tcp4  127.0.0.1:14131       127.0.0.1:3128
werner   firefox    848   133 tcp4  127.0.0.1:46527       127.0.0.1:3128
werner   firefox    843   44 tcp4   127.0.0.1:60513       127.0.0.1:3128
werner   firefox    842   44 tcp4   127.0.0.1:60513       127.0.0.1:3128
werner   firefox    837   161 tcp4  127.0.0.1:20222       127.0.0.1:3128
squid    squid      594   11 tcp46  *:3128                *:*
squid    squid      594   47 tcp4   127.0.0.1:3128        127.0.0.1:20222
?        ?          ?     ?  tcp4   127.0.0.1:63418       127.0.0.1:3128
?        ?          ?     ?  tcp4   127.0.0.1:55000       127.0.0.1:3128
?        ?          ?     ?  tcp4   127.0.0.1:3128        127.0.0.1:24782
?        ?          ?     ?  tcp4   127.0.0.1:25295       127.0.0.1:3128
?        ?          ?     ?  tcp4   127.0.0.1:48548       127.0.0.1:3128
?        ?          ?     ?  tcp4   127.0.0.1:23499       127.0.0.1:3128
?        ?          ?     ?  tcp4   127.0.0.1:18981       127.0.0.1:3128
?        ?          ?     ?  tcp4   127.0.0.1:53982       127.0.0.1:3128
?        ?          ?     ?  tcp4   127.0.0.1:56304       127.0.0.1:3128
?        ?          ?     ?  tcp4   127.0.0.1:3128        127.0.0.1:60513
?        ?          ?     ?  tcp4   127.0.0.1:3128        127.0.0.1:34991
?        ?          ?     ?  tcp4   127.0.0.1:3128        127.0.0.1:46527
?        ?          ?     ?  tcp4   127.0.0.1:3128        127.0.0.1:56412
?        ?          ?     ?  tcp4   127.0.0.1:3128        127.0.0.1:14131
?        ?          ?     ?  tcp4   127.0.0.1:3128        127.0.0.1:35020
?        ?          ?     ?  tcp4   127.0.0.1:3128        127.0.0.1:10148
?        ?          ?     ?  tcp4   127.0.0.1:3128        127.0.0.1:17981
root@virtualbox:/var/log/squid #

Lässt sich daraus entnehmen, dass Firefox doch korrekt über squid ins Internet geht? Dann nehme ich an, dass Squid standardmäßig doch Internetverbindungen zulässt, obwohl ich dann den Eintrag in der squid.conf

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

nicht ganz verstehe, weil er ja eben nicht auskommentiert ist.

Könnte mir jemand auf die Schnelle sagen, wie ich z.b eine ban list (von Webseiten) erstelle oder URL's unterbinde, die z.B. das Wort "sex" enthalten?
 
Im Firefox auf "about:config" gehen, dort nach "proxy" filtern. Dann unter "network.proxy.http" den Wert "localhost" oder "127.0.0.1" oder "::1" eintragen und unter "network.proxy.http_port" den Wert "3128" und unter "network.proxy.type" den Wert "1". Dann benutzt Dein Firefox ganz sicher den Proxy.

Pruefen kannst Du das z.B. mit einem einfachen tcpdump auf das lo Interface oder indem Du in die squid logs schaust.

Einen URL Filter kann squid alleine nicht, dafuer muesstest Du z.B. squidguard installieren, konfigurieren und die Listen regelmaessig aktualisieren. Ich nehme dafuer die Shallalist, da gibt es etliche Kategorien die weggefiltert werden koennen. Interessant: Wenn man nur "Tracker" wegfiltert, dann ist fast alle Werbung auch weg... komisch... :rolleyes:

Eine andere Moeglichkeit URLs zu blocken ist DNS basiert, sowas wie PiHole zum Beispiel.
 
Zurück
Oben