{"id":1683,"date":"2014-03-21T09:33:52","date_gmt":"2014-03-21T16:33:52","guid":{"rendered":"http:\/\/xiehang.com\/blog\/?p=1683"},"modified":"2014-03-21T09:34:25","modified_gmt":"2014-03-21T16:34:25","slug":"squids-outgoing-ip-round-robin","status":"publish","type":"post","link":"https:\/\/xiehang.com\/blog\/2014\/03\/21\/squids-outgoing-ip-round-robin\/","title":{"rendered":"Squid’s outgoing IP round robin"},"content":{"rendered":"

Start from squid 3.2, as mentioned here<\/a>, you can use random acl. This helps me achieve my goal to round-robin outgoing IP address as follow:<\/p>\n

[raw]
\nacl one_fourth_1 random 1\/4
\nacl one_fourth_2 random 1\/3
\nacl one_fourth_3 random 1\/2
\nacl one_fourth_4 random 1\/1<\/p>\n

tcp_outgoing_address xxx.xxx.xxx.203 one_fourth_1
\ntcp_outgoing_address xxx.xxx.xxx.204 one_fourth_2
\ntcp_outgoing_address xxx.xxx.xxx.205 one_fourth_3
\ntcp_outgoing_address xxx.xxx.xxx.206 one_fourth_4
\n[\/raw]<\/p>\n

Sure you need to have all these IPs configured on your server.<\/p>\n","protected":false},"excerpt":{"rendered":"

Start from squid 3.2, as mentioned here, you can use random acl. This helps me achieve my goal to round-robin outgoing IP address as follow: [raw] acl one_fourth_1 random 1\/4 acl one_fourth_2 random 1\/3 acl one_fourth_3 random 1\/2 acl one_fourth_4 random 1\/1 tcp_outgoing_address xxx.xxx.xxx.203 one_fourth_1 tcp_outgoing_address xxx.xxx.xxx.204 one_fourth_2 tcp_outgoing_address xxx.xxx.xxx.205 one_fourth_3 tcp_outgoing_address xxx.xxx.xxx.206 one_fourth_4 [\/raw] […]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[485,108,486,481],"_links":{"self":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1683"}],"collection":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/comments?post=1683"}],"version-history":[{"count":2,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1683\/revisions"}],"predecessor-version":[{"id":1685,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1683\/revisions\/1685"}],"wp:attachment":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/media?parent=1683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/categories?post=1683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/tags?post=1683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}