Squid auf Router konfigurieren

firefox89

Enthusiast
Thread Starter
Mitglied seit
22.08.2005
Beiträge
993
Ort
Köln
Hallo zusammen,

ich stecke gerade fest und komme nicht wirklich weiter.

was ich vor habe:
Auf meinem Router (Tomatousb) einen Proxy-Server konfigurieren, über den der Traffic von meinem Notebook geleitet wird. (Ich weiß VPN ist ne Lösung, kann ich aber unter bestimmten Umständen nicht benutzen)

Squid an sich hab ich schon installiert und es startet auch, aber ich komme mit der Konfiguration einfach nicht zurecht.

die squid.config kommt an sich aus dem dd-wrt Forum

Code:
cache_effective_user nobody 
cache_mgr bigbrother@unslung_squid  
visible_hostname ddwrt 

#cache_replacement_policy heap LFUDA  duno why dont work with 2.6 
#memory_replacement_policy LFUDA      same 

ipcache_size 2048 
cache_swap_low 90 
cache_swap_high 95 
maximum_object_size_in_memory 100 KB 

#If you have 64/8MB Router you can use 16MB cache_mem if smaler router use 8MB 
cache_mem 16 MB 

#this is cachedir you can change if you want. 400 meams 400MB cache. size you can change what you want 
cache_dir ufs /opt/var/squid/cache 400 16 256 

logfile_rotate 10 
fqdncache_size 2048 
memory_pools off 
maximum_object_size 16384 KB 
quick_abort_min 0 KB 
quick_abort_max 0 KB 
log_icp_queries off 
client_db off 
buffered_logs on 
half_closed_clients off 
negative_dns_ttl 10 second            
connect_timeout 60 second              
read_timeout 80 second 
request_timeout 80 second 

#Logs you can change dir what you want 
cache_access_log /opt/var/squid/logs/access.log 
cache_log /opt/var/squid/logs/debug 
cache_store_log /opt/var/squid/logs/storage 

hierarchy_stoplist on 

#Proxy Ip same as ddwrt RuterIp. change how you want 
http_port 192.168.1.1:3128 transparent 

# Global ACL-Definitions (Access control lists) 
acl idents ident REQUIRED 
acl manager proto cache_object 
acl localhost src 127.0.0.1/255.255.255.255 
acl all src 0.0.0.0/0.0.0.0 
acl intern dst 192.168.1.0/255.255.255.0 
acl FTP proto FTP 
always_direct allow FTP 

#Allowed working outgoing Ports and LanIps 
acl Allowed_Ports port 80 99 443 21 563 488 777 210 1025-65535 
acl yourLAN src 192.168.1.0/255.255.255.0  

#http_access definition 
http_access allow idents 
http_access allow all 
http_access allow intern 
http_access deny manager all 
http_access allow yourLAN 
http_access deny all 
icp_access deny all 
miss_access allow all 
always_direct allow intern

Router-IP bei http_port ist die richtige und auch den port will ich erstmal lassen.

Daraufhin hab ich noch nen script unter Firewall im GUI eingefügt
Code:
#!/bin/sh
PROXY_IP=192.168.1.1
PROXY_PORT=3128
LAN_IP=`nvram get lan_ipaddr`
LAN_NET=$LAN_IP/`nvram get lan_netmask`

iptables -t nat -A PREROUTING -i br0 -s $LAN_NET -d $LAN_NET -p tcp  014dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i br0 -s ! $PROXY_IP -p tcp  014dport 80 -j DNAT  014to $PROXY_IP:$PROXY_PORT
iptables -t nat -I POSTROUTING -o br0 -s $LAN_NET -d $PROXY_IP -p tcp -j SNAT  014to $LAN_IP
iptables -I FORWARD -i br0 -o br0 -s $LAN_NET -d $PROXY_IP -p tcp  014dport $PROXY_PORT -j ACCEPT

auch hier sind IP oder Port richtig.

Aber ich bekomm an meinem Laptop einfach keine verindung zu stande.

Nen paar Fragen hab ich aber noch, vllt ist die Lösung ja dabei.

Kann ich als Proxy-Adresse auch eine DynDns Adresse eintragen?
Muss ich nicht ne Weiterleitung auf den Router selbst einrichten? Woher weiß der Proxy dann, dass der Port 3128 offen ist?

Gruß jonas
 
Hardwareluxx setzt keine externen Werbe- und Tracking-Cookies ein. Auf unserer Webseite finden Sie nur noch Cookies nach berechtigtem Interesse (Art. 6 Abs. 1 Satz 1 lit. f DSGVO) oder eigene funktionelle Cookies. Durch die Nutzung unserer Webseite erklären Sie sich damit einverstanden, dass wir diese Cookies setzen. Mehr Informationen und Möglichkeiten zur Einstellung unserer Cookies finden Sie in unserer Datenschutzerklärung.


Zurück
Oben Unten refresh