- DHCP
- DNS
- AD group policy enforcing PAC (Proxy Auto Configuration) file
- DHCP under using linux's isc dhcpd
This configuration is set trough the option wpad-url. Since version 3 we need to specify what code and content it has:
option wpad-url code 252 = text;
option wpad-url "http://sin-proxy-001.local.domain/proxy.pac ";
We add these lines to the dhcpd.conf and reload the service.
- DNS serving wpad
On linux, we need to add some lines in our zone with this content:
After that, reload DNS service.$ORIGIN local.domain. wpad IN A 10.9.98.2 IN TXT "service: wpad:!http://sin-proxy-001.local.domain:80/proxy.pac" wpad.tcp IN SRV 0 0 80 sin-proxy-001.local.domain.
- AD Group Policy wpad enforcing
To avoid caching problems, is better to disable that feature for the .pac file:
If our users are too naughty and they disable the proxy, we can always remove this privilege from them activating the option Make proxy settings per-machine:
We have finished the WPAD policy.
- The .PAC file
function FindProxyForURL(url, host) {
else if (shExpMatch(host, "*.myintranet.com"))
{
return "DIRECT";
}
else if (isInNet(host, "10.9.98.0", "255.255.255.0"))
{
return "PROXY sin-proxy-001.local.domain:3128";
}
else
return "PROXY sin-proxy-001.local.domain:3128; DIRECT";
}
- Web server configuration on Apache & Linux
MyServer:/etc/apache2/sites-available# cat sin-proxy-001
<VirtualHost *:80>
ServerAdmin admin@local.domain.com
ServerName sin-proxy-001.local.domain
DocumentRoot /var/www/proxy/
AddType application/x-ns-proxy-autoconfig .pac
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
ErrorLog ${APACHE_LOG_DIR}/wpad-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/wpad-access.log combined
</VirtualHost>