{"id":55,"date":"2007-10-05T10:54:39","date_gmt":"2007-10-05T08:54:39","guid":{"rendered":"http:\/\/blog.robinward.com\/?p=55"},"modified":"2013-08-15T15:18:22","modified_gmt":"2013-08-15T14:18:22","slug":"squid_acl-generate-arplist-from-dhcpconf","status":"publish","type":"post","link":"https:\/\/robinward.com\/?p=55","title":{"rendered":"[q&#038;d]: Generating a squid acl arplist from dhcp.conf"},"content":{"rendered":"<p>Here is a quick and dirty method for creating an arplist for a squid acl rule from static dhcp.conf entries:<br \/>\n<code><\/code><\/p>\n<p><code>cat \/etc\/dhcp3\/dhcp.conf | grep 00: | cut -d \" \" -f5 | cut -d \";\" -f1 &gt; \/etc\/squid\/arplist<br \/>\n<\/code><\/p>\n<p>Lets take a closer look at a default dhcp.conf entry for static adressing:<\/p>\n<p><strong><code>host mypc {<br \/>\nhardware ethernet 00:01:02:03:04:05;<br \/>\nfixed-address 192.168.1.10;<br \/>\n}<\/code><\/strong><\/p>\n<ul>\n<li>grep will fish out the mac addresses with the identifier 00:<\/li>\n<li>the first cut will reduce output to 00:01:02:03:04:05;<\/li>\n<li>the second cut removes the semi column from the output<\/li>\n<li>output is written into a file<\/li>\n<\/ul>\n<p>If you are using customized config files, you will need to apply the command properly (duh!)<\/p>\n<p><u>Including the acl list in your squid.conf<\/u><br \/>\n<code><\/code><\/p>\n<p><code>acl mylist arp \"\/etc\/squid\/arplist\"<br \/>\nhttp_access allow <\/code><code>mylist<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a quick and dirty method for creating an arplist for a squid acl rule from static dhcp.conf entries: cat \/etc\/dhcp3\/dhcp.conf | grep 00: | cut -d &#8221; &#8221; -f5 | cut -d &#8220;;&#8221; -f1 &gt; \/etc\/squid\/arplist Lets take a closer look at a default dhcp.conf entry for static adressing: host mypc { hardware &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/robinward.com\/?p=55\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;[q&#038;d]: Generating a squid acl arplist from dhcp.conf&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-55","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/robinward.com\/index.php?rest_route=\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/robinward.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robinward.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robinward.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/robinward.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=55"}],"version-history":[{"count":1,"href":"https:\/\/robinward.com\/index.php?rest_route=\/wp\/v2\/posts\/55\/revisions"}],"predecessor-version":[{"id":798,"href":"https:\/\/robinward.com\/index.php?rest_route=\/wp\/v2\/posts\/55\/revisions\/798"}],"wp:attachment":[{"href":"https:\/\/robinward.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robinward.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robinward.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}