WPAD(Web Proxy Auto-Discovery Protocol)是一个可以利用 dhcp 分发 pac 配置的协议。方法如下:

$ # ssh to router first
$ vim /etc/dnsmasq.conf
dhcp-option=252,"http://router_ip/wpad.dat"
$ vim /www/wpad.dat # put pac here
$ service dnsmasq restart
$ # ensure proxy is available to lan
$ # enable wpad on devices

参考文档:

  1. Web Proxy Auto-Discovery Protocol
  2. Automatic Proxy Configuration with WPAD
  3. Deploying WPAD
  4. Example PAC File