Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I got Squid3 running on my MyBookLive (Debian Squeeze). I succesfully installed Squid3 but it stops serving http requests after some time, https does still work. If I check the access.log I see something like this multiple times:

1395679077.078   5250 10.0.0.2 TCP_MISS/000 0 GET http://10.0.0.2:3128/space - DIRECT/10.0.0.2 -
1395679077.080   5250 10.0.0.2 TCP_MISS/000 0 GET http://10.0.0.2:3128/space - DIRECT/10.0.0.2 -
1395679077.083   5250 10.0.0.2 TCP_MISS/000 0 GET http://10.0.0.2:3128/space - DIRECT/10.0.0.2 -
1395679077.083   5247 10.0.0.2 TCP_MISS/000 0 GET http://10.0.0.2:3128/space - DIRECT/10.0.0.2 -
1395679077.084   5245 10.0.0.2 TCP_MISS/000 0 GET http://10.0.0.2:3128/space - DIRECT/10.0.0.2 -
1395679077.085   5243 10.0.0.2 TCP_MISS/000 0 GET http://10.0.0.2:3128/space - DIRECT/10.0.0.2 -

And if I just keep refreshing, nothing gets added to the log so it makes me believe that Squid3 is not receiving anything.

Furthermore, I am using the default Squid3 config with the following edits:

http_port 3128 transparent
acl localnet src 10.0.0.0/24
http_access allow localnet
http_access allow localhost

Here is the complete config file in a paste: http://pastebin.com/5pvR7dYY

EDIT

cache.log:

2014/03/24 17:37:56| IpIntercept.cc(137) NetfilterInterception:  NF getsockopt(SO_ORIGINAL_DST) failed on FD 1912: (92) Protocol not available
2014/03/24 17:37:56| WARNING: Forwarding loop detected for:
GET /space HTTP/1.1
Host: 10.0.0.2:3128
Via: 1.0 server01 (squid/3.1.6), 1.1 server01 (squid/3.1.6), 1.1 server01 (squid/3.1.6), 1.1 server01 (squid/3.1.6), 1.1 server01 (squid/3.1.6), 1.1 server01 (sq$
X-Forwarded-For: 10.0.0.1, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0.0.2, 10.0$
Cache-Control: max-age=259200
Connection: keep-alive

iptables in my dd-wrt router:

PROXY_IP=10.0.0.2
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 --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i br0 -s ! $PROXY_IP -p tcp --dport 80 -j DNAT --to $PROXY_IP:$PROXY_PORT
iptables -t nat -I POSTROUTING -o br0 -s $LAN_NET -d $PROXY_IP -p tcp -j SNAT --to $LAN_IP
iptables -I FORWARD -i br0 -o br0 -s $LAN_NET -d $PROXY_IP -p tcp --dport $PROXY_PORT -j ACCEPT
share|improve this question
    
looks like you have a forwarding loop on 10.0.0.2 , see comfsm.fm/computing/squid/FAQ-11.html#ss11.31 –  LinuxDevOps Mar 24 at 17:27
    
@LinuxDevOps I don't quite understand how, I only have one cache and that's on 10.0.0.2. I also have the visible_hostname directive set in the conf. –  NullBy7e Mar 24 at 17:30
    
The log files are very telling about the loop. It may come from the iptables rules which are confusing with just one interface br0; you may want to create a new (alias/dummy) interface to distinguish incoming from outgoing traffic. To debug the current iptables rules and traffic flow you can use tcpdump or iptables' LOG facility. –  LinuxDevOps Mar 24 at 17:55
    
@LinuxDevOps I wouldn't know where to start honestly, before, when I had Squid3 on my HP Thin Client running Ubuntu 10.04, it worked good and without forwarding loops. –  NullBy7e Mar 24 at 18:04
    
@LinuxDevOps Ah I see where your going, I got the iptables code from dd-wrt forums and it was confirmed to be working by a poster there. So how can this be changed then? Gosh I wish I knew iptables more..I am just not much of a sysadmin lol. –  NullBy7e Mar 24 at 18:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.