I am setting this up at home, and am having some squid problems. I have it such that the wireless is available, but once I try to run it through squid, I get some problems.
I have an Ubuntu box with two NICs, eth0 (192.168.2.107) goes to the internet, and eth1 (192.168.5.1) goes to the wireless router. I want to flip all the images on the eth1 traffic.
I do this to set up my iptables:
---------------------------------------------------------------
#clear all
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
#set up NAT
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
#sent to Squid proxy
iptables --table nat --append PREROUTING --in-interface eth1 -p tcp --dport 80 -j DNAT --to 192.168.2.107:80
---------------------------------------------------------------
Everything works fine up until that last line (Namely, I can connect via wireless and browse the web, unflipped). Once I enter that line, I start seeing squid errors on the wireless clients:
------------------------------------------------------
ERROR
The requested URL could not be retrieved
While trying to process the request:
GET / HTTP/1.1
Host: 192.168.2.107
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: testing=1; sid=9228a96093acf06258d85d007c1c4495
The following error was encountered:
* Invalid Request
Some aspect of the HTTP Request is invalid. Possible problems:
* Missing or unknown request method
* Missing URL
* Missing HTTP Identifier (HTTP/1.0)
* Request is too large
* Content-Length missing for POST or PUT requests
* Illegal character in hostname; underscores are not allowed
Your cache administrator is webmaster.
Generated Sun, 14 Jan 2007 03:47:33 GMT by ubuntu (squid/2.6.STABLE1)
-----------------------------------------------------------
I put some debug statements in the redirect.pl, and as far as I can tell, it runs, but never gets into the while loop.
My squid access.log looks like this:
1168736881.462 1 192.168.5.2 TCP_DENIED/400 1672 GET error:invalid-request - NONE/- text/html
Any ideas?