{"id":406,"date":"2009-12-10T15:42:52","date_gmt":"2009-12-10T20:42:52","guid":{"rendered":"http:\/\/it.thelibrarie.com\/weblog\/?p=406"},"modified":"2009-12-10T15:42:52","modified_gmt":"2009-12-10T20:42:52","slug":"block-dns-dd-wrt","status":"publish","type":"post","link":"https:\/\/it.thelibrarie.com\/weblog\/2009\/12\/block-dns-dd-wrt\/","title":{"rendered":"Block DNS DD-WRT"},"content":{"rendered":"<p>Here&#8217;s the project:<br \/>\nSecure a wireless access point for vendors\/non-work-computers to use.  Disallow access to anything that eats up bandwidth &#8211; it&#8217;s supposed to be a tool and not a play thing.<\/p>\n<p>Background:<br \/>\nA primary internet connection has 62 public IP addresses.  One is pointed to a WRT54-G (v1) router.  I installed dd-wrt (v24 preSP2 build 13064) and configured accordingly.  I signed up for OpenDNS service to block all the &#8220;bad stuff&#8221;.<\/p>\n<p>Problem:<br \/>\nMerely putting in the DNS information into the DHCP server is not enough.  Any savvy tech user can add their own DNS information into the equation and go from there.  I needed a way to block DNS (port 53) on the router side of things so that no outside influences could bypass the security.  DD-WRT was configured to block port 53, but that didn&#8217;t really work out too well.  So I ended up adding my own iptable chain to the router not to block other DNS, but to force it to go through the router&#8217;s DNS.  Makes things easier in the long run.<\/p>\n<p>Solution:<\/p>\n<blockquote><p>Log into the router<br \/>\nClick on the Administration Tab<br \/>\nClick on the Commands Tab<br \/>\nIn the commands box, paste the following:<br \/>\n<code>iptables -t nat -A PREROUTING -p udp -i br0 --dport 53 -j DNAT --to $(nvram get lan_ipaddr)<\/code><br \/>\n<code>iptables -t nat -A PREROUTING -p tcp -i br0 --dport 53 -j DNAT --to $(nvram get lan_ipaddr)<\/code><br \/>\nClick Save Firewall<\/p><\/blockquote>\n<p>After it reboots, test it out.  Use 4.2.2.2 as a test DNS server to verify.  Awesome, I know.<\/p>\n<p>Security:<br \/>\nWRT54-G running DD-WRT with a non-standard password<br \/>\nSSID is not being broadcast<br \/>\nWPA2 Personal with AES Encryption<br \/>\nWRT54-G is connected to a portion of the main internet pipe on a public IP but is VLAN&#8217;d off from the rest of the network<br \/>\nDD-WRT admin access is not allowed over the WLAN<br \/>\nOpenDNS is blocking almost all access<br \/>\nDD-WRT does NOT allow connections before 7AM, after 7PM, or on weekends<br \/>\nI&#8217;m wearing pants<\/p>\n<p>OK, had to lighten the mood a little bit.  But that&#8217;s the gist of it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s the project: Secure a wireless access point for vendors\/non-work-computers to use. Disallow access to anything that eats up bandwidth &#8211; it&#8217;s supposed to be a tool and not a play thing. Background: A primary internet connection has 62 public IP addresses. One is pointed to a WRT54-G (v1) router. I installed dd-wrt (v24 preSP2 &hellip; <a href=\"https:\/\/it.thelibrarie.com\/weblog\/2009\/12\/block-dns-dd-wrt\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Block DNS DD-WRT<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-406","post","type-post","status-publish","format-standard","hentry","category-networking"],"_links":{"self":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/comments?post=406"}],"version-history":[{"count":1,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/406\/revisions"}],"predecessor-version":[{"id":407,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/406\/revisions\/407"}],"wp:attachment":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/media?parent=406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/categories?post=406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/tags?post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}