我正在为我的networkingconfiguration一个内容filter。 我有squidgaurdconfiguration和工作。 我想让所有的客户使用它。 这包括我无法控制的客户(BYOD等)。 我如何让所有stream量通过代理?
另一种select是使用dhcp选项252并将URL设置为自动代理configuration脚本。 或者,您也可以使用代理设置来设置URL http://wpad/wpad.dat 。 或者你可以做到这一点。 DNS方法通常更受支持。
这取决于能够以这种方式设置DHCP服务器和支持自动代理configuration的客户端的选项。 Windows和Mac客户端应该可以正常工作。 据报道,iPad在这方面并没有专门的经验,也不了解Android。 PAC文件的格式如下
function FindProxyForURL(url, host) { // If the hostname matches, send direct. if (dnsDomainIs(host, ".intranet.domain.com") || shExpMatch(host, "(*.abcdomain.com|abcdomain.com)")) return "DIRECT"; // If the protocol or URL matches, send direct. if (url.substring(0, 4)=="ftp:" || shExpMatch(url, "http://abcdomain.com/folder/*")) return "DIRECT"; // If the requested website is hosted within the internal network, send direct. if (isPlainHostName(host) || shExpMatch(host, "*.local") || isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") || isInNet(dnsResolve(host), "172.16.0.0", "255.240.0.0") || isInNet(dnsResolve(host), "192.168.0.0", "255.255.0.0") || isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0")) return "DIRECT"; // If the IP address of the local machine is within a defined // subnet, send to a specific proxy. if (isInNet(myIpAddress(), "10.10.5.0", "255.255.255.0")) return "PROXY 1.2.3.4:8080"; // DEFAULT RULE: All other traffic, use below proxies, in fail-over order. return "PROXY 4.5.6.7:8080; PROXY 7.8.9.10:8080"; }
查看http://findproxyforurl.com/example-pac-file/这个例子来自哪里。 你的可能会简单得多。
configuration您的路由器使用您的squidguard机器作为“透明代理”。 您没有提到您用于路由器的内容,但是如果支持该function,则可能会有一个Web上的教程,用于将其configuration为与代理服务器配合使用。
您可以将squidconfiguration为透明caching代理。 其实际上应用fw规则来将所有分组从networking端口80转发到鱿鱼端口。
鱿鱼的示例configuration。
httpd_accel_host virtual httpd_accel_port 80 httpd_accel_with_proxy on httpd_accel_uses_host_header on acl lan src 192.168.1.1 192.168.2.0/24 http_access allow localhost http_access allow lan
iptables规则来激活。
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to 192.168.1.1:3128 iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
如果你使用的是鱿鱼authentication,你必须牺牲,因为这是一个networking通信的拦截方式。 来源在这里 。