{"id":17,"date":"2007-01-26T17:24:29","date_gmt":"2007-01-26T17:24:29","guid":{"rendered":"http:\/\/patchlog.com\/general\/squid-26-transparent-proxy\/"},"modified":"2007-04-06T12:34:29","modified_gmt":"2007-04-06T12:34:29","slug":"squid-26-transparent-proxy","status":"publish","type":"post","link":"https:\/\/patchlog.com\/general\/squid-26-transparent-proxy\/","title":{"rendered":"squid 2.6 transparent proxy"},"content":{"rendered":"<p>In case you used squid 2.5 to create a transparent proxy and you decided to switch to 2.6 or this is the first time you try to set up a transparent proxy and most\/all of the tutorials out there are for squid 2.5 here is a brief howto for this setup.<\/p>\n<p>In squid 2.6 the configuration options:<br \/>\nhttpd_accel_host<br \/>\nhttpd_accel_port<br \/>\nhttpd_accel_with_proxy<br \/>\nhttpd_accel_uses_host_header<br \/>\n<span class=\"postbody\"> are not defined anymore ( see <a href=\"http:\/\/eff.bilkent.edu.tr\/pub\/infosystems\/Squid\/Versions\/v2\/2.6\/squid-2.6.STABLE9-RELEASENOTES.html#s2\" title=\"squid 2.6 release notes\">squid 2.6 release notes<\/a> ), so if you are using them in your config file squid will give you an error like \"<\/span><span class=\"postbody\">parseConfigFile: line 41 unrecognized: 'httpd_accel_host virtual'\" and will refuse to start.<\/span><\/p>\n<p>To activate transparent proxy in squid 2.6 all you have to do is use the \"tranparent\" option on http_port. Something like:<\/p>\n<blockquote><p><code>http_port 3128 transparent<\/code><\/p><\/blockquote>\n<p>Of course squid has to be compiled with transparent proxy support for netfilter (iptables) by adding  --enable-linux-netfilter to the .\/configure line, the linux kernel needs to be compiled with netfilter and you will also need a rule in iptables that will redirect packets from your local network interface with a  destination port 80 to the port squid is listening on.<\/p>\n<p>Assuming your local network interface is eth1 and squid listens on port 3128 here is the rule that has to be added to iptables:<\/p>\n<blockquote><p><code>iptables -A PREROUTING -i \"eth1\" -p tcp \u00e2\u20ac\u201cdport 80 -j REDIRECT \u00e2\u20ac\u201cto-port 3128 <\/code><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>In case you used squid 2.5 to create a transparent proxy and you decided to switch to 2.6 or this is the first time you try to set up a transparent proxy and most\/all of the tutorials out there are for squid 2.5 here is a brief howto for this setup. In squid 2.6 the &hellip; <a href=\"https:\/\/patchlog.com\/general\/squid-26-transparent-proxy\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">squid 2.6 transparent proxy<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[33,354,32],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-general","tag-proxy","tag-security","tag-squid"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pofPh-h","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":0,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"wp:attachment":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}