Saturday, July 02, 2011

To configure Squid/WPAD supports IPv6 on RHEL6

首先你必須知道如何在RHEL6下配置IPv6的環境, 你可以參考以下的文章來設定:

至於什麼是WPAD, 以及如何設定WPAD則可參考以下文章:

再來開始設定Squid/WPAD支援IPv6:
1. Prepare: Squid 3.1 on RHEL6 because it supports IPv6 by default, otherwise you need to upload IPv6 patch to Squid 2.x version.

2. Configure IPv6 in Squid 3.1:
In /etc/squid/squid.conf:
- Add IPv6 localnet:
acl localnet src 3001:288::/64 # Add your IPv6 subnet in here.
- Allow localnet:
http_access allow localnet
-Restart Squid:
# /etc/init.d/squid restart; chkconfig squid on

3. Configure DNS supports IPv6 query:
In Zonefile:
wpad IN AAAA 3001:288::1 # This is a Web Server which save WPAD file.
proxy IN AAAA 3001:288::2 # This is a Proxy Server.


4. Configure WPAD file:
function FindProxyForURL(url, host) {

if (host == "localhost" ||
host == "localhost.localdomain" ||
host == "127.0.0.1" || host == "[3001:288::3]" || host == "10.10.2.2" ) {
return "DIRECT";
// Requests to localhost, 3001:288::3, and 10.10.2.2 will not redirect to proxy
}
// All other requests go through the local squid proxy
return "PROXY proxy.example.com:8080; DIRECT";
}
That's all.

No comments: