Hi there!
I want to build a transparent proxy with squid under SuSE Linux 9.0.
The System first:
2 NIC
eth0: for internal network traffig (ip-addr: 192.168.1.1, subnetmask: 255.255.255.0)
eth1: for external traffic, complete configuration over DHCP form ISP
---------
All machines should get their ip-configuration form my server, so i set up an DHCPD Server. This works fine. Here the config-file (dhcpd.conf)
...
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
option domain-name-servers 192.168.1.1;
####
# I am not shure if i should use the ISPs DNS here???????
####
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.30;
}
so far so good. All clients get an ip-address and an standard gateway, so they try to communicate over my linux box.
Then i set up squid. I first tried with standard config. The result:
When i config the clients browsers to access the internet over a proxy server (192.168.1.1 port 3128) everything works great.
But i want to have an transparent proxy, so the clients donīt have to change their configuration.
So i changed in squid.conf (as SuSE Handbook says)
------
httpd_accel-host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
-------
Then i set up the kernel to do ip-forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
and gave it iptables rule
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
And now the problems start:
When i type an ip-address in a clients-browser i get a squid-error page (The requested URL could not be retrieved)
When i type an url, it cannot be resolved
So i think i have some problems with the dns (as mentioned in the dhcp config already)
i think i should add an iptables rule for the dns-servers too, but i donīt know how
Any ideas?