{"id":213,"date":"2017-08-31T14:33:53","date_gmt":"2017-08-31T14:33:53","guid":{"rendered":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/?p=213"},"modified":"2017-08-31T14:33:53","modified_gmt":"2017-08-31T14:33:53","slug":"building-a-router-with-the-banana-pi-r1-part-2","status":"publish","type":"post","link":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/en\/2017\/08\/31\/building-a-router-with-the-banana-pi-r1-part-2\/","title":{"rendered":"Building a router with the Banana Pi <span class=\"caps\">R1<\/span> \u2014 part&nbsp;2"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class><span class=\"eztoc-hide\" style=\"display:none;\">Tog\u00adgle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\" \/><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\" \/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1 \"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/en\/2017\/08\/31\/building-a-router-with-the-banana-pi-r1-part-2\/#Operating_System_installation\">Oper\u00adat\u00ading Sys\u00adtem installation<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/en\/2017\/08\/31\/building-a-router-with-the-banana-pi-r1-part-2\/#What_options_do_I_have\">What options do I&nbsp;have?<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/en\/2017\/08\/31\/building-a-router-with-the-banana-pi-r1-part-2\/#Available_Linux_kernel_based_distributions\">Avail\u00adable Lin\u00adux ker\u00adnel based distributions<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/en\/2017\/08\/31\/building-a-router-with-the-banana-pi-r1-part-2\/#Basic_configuration\">Basic con\u00adfig\u00adu\u00adra\u00adtion<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Operating_System_installation\"><\/span>Operating System installation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<blockquote><p>This is the sec\u00adond part of the arti\u00adcle series <strong>Build\u00ading a router with the Banana Pi <span class=\"caps\">R1<\/span><\/strong>. To view the first part, <a href=\"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/en\/2017\/08\/10\/building-a-router-with-banana-pi-r1-part-1\/\">click here<\/a>.<\/p><\/blockquote>\n<h3>What options do I&nbsp;have?<\/h3>\n<p>The Banana Pi <span class=\"caps\">R1<\/span>, as stat\u00aded in <a href=\"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/en\/2017\/08\/10\/building-a-router-with-banana-pi-r1-part-1\/\">part 1<\/a>, is based on the All\u00adwin\u00adner <span class=\"caps\">A20<\/span> SoC (Sys\u00adtem on a Chip), which is based on the ARMv7 archi\u00adtec\u00adture. As such, it is com\u00adpat\u00adi\u00adble with all exist\u00ading oper\u00adat\u00ading sys\u00adtems for this platform:<\/p>\n<ul>\n<li>Android<\/li>\n<li>Lin\u00adux<\/li>\n<li>FreeB\u00adSD<\/li>\n<li>OpenB\u00adSD<\/li>\n<li>NetB\u00adSD<\/li>\n<li>Open\u00adWRT<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<p>Ini\u00adtial\u00adly, I thought of using one of the BSDs. Soo I found out that there was no sup\u00adport for the <span class=\"caps\">BCM53125<\/span> chip, which is the Eth\u00ader\u00adnet switch used in the Pi <span class=\"caps\">R1<\/span>. The Banana Pi <span class=\"caps\">R1<\/span>, hence\u00adforth men\u00adtioned BPi-R1, like many com\u00admer\u00adcial\u00adly avail\u00adable home routers has only one Eth\u00ader\u00adnet con\u00adtroller and a VLAN-enabled Eth\u00ader\u00adnet switch. Although phys\u00adi\u00adcal\u00adly dis\u00adtin\u00adguish\u00adable the <span class=\"caps\">WAN<\/span> and 4 <span class=\"caps\">LAN<\/span> ports all share the same con\u00adtroller. Log\u00adi\u00adcal\u00adly, the dis\u00adtinc\u00adtion is done with&nbsp;VLANs.<\/p>\n<p>No oper\u00adat\u00ading sys\u00adtem, oth\u00ader than Open\u00adWRT (this onde is, of course, also based on the Lin\u00adux ker\u00adnel) or the Lin\u00adux dis\u00adtri\u00adb\u00adu\u00adtions have a dri\u00adver for the <span class=\"caps\">BCM53125<\/span>. Because I want\u00aded a broad\u00ader use oper\u00adat\u00ading sys\u00adtem, I decid\u00aded against using Open\u00adWRT. I already have anoth\u00ader router that uses Toma\u00adtoUSB, which is very sim\u00adi\u00adlar to OpenWRT.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Available_Linux_kernel_based_distributions\"><\/span>Available Linux kernel based distributions<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>There are sev\u00ader\u00adal Lin\u00adux based oper\u00adat\u00ading sys\u00adtems avail\u00adable for down\u00adload: (<a href=\"http:\/\/www.bananapi.com\/Download\/6\/\">http:\/\/www.bananapi.com\/Download\/6\/<\/a>):<\/p>\n<ul>\n<li>Ubun\u00adtu <span class=\"caps\">MATE<\/span> 16.04<\/li>\n<li><span class=\"caps\">KANO<\/span> <span class=\"caps\">OS<\/span> 3.3.0&nbsp;beta<\/li>\n<li>Rasp\u00adbian (based on Debian Jessie)<\/li>\n<li>Rasp\u00adbian&nbsp;Lite<\/li>\n<li>Ubun\u00adtu minimal<\/li>\n<li>Android 4.4<\/li>\n<li>Open\u00adWRT 4.0<\/li>\n<li>Snap\u00adpy Ubun\u00adtu&nbsp;Core<\/li>\n<li>Banan\u00adian<\/li>\n<li>Arch Lin\u00adux<\/li>\n<li>Lubun\u00adtu<\/li>\n<li>Open\u00adSUSE<\/li>\n<li>Fedo\u00adra<\/li>\n<\/ul>\n<p>The BPi-R1 is also sold as the Lam\u00adobo <span class=\"caps\">R1<\/span>. In this man\u00adu\u00adfac\u00adtur\u00ader\u2019s web site one can down\u00adload Arm\u00adbian, which is a Debian dis\u00adtri\u00adb\u00adu\u00adtion opti\u00admized for <span class=\"caps\">ARM<\/span> archi\u00adtec\u00adtures (<a href=\"https:\/\/dl.armbian.com\/lamobo-r1\/\">https:\/\/dl.armbian.com\/lamobo-r1\/<\/a>). Ubun\u00adtu Lin\u00adux can also be down\u00adloaded from this&nbsp;site.<\/p>\n<p>After some research I decid\u00aded to go for Arm\u00adbian with <em>ker\u00adnel<\/em> ver\u00adsion 3.4.113. The direct link for down\u00adload I used is <a href=\"https:\/\/dl.armbian.com\/lamobo-r1\/archive\/Armbian_5.25_Lamobo-r1_Debian_jessie_default_3.4.113.7z\">https:\/\/dl.armbian.com\/lamobo-r1\/archive\/Armbian_5.25_Lamobo-r1_Debian_jessie_default_3.4.113.7z<\/a>.<\/p>\n<p>After down\u00adload\u00ading that file, it has to be decom\u00adpressed using&nbsp;7zip.<\/p>\n<p>We\u2019ll end up with a 1.<span class=\"caps\">3GB<\/span> file, which is the oper\u00adat\u00ading sys\u00adtem image, as well as a text file with some infor\u00adma\u00adtion about the release and a file named <span style=\"font-family: andale mono,monospace;\">sha256sum.sha<\/span>, which is a con\u00adtrol file for check\u00ading the image\u2019s <span class=\"caps\">SHA256<\/span> check\u00adsum, in order to ver\u00adi\u00adfy the down\u00adload is not cor\u00adrupt. You can check this check\u00adsum using the <span style=\"font-family: andale mono,monospace;\">sha256sum<\/span> util\u00adi\u00adty or some like&nbsp;it.<\/p>\n<p>Next, I \u201ctrans\u00adfered\u201d the image file to an emp\u00adty microSD card; this microSD card must have a capac\u00adi\u00adty of <span class=\"caps\">2GB<\/span> or&nbsp;more.<\/p>\n<p>On <span class=\"caps\">UNIX<\/span>\u00ae, <span class=\"caps\">BSD<\/span> and Lin\u00adux sys\u00adtems, one can use the <span style=\"font-family: andale mono,monospace;\">dd<\/span> util\u00adi\u00adty to do this. In Win\u00addows, the best tool for this job is Rufus (avail\u00adable at <a href=\"https:\/\/rufus.akeo.ie\/\">https:\/\/rufus.akeo.ie\/<\/a>).<\/p>\n<p>The com\u00admand I used in my Lin\u00adux com\u00adput\u00ader&nbsp;was:<\/p>\n<blockquote><p><em><span style=\"font-family: andale mono,monospace;\">dd if=Armbian_5.25_Lamobo-r1_Debian_jessie_default_3.4.113.img of=\/dev\/mmcblk0 bs=128k<\/span><\/em><\/p><\/blockquote>\n<p>The <span style=\"font-family: andale mono,monospace;\">bs=128k<\/span> option is to accel\u00ader\u00adate the transfer.<\/p>\n<p>Next, I used the <span style=\"font-family: andale mono,monospace;\">gpart\u00aded<\/span> util\u00adi\u00adty ar any oth\u00ader with sim\u00adi\u00adlar func\u00adtion\u00adal\u00adi\u00adties to expand the par\u00adti\u00adtion cre\u00adat\u00aded on the microSD card in order to fill it. Lat\u00ader I found out that there is an util\u00adi\u00adty installed on the microSD card to do that, as part of the Armbian\u2019s post-instal\u00adla\u00adtion procedures.<\/p>\n<p>We are ready to pow\u00ader up the BPi-R1 for the first time. Because we still haven\u2019t con\u00adfig\u00adured net\u00adwork con\u00adnec\u00adtiv\u00adi\u00adty, we have to plug the BPi-R1 to an <span class=\"caps\">HDMI<\/span> port of either a <span class=\"caps\">TV<\/span> or a com\u00adput\u00ader mon\u00adi\u00adtor and an <span class=\"caps\">USB<\/span> key\u00adboard. I used my Apple <span class=\"caps\">USB<\/span> Keyboard.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Basic_configuration\"><\/span>Basic configuration<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The first time we pow\u00ader the BPi-R1, we\u2019ll have to login using the <em>root<\/em> user. The default pass\u00adword is <strong>bananapi<\/strong>. We are then asked to do some post-instal\u00adla\u00adtion configuration:<\/p>\n<ul>\n<li>Chang\u00ading the <strong>root<\/strong> user\u2019s password;<strong><br>\n<\/strong><\/li>\n<li>Cre\u00adat\u00ading a non-root user.<\/li>\n<\/ul>\n<p>Arm\u00adbian for the BPi-R1 is pre-loaded with some pre-defined net\u00adwork con\u00adfig\u00adu\u00adra\u00adtion&nbsp;files.<\/p>\n<p>In order to be able to access the BPi-R1 via <span class=\"caps\">SSH<\/span> and auto\u00admat\u00adi\u00adcal\u00adly con\u00adfig\u00adure the net\u00adwork inter\u00adfaces for rout\u00ading, the file <span style=\"font-family: andale mono,monospace;\">\/etc\/network\/interfaces.r1router<\/span> must be renamed to <span style=\"font-family: andale mono,monospace;\">\/etc\/network\/interfaces<\/span>. Of course, this has to be done with the root&nbsp;user.<\/p>\n<p>This change allows for two VLANs being defined, one for the <span class=\"caps\">WAN<\/span> inter\u00adface and anoth\u00ader for the <span class=\"caps\">LAN<\/span> inter\u00adfaces and <span class=\"caps\">WLAN<\/span>. These last two are aggre\u00adgat\u00aded in a bridge (<span style=\"font-family: andale mono,monospace;\">br0<\/span>). This file also con\u00adfig\u00adures the <span class=\"caps\">WAN<\/span> inter\u00adface to get its IPv4 address by <span class=\"caps\">DHCP<\/span>, which is the most com\u00admon method in today\u2019s broad\u00adband cabled con\u00adnec\u00adtions in Por\u00adtu\u00adgal; The inter\u00adnal net\u00adwork gets the address range 192.168.2.0\/24.<\/p>\n<p>From now on, we can access the BPi-R1 via <span class=\"caps\">SSH<\/span>. For that, because we haven\u2019t yet con\u00adfig\u00adured the <span class=\"caps\">WLAN<\/span> inter\u00adface, we have to plug an eth\u00ader\u00adnet cable to the <span class=\"caps\">WAN<\/span> inter\u00adface and to my cur\u00adrent&nbsp;<span class=\"caps\">LAN<\/span>.<\/p>\n<p>In part 3, I\u2019ll talk about the con\u00adfig\u00adu\u00adra\u00adtion of sev\u00ader\u00adal ser\u00advices com\u00admon to a home\/small office router (<span class=\"caps\">DHCP<\/span>, <span class=\"caps\">DNS<\/span> and firewall).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oper\u00adat\u00ading Sys\u00adtem instal\u00adla\u00adtion This is the sec\u00adond part of the arti\u00adcle series Build\u00ading a router with the Banana Pi <span class=\"caps\">R1<\/span>. To view the first part, click here. What options do I&nbsp;have? The Banana Pi <span class=\"caps\">R1<\/span>, as stat\u00aded in part 1, \u2026 <a href=\"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/en\/2017\/08\/31\/building-a-router-with-the-banana-pi-r1-part-2\/\">Con\u00adtin\u00aduar a ler <span class=\"meta-nav\">\u2192<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[57,59,65],"tags":[],"class_list":["post-213","post","type-post","status-publish","format-standard","hentry","category-administration","category-configuration","category-operating-systems"],"_links":{"self":[{"href":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/wp-json\/wp\/v2\/posts\/213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":7,"href":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":222,"href":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/wp-json\/wp\/v2\/posts\/213\/revisions\/222"}],"wp:attachment":[{"href":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trindade.myphotos.cc\/receitasinformaticas\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}