I'm having a problem with a very simple squid configuration.
My network is configured as shown:
=== 192.168.3.xxx LAN === (eth1 - .100)[proxy host](.18.240.66 - eth0) === 10.x.x.x LAN
I want to proxy requests from the 192.168.3.0/24 LAN to the 10.0.0.0/8 LAN. I've set up the proxy settings on 192.168.3.200 to use the proxy at 192.168.3.100:8080. The proxy request arrives at the proxy just fine, but it doesn't seem to go out on eth0. I've verified both of these with Wireshark.
In particular, I'm trying to send a HTTP request from 192.168.3.200 to 10.63.78.243 via the proxy. This is what ends up in the squid
192.168.3.200 TCP_MISS/000 0 GET http://10.63.78.243:8080/path/server.jsp? - DIRECT/10.63.78.243 -
The packet sent from .200 to .100:8080 has this content (via Wireshark):
GET http://10.63.78.243:8080/path/server.jsp?x=x HTTP/1.1 Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Accept-Language: en-us User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; MS-RTC LM 8) Accept-Encoding: gzip, deflate Proxy-Connection: Keep-Alive Host: 10.63.78.243:8080
I have the following squid configuration:
# # Recommended minimum configuration: # acl manager proto cache_object acl localhost src 127.0.0.1/32 ::1 acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 # Example rule allowing access from your local networks. # Adapt to list your (internal) IP networks from where browsing # should be allowed acl localnet src 10.0.0.0/8 # RFC1918 possible internal network acl localnet src 172.16.0.0/12 # RFC1918 possible internal network acl localnet src 192.168.0.0/16 # RFC1918 possible internal network acl localnet src fc00::/7 # RFC 4193 local private network range acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines acl RDnet dst 10.0.0.0/8 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: # # Only allow cachemgr access from localhost http_access allow manager localhost http_access deny manager # 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 # 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 http_access allow RDnet # And finally deny all other access to this proxy http_access deny all # Squid normally listens to port 3128 http_port 8080 # We recommend you to use at least the following line. hierarchy_stoplist cgi-bin ? # Uncomment and adjust the following to add a disk cache directory. #cache_dir ufs /var/spool/squid 100 16 256 # Leave coredumps in the first cache dir coredump_dir /var/spool/squid # 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
netstat -rn gives the following:
[root@localhost squid]# netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0 10.18.240.0 0.0.0.0 255.255.248.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 0.0.0.0 10.18.247.254 0.0.0.0 UG 0 0 0 eth0
I read that as routing any packet (including those to 10.63.78.243) to 10.18.247.254 via eth0. I know it's reachable (see this output of
[root@localhost squid]# ping -c 1 -R 10.63.78.243 PING 10.63.78.243 (10.63.78.243) 56(124) bytes of data. 64 bytes from 10.63.78.243: icmp_seq=1 ttl=50 time=377 ms RR: 10.18.240.66 10.138.156.186 10.17.182.22 10.190.11.66 22.214.171.124 198.19.1.41 10.143.222.81 10.143.222.98 172.31.206.129 --- 10.63.78.243 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 377ms rtt min/avg/max/mdev = 377.644/377.644/377.644/0.000 ms
Any thoughts? One thought I'm having is that Squid receives the request just fine and tries to send it but.... Where might it be going? This host only has the 2 interfaces, and packets to 10.x.x.x should be going out eth0. But no packet shows up in Wireshark. So I'm a little lost.
UPDATE: Added the following to the configuration file:
cache_peer 10.159.3.23 parent 8080 0 default
That allowed my proxy to forward requests to the proxy that actually can reach the 10.63.78.243 host.