我希望为我的网络配置一个内容过滤器。我已经配置了squidGuard并在工作。我想让所有的客户使用它。这包括我无法控制的客户(BYOD等)。我如何让所有的流量通过代理?
发布于 2015-03-08 01:36:07
另一个选项是使用dhcp选项252并将URL设置为自动代理配置脚本。或者,您也可以使用代理设置设置一个URL http://wpad/wpad.dat。或者你可以两者兼得。DNS方法通常更受支持。
这取决于是否能够以这种方式设置dhcp服务器和支持自动代理配置的客户端的选项。Windows和Mac客户端应该可以正常工作。据报道,iPads在这方面没有工作经验,而且对安卓系统也不确定。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/。你的可能会简单得多。
发布于 2015-03-07 17:57:52
配置您的路由器使用您的鱿鱼守卫机器作为一个‘透明的代理’。您没有提到用于路由器的内容,但是如果它被支持,可能会在web上提供一个教程来配置它以用于代理服务器。
发布于 2015-03-07 18:12:17
您可以将squid配置为透明缓存代理。它实际上是应用fw规则将所有数据包从web端口80转发到squid端口。
鱿鱼的样例配置。
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 lanIptables规则来激活。
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如果您使用squid身份验证,则必须牺牲,因为这是一种拦截网络通信的方式。源为这里。
https://serverfault.com/questions/673733
复制相似问题