工作中的Squid服务器正被用于通过多个外部IP地址路由请求。 我在Unix.SE上用自己的问题做了一个名为IP的路由。 如果自定义标题没有设置,我现在需要添加的另一个难题是随机select。
我知道有一个“随机”指令会根据概率设置一个ACL,但在线示例最好是粗略的。
我需要一种方法来将所有stream量随机分配到20个IP地址,除非设置了特定的头部,此时头部(又名ACL)应该优先并强制出站IP地址。 我怎样才能做到这一点在鱿鱼的ACL?
我不是一个鱿鱼专家,但我已经使用它一点点,认为这可能工作。
acl random1 random 1/20 acl random2 random 1/20 acl random3 random 1/20 acl random4 random 1/20 acl random5 random 1/20 acl random6 random 1/20 acl random7 random 1/20 acl random8 random 1/20 acl random9 random 1/20 acl random10 random 1/20 acl random11 random 1/20 acl random12 random 1/20 acl random13 random 1/20 acl random14 random 1/20 acl random15 random 1/20 acl random16 random 1/20 acl random17 random 1/20 acl random18 random 1/20 acl random19 random 1/20 acl random20 random 1/20 acl prio1 req_header priohdr 1 acl prio2 req_header priohdr 2 acl prio3 req_header priohdr 3 acl prio4 req_header priohdr 4 acl prio5 req_header priohdr 5 acl prio6 req_header priohdr 6 acl prio7 req_header priohdr 7 acl prio8 req_header priohdr 8 acl prio9 req_header priohdr 9 acl prio10 req_header priohdr 10 acl prio11 req_header priohdr 11 acl prio12 req_header priohdr 12 acl prio13 req_header priohdr 13 acl prio14 req_header priohdr 14 acl prio15 req_header priohdr 15 acl prio16 req_header priohdr 16 acl prio17 req_header priohdr 17 acl prio18 req_header priohdr 18 acl prio19 req_header priohdr 19 acl prio20 req_header priohdr 20 tcp_outgoing_address 10.0.0.1 random1 tcp_outgoing_address 10.0.0.2 random2 tcp_outgoing_address 10.0.0.3 random3 tcp_outgoing_address 10.0.0.4 random4 tcp_outgoing_address 10.0.0.5 random5 tcp_outgoing_address 10.0.0.6 random6 tcp_outgoing_address 10.0.0.7 random7 tcp_outgoing_address 10.0.0.8 random8 tcp_outgoing_address 10.0.0.9 random9 tcp_outgoing_address 10.0.0.10 random10 tcp_outgoing_address 10.0.0.11 random11 tcp_outgoing_address 10.0.0.12 random12 tcp_outgoing_address 10.0.0.13 random13 tcp_outgoing_address 10.0.0.14 random14 tcp_outgoing_address 10.0.0.15 random15 tcp_outgoing_address 10.0.0.16 random16 tcp_outgoing_address 10.0.0.17 random17 tcp_outgoing_address 10.0.0.18 random18 tcp_outgoing_address 10.0.0.19 random19 tcp_outgoing_address 10.0.0.20 random20 tcp_outgoing_address 10.0.0.1 prio1 tcp_outgoing_address 10.0.0.2 prio2 tcp_outgoing_address 10.0.0.3 prio3 tcp_outgoing_address 10.0.0.4 prio4 tcp_outgoing_address 10.0.0.5 prio5 tcp_outgoing_address 10.0.0.6 prio6 tcp_outgoing_address 10.0.0.7 prio7 tcp_outgoing_address 10.0.0.8 prio8 tcp_outgoing_address 10.0.0.9 prio9 tcp_outgoing_address 10.0.0.10 prio10 tcp_outgoing_address 10.0.0.11 prio11 tcp_outgoing_address 10.0.0.12 prio12 tcp_outgoing_address 10.0.0.13 prio13 tcp_outgoing_address 10.0.0.14 prio14 tcp_outgoing_address 10.0.0.15 prio15 tcp_outgoing_address 10.0.0.16 prio16 tcp_outgoing_address 10.0.0.17 prio17 tcp_outgoing_address 10.0.0.18 prio18 tcp_outgoing_address 10.0.0.19 prio19 tcp_outgoing_address 10.0.0.20 prio20
将10.0.0.X更改为您的传出连接的IP地址,显然这些地址需要在系统上可用,因此它们需要是静态ips。
最后将10.0.0.1更改为您想要使用的stream量w /头设置的任何连接。
浏览器的头文件需要具有指定的名称,并且内容与正则expression式匹配。
再次我不是专家,但它值得一去。
也就是说,这20个机会中有20个匹配随机概率,理论上它必须匹配一个,但是不能保证,所以第一行应该设置默认连接。
编辑:
更新以允许连接select,它需要testing,因为我不能100%肯定它会按需要工作。