{"id":1766,"date":"2017-12-26T19:18:51","date_gmt":"2017-12-26T18:18:51","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=1766"},"modified":"2019-07-23T14:39:05","modified_gmt":"2019-07-23T12:39:05","slug":"dd-wrt-and-linksys-wrt1200ac","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=1766","title":{"rendered":"DD-WRT and Linksys WRT1200ac"},"content":{"rendered":"<p>Lately I decided to flash my Linksys wrt1200ac with dd-wrt as Linksys obviously dropped support for this nice hardware (no more firmware updates for a long time).<br \/>\nNot to mention that the vendor firmware is extremely basic (not to say limited&#8230;).<\/p>\n<p>Once I had flashed the device with the proper firmware, next step for me was to monitor bandwidth from my domotic\/monitoring box (jeedom).<\/p>\n<p>The most obvious track was snmp (dd-wrt feature) &#8211; Helas, the snmp daemon does not implement counter64 snmp values so this is useless.<br \/>\nNext step was to use some curl\/awk\/grep script like curl -u root:password http:\/\/192.168.1.250\/Status_Internet.asp, etc but the web pages heavily rely on javascript so here again, curl was a dead end.<\/p>\n<p>I finally resorted to remotely read values from the device nvram using a script around ssh : not the most elegant way, but the only one I could work out.<\/p>\n<p>The below will retrieve the day\/month\/year value from my Linksys wrt1200ac based on dd-wrt.<br \/>\nNote, I had to use ssh-keygen &amp; ssh-copy-id to be able to ssh without having to provide a password.<br \/>\nOr alternatively, copy the root id_rsa.pub public key to the wrt authorized keys (tip: use sudo su on rpi to switch to your root account).<\/p>\n<pre>#!\/bin\/bash\r\nread YYYY MM DD &lt;&lt;&lt;$(date +'%Y %m %d')\r\n#echo 'nvram get traff-'$MM'-'$YYYY\r\nsudo ssh root@192.168.1.250 -q 'nvram get traff-'$MM'-'$YYYY | awk '{print $'$DD'}' | awk -F \":\" '{print $1}'\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Lately I decided to flash my Linksys wrt1200ac with dd-wrt as Linksys obviously dropped support for this nice hardware (no more firmware updates for a long time). Not to mention that the vendor firmware is extremely basic (not to say limited&#8230;). Once I had flashed the device with the proper firmware, next step for me <a href='https:\/\/labalec.fr\/erwan\/?p=1766' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[90,91],"class_list":["post-1766","post","type-post","status-publish","format-standard","hentry","category-network","tag-dd-wrt","tag-wrt1200ac","category-5-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1766"}],"version-history":[{"count":4,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1766\/revisions"}],"predecessor-version":[{"id":2152,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1766\/revisions\/2152"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}