<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ahmed Dirie &#187; Networking</title>
	<atom:link href="http://ahmeddirie.com/category/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://ahmeddirie.com</link>
	<description>Web Application Developer from Ottawa, Canada</description>
	<lastBuildDate>Thu, 03 May 2012 19:36:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Anonymity Freedom Box Project</title>
		<link>http://ahmeddirie.com/networking/anonymity-freedom-box-project-24062011/</link>
		<comments>http://ahmeddirie.com/networking/anonymity-freedom-box-project-24062011/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 20:50:08 +0000</pubDate>
		<dc:creator>ahmeddirie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Anonymity]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[dehierarchicalization]]></category>
		<category><![CDATA[FreedomBox]]></category>
		<category><![CDATA[privacy]]></category>

		<guid isPermaLink="false">http://ahmeddirie.com/?p=1599</guid>
		<description><![CDATA[This is an inspiring video on networking, but in a whole new light. Freedom Box Project: Vision Statement We live in a world where our use of the network is mediated by organizations that often do not have our best interests at heart. By building software that does not rely on a central service, we [...]]]></description>
			<content:encoded><![CDATA[<p>This is an inspiring video on networking, but in a whole new light.</p>
<p><strong>Freedom Box Project: Vision Statement</strong></p>
<p>We live in a world where our use of the network is mediated by organizations that often do not have our best interests at heart. By building software that does not rely on a central service, we can regain control and privacy. By keeping our data in our homes, we gain useful legal protections over it. By giving back power to the users over their networks and machines, we are returning the Internet to its intended peer-to-peer architecture.</p>
<p>In order to bring about the new network order, it is paramount that it is easy to convert to it. The hardware it runs on must be cheap. The software it runs on must be easy to install and administrate by anybody. It must be easy to transition from existing services.</p>
<p><span id="more-1599"></span></p>
<p>There are a number of projects working to realize a future of distributed services; we aim to bring them all together in a convenient package.</p>
<p><a href="http://wiki.debian.org/FreedomBox">http://wiki.debian.org/FreedomBox</a></p>
<p><span class="youtube">
<object width="612" height="483">
<param name="movie" value="http://www.youtube.com/v/gORNmfpD0ak?color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;modestbranding=1&amp;loop=&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=0" />
<param name="allowFullScreen" value="true" />
<embed wmode="opaque" src="http://www.youtube.com/v/gORNmfpD0ak?color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;modestbranding=1&amp;loop=&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=0" type="application/x-shockwave-flash" allowfullscreen="true" width="612" height="483"></embed>
<param name="wmode" value="opaque" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=gORNmfpD0ak">www.youtube.com/watch?v=gORNmfpD0ak</a></p></p>
]]></content:encoded>
			<wfw:commentRss>http://ahmeddirie.com/networking/anonymity-freedom-box-project-24062011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URL Filtering and Blocking Crap with Vyatta</title>
		<link>http://ahmeddirie.com/networking/url-filtering-and-blocking-crap-with-vyatta-30012011/</link>
		<comments>http://ahmeddirie.com/networking/url-filtering-and-blocking-crap-with-vyatta-30012011/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 21:25:00 +0000</pubDate>
		<dc:creator>ahmeddirie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[adware]]></category>
		<category><![CDATA[blacklists]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[D-Link]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Linksys]]></category>
		<category><![CDATA[Router]]></category>
		<category><![CDATA[spyware]]></category>
		<category><![CDATA[Squid]]></category>
		<category><![CDATA[SquidGuard]]></category>
		<category><![CDATA[URL Filtering]]></category>
		<category><![CDATA[Vyatta]]></category>

		<guid isPermaLink="false">http://ahmeddirie.com/?p=1494</guid>
		<description><![CDATA[This week, I had a client who was having issues with his router. With years of use, he began to experience a degradation in its performance. Although the office is small with 6 computers, his only requirements were a router that can block roughly 30 domains, and manage to perform well. I arrived at his [...]]]></description>
			<content:encoded><![CDATA[<p>This week, I had a client who was having issues with his router. With years of use, he began to experience a degradation in its performance. Although the office is small with 6 computers, his only requirements were a router that can block roughly 30 domains, and manage to perform well.</p>
<p>I arrived at his office, and found he purchased a shiny new <a href="http://www.linksysbycisco.com/EU/en/products/WRT320N">Cisco Linksys WRT320N</a> router for $100 from Futureshop. It looks sleek and sexy. I disconnected his <a href="http://www.dlink.ca/products/?pid=565">D-Link DIR-615</a>, and proceeded to setup the new one. After getting through the setup, enabling the wireless, and specifying which systems would obtain which IP address, I found that the router can only block 4 domains.<br />
<span id="more-1494"></span></p>
<p>It&#8217;s situations like these where you realize there is a good solution for all of this, and it happens to start with <a href="http://www.vyatta.com/">Vyatta</a>. I brought over a computer with a second network card installed. Ran through the main setup of the router. Now, for domain or URL filtering, my understanding is that there is no limit with Vyatta.</p>
<p>You run the commands below on the internal interface that connects the switch to the router.</p>
<pre class="brush: plain; title: ; notranslate">
set service webproxy listen-address 10.10.0.1
set service webproxy url-filtering squidguard local-block twitter.com
set service webproxy url-filtering squidguard local-block facebook.com
set service webproxy url-filtering squidguard local-block youtube.com
commit
</pre>
<p>There is also some extra cool features if you are looking for an added level of security. <a href="http://www.squidguard.org/">SquidGuard</a> allows you to use blacklists with <a href="http://www.squid-cache.org/">Squid</a>, and the great thing about it is that its totally free. One of those cool features is the ability of blocking adware and spyware, and not having to figure out what to block. You can use the commands below to use the lists managed by Squid.</p>
<pre class="brush: plain; title: ; notranslate">
set service webproxy listen-address 10.10.0.1
set service webproxy url-filtering squidguard block-category ads
set service webproxy url-filtering squidguard block-category gambling
set service webproxy url-filtering squidguard block-category malware
set service webproxy url-filtering squidguard block-category phishing
set service webproxy url-filtering squidguard block-category porn
set service webproxy url-filtering squidguard block-category spyware
set service webproxy url-filtering squidguard block-category warez
commit
</pre>
<p>And with a few lines of commands, you can protect your network better.</p>
]]></content:encoded>
			<wfw:commentRss>http://ahmeddirie.com/networking/url-filtering-and-blocking-crap-with-vyatta-30012011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cisco Hierarchical Internetworking Model with Vyatta – Access</title>
		<link>http://ahmeddirie.com/networking/bringing-home-the-cisco-hierarchical-internetworking-model-access-07022010/</link>
		<comments>http://ahmeddirie.com/networking/bringing-home-the-cisco-hierarchical-internetworking-model-access-07022010/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 06:07:19 +0000</pubDate>
		<dc:creator>ahmeddirie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[3-tier]]></category>
		<category><![CDATA[Access Layer]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Cisco Hierarchical Internetworking Model]]></category>
		<category><![CDATA[Core Layer]]></category>
		<category><![CDATA[DDNS]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[Distribution Layer]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[DynDNS]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[OpenDNS]]></category>
		<category><![CDATA[Routing]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Vyatta]]></category>

		<guid isPermaLink="false">http://ahmeddirie.com/?p=508</guid>
		<description><![CDATA[This is a final part of of the series, continuing from the implementation of a distribution layer using a Vyatta router. The previous parts are &#8220;Bringing Home the Cisco Hierarchical Internetworking Model, with Vyatta ofcourse&#8221; where Part 1 goes over setting up the Core layer, and Part 2 deals with setting up the Distribution layer. [...]]]></description>
			<content:encoded><![CDATA[<p>This is a final part of of the series, continuing from the implementation of a distribution layer using a Vyatta router. The previous parts are &#8220;Bringing Home the Cisco Hierarchical Internetworking Model, with Vyatta ofcourse&#8221; where <a href="http://ahmeddirie.com/networking/bringing-home-the-cisco-internetworking-model-15122009/">Part 1 </a> goes over setting up the Core layer, and <a href="http://ahmeddirie.com/networking/cisco-internetworking-model-distribution-25012010/">Part 2 </a> deals with setting up the Distribution layer.<br />
<span id="more-508"></span></p>
<p>Routers at the access layer are pretty straight forward to get up and running.</p>
<p><strong>Configuring the External Interface (eth0)</strong></p>
<p>In the previous setup, we set the internal interface to be on the 172.16.0.0/29 subnet. And since the internal interface of the distribution router connects to the external interface of the access router, we&#8217;ll go ahead and set the external IP here.</p>
<pre class="brush: plain; title: ; notranslate">set interfaces ethernet eth0 address 172.16.0.2/29
commit</pre>
<p><strong>Configuring the Internal Interface (eth1)</strong></p>
<p>We&#8217;ll now configure the internal address, however the subnet mask will not be /29. Since this tutorial is for setting up a network at home, l&#8217;m going to assume there aren&#8217;t too many people with over 30 computers at home. Although this is pretty high to begin with, its suitable.</p>
<pre class="brush: plain; title: ; notranslate">set interfaces ethernet eth1 address 192.168.0.1/27
commit</pre>
<p>The /27 will allow us to have a total of 30 computers. Here&#8217;s the breakdown.</p>
<p>Network Address: 192.168.0.0<br />
Broadcast Address: 192.168.0.31<br />
Hosts (Computers): 192.168.0.1 &#8211; 192.168.0.30<br />
Subnet Mask: 255.255.255.224</p>
<p><strong>Configuring DHCP</strong></p>
<p>I covered this step in the first part of the series. I did mention that it wasn&#8217;t required for a core router, but included the configurations since this is a home network. Below are the configurations.</p>
<pre class="brush: plain; title: ; notranslate">set service dhcp-server
set service dhcp-server shared-network-name Pool1
set service dhcp-server shared-network-name Pool1 subnet 192.168.0.0 default-router 192.168.0.1
set service dhcp-server shared-network-name Pool1 subnet 192.168.0.0 start 192.168.0.2 end 192.168.0.30
set service dhcp-server shared-network-name Pool1 subnet 192.168.0.0 exclude 192.168.0.1
set service dhcp-server shared-network-name Pool1 subnet 192.168.0.0 dns-server 208.67.220.220
set service dhcp-server shared-network-name Pool1 subnet 192.168.0.0 dns-server 208.67.222.222
commit</pre>
<p>As mentioned earlier, the 208.67.220.220 and 208.67.222.222 address are free DNS servers from <a title="OpenDNS" href="http://www.opendns.com">OpenDNS</a>.</p>
<p><strong>Configuring NAT</strong></p>
<p>This is the last part of the configuration, and I also covered this in the first part. NAT (Network Address Translation) will enable the computers to talk to the outside world, or in our case, get on the internet.</p>
<pre class="brush: plain; title: ; notranslate">set service nat rule 100 type masquerade
set service nat rule 100 type source address 192.168.0.0/27
set service nat rule 100 type source outbound-interface eth0
commit</pre>
<p>This ends the series on setting up a network at home using the internetworking model using Vyatta. Although, it is unlikely that you would implement this at home (because it requires three computers), it is primarily to get an understanding of how to differentiate between the different functions that routers perform at the various layers. It is also meant to show us how to get the same functionality of a Cisco environment without using Cisco equipment.</p>
]]></content:encoded>
			<wfw:commentRss>http://ahmeddirie.com/networking/bringing-home-the-cisco-hierarchical-internetworking-model-access-07022010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco Hierarchical Internetworking Model with Vyatta – Distribution</title>
		<link>http://ahmeddirie.com/networking/cisco-internetworking-model-distribution-25012010/</link>
		<comments>http://ahmeddirie.com/networking/cisco-internetworking-model-distribution-25012010/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 08:54:10 +0000</pubDate>
		<dc:creator>ahmeddirie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[3-tier]]></category>
		<category><![CDATA[Access Layer]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Cisco Hierarchical Internetworking Model]]></category>
		<category><![CDATA[Core Layer]]></category>
		<category><![CDATA[DDNS]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[Distribution Layer]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[DynDNS]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[OpenDNS]]></category>
		<category><![CDATA[Routing]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Vyatta]]></category>

		<guid isPermaLink="false">http://ahmeddirie.com/?p=446</guid>
		<description><![CDATA[This is part 2 of the series where I implement the Cisco Hierarchical Internetworking Model using Vyatta routers in the home. The distribution layer concepts as well as configuration are discussed. The policy and filtering section of the configurations have been  copied from carbonwind.com. A link is provided in the site for the full list of configuration options.]]></description>
			<content:encoded><![CDATA[<p>This is a continuation of the first part of this series where I discussed the implementation of a core layer router using Vyatta on any Intel x-86 machine. This can be found <a title="Bringing Home the Cisco Hierarchical Internetworking Model, with Vyatta ofcourse – Part 1 (Core)" href="http://ahmeddirie.com/networking/bringing-home-the-cisco-internetworking-model-15122009/">here</a>. The reasons for implementing this type of architecture at home probably makes no sense at all. Rest assured, my wonderful reasons are also covered in the first part. However, this can be tweaked to be used in a SOHO or business environment.<br />
<span id="more-446"></span></p>
<p>Moving forward, what are the primary differences between the distribution layer and the core and access? The distribution layer is where all the routing, policies and filtering take place.</p>
<p><strong>Setting up the Distribution Router</strong></p>
<p>Similar to the core router, we&#8217;re going to need a computer that is equipped with two network interfaces.</p>
<ul>
<li>configure the external interface</li>
<li>configure the internal interface</li>
</ul>
<p><strong>Going forward from the Core Configuration</strong></p>
<p>In <a title="Bringing Home the Cisco Hierarchical Internetworking Model, with Vyatta ofcourse – Part 1 (Core)" href="http://ahmeddirie.com/2009/12/15/bringing-home-the-cisco-internetworking-model/">Part 1</a>, we configured the core router to have an external address of 1.1.1.1/24 and an internal address of 10.0.0.1/29. Ensure you follow the same steps of installing Vyatta on the machine and getting to the configuration page in order to proceed.</p>
<p><strong>Configuring the External Interface (eth0)</strong></p>
<p>Here, we&#8217;ll configure the external address of the router to be on the same subnet as the internal address of the core router.</p>
<pre class="brush: plain; title: ; notranslate">set interfaces ethernet eth0 address 10.0.0.2/29
commit</pre>
<p><strong>Configuring the Internal Interface (eth1)</strong></p>
<p>We can now configure the internal address in the same way.</p>
<pre class="brush: plain; title: ; notranslate">set interfaces ethernet eth1 address 172.16.0.1/29
commit</pre>
<p>So, from here we’ve set our internal network to be 172.16.0.1 with a subnet address of 255.255.255.248. This distribution router has the .1 address, and so the access router will get the .2 address.</p>
<p><strong>Policies and Filtering</strong></p>
<p>This section can get quite lengthy based on the options you want to implement in your setup.</p>
<p><!--more--></p>
<p>Instead of re-inventing the wheel, I&#8217;m going to include a few configuration settings from resources that are already available on the <a title="Carbonwind" href="http://carbonwind.net">Carbonwind.net</a> site. For the complete list of firewall configurations, please visit the <a title="Vyatta VC5 - Simple Firewall and NAT Rules" href="http://www.carbonwind.net/VyattaOFR/Firewall/Firewall.htm">Vyatta VC5 &#8211; Simple Firewall and NAT Rules</a>.</p>
<p>Keep in mind that the difference with the configurations below is that the subnet of the internal network is set to 192.168.40.0.</p>
<p><img class="size-full wp-image-453 alignnone" title="net_diag1" src="http://ahmeddirie.com/wp-content/uploads/2010/01/net_diag1.png" alt="" width="443" height="151" /></p>
<p><strong>Allow DNS name resolution for Vyatta itself</strong><br />
Maybe you obtain the IP address on your Internet facing interface through DHPC, so you do not know the IP addresses of the ISP DNS servers, as their IP addresses might change.</p>
<pre class="brush: plain; title: ; notranslate">
set firewall name eth0local rule 10 action accept
set firewall name eth0local rule 10 protocol udp
set firewall name eth0local rule 10 source port 53
set firewall name eth0local rule 10 state established enable
set firewall name eth0local rule 10 state related enable
set interfaces ethernet eth0 firewall local name eth0local
</pre>
<p>Or maybe you have a static IP address on your Internet facing interface, and you know the IP addresses of the ISP DNS servers. Bellow, we have assumed that the public IP address on eth0 interface is 192.168.22.240 and the IP address of the ISP server is 192.168.22.1.</p>
<pre class="brush: plain; title: ; notranslate">
set firewall name eth0local rule 10 action accept
set firewall name eth0local rule 10 protocol udp
set firewall name eth0local rule 10 source port 53
set firewall name eth0local rule 10 source address 192.168.22.1
set firewall name eth0local rule 10 destination address 192.168.22.240
set firewall name eth0local rule 10 state established enable
set firewall name eth0local rule 10 state related enable
set interfaces ethernet eth0 firewall local name eth0local
</pre>
<p>Or you may use internal DNS server(s) and you&#8217;ve configured on Vyatta this DNS server(s) as name server(s)(note that in addition to the rule bellow you need to allow DNS through Vyatta from the internal DNS, search this article for that).</p>
<pre class="brush: plain; title: ; notranslate">
set firewall name eth1local rule 10 action accept
set firewall name eth1local rule 10 protocol udp
set firewall name eth1local rule 10 source address 192.168.40.2
set firewall name eth1local rule 10 source port 53
set firewall name eth1local rule 10 destination address 192.168.40.1
set firewall name eth1local rule 10 state established enable
set firewall name eth1local rule 10 state related enable
set interfaces ethernet eth1 firewall local name eth1local
</pre>
<p><strong>Allow NTP for Vyatta itself</strong><br />
Say you&#8217;ve configured an NTP server on Vyatta. By default there is an external NTP server configured.</p>
<p>For this configured NTP server, we can add on the Internet facing interface a firewall rule allowing returning NTP traffic(NTP server&#8217;s replies) like (bellow, we have assumed that the public IP address on eth0 interface is 192.168.22.240 and the IP address of the NTP server is 69.59.150.135):</p>
<pre class="brush: plain; title: ; notranslate">
set firewall name eth0local rule 10 action accept
set firewall name eth0local rule 10 protocol udp
set firewall name eth0local rule 10 source address 69.59.150.135
set firewall name eth0local rule 10 source port 123
set firewall name eth0local rule 10 destination address 192.168.22.240
set firewall name eth0local rule 10 state established enable
set firewall name eth0local rule 10 state related enable
</pre>
<pre class="brush: plain; title: ; notranslate">set interfaces ethernet eth0 firewall local name eth0local</pre>
<p><strong>Allow HTTP and HTTPS for Vyatta itself</strong><br />
Say you want to allow for updates or so, HTTP/HTTPS traffic from Vyatta itself(destined to the Internet). So you need to allow returning HTTP/HTTPS traffic to Vyatta itself on that interface(connections initiated by Vyatta itself, bellow, we have assumed that the public IP address on eth0 interface is 192.168.22.240).</p>
<pre class="brush: plain; title: ; notranslate">set firewall conntrack-tcp-loose disable</pre>
<pre class="brush: plain; title: ; notranslate">set firewall name eth0local rule 10 action accept
set firewall name eth0local rule 10 protocol tcp
set firewall name eth0local rule 10 source port 80,443
set firewall name eth0local rule 10 destination address 192.168.22.240
set firewall name eth0local rule 10 state established enable
set firewall name eth0local rule 10 state related enable</pre>
<pre class="brush: plain; title: ; notranslate">set interfaces ethernet eth0 firewall local name eth0local</pre>
<p><strong>Dynamic IP address from DHCP on an interface</strong></p>
<p>Say, the Internet facing interface(eth0) obtains its IP configuration from a DHCP server.</p>
<p>Basically we need to allow the DHCP server&#8217;s reply messages.</p>
<pre class="brush: plain; title: ; notranslate">set firewall name eth0local rule 10 action accept
set firewall name eth0local rule 10 protocol udp
set firewall name eth0local rule 10 destination port 68
set firewall name eth0local rule 10 source port 67
set firewall name eth0local rule 10 state established enable
set firewall name eth0local rule 10 state related enable

set interfaces ethernet eth0 firewall local name eth0local</pre>
<p>I will conclude with this portion of the series here. The next one will look at the Access router and how this can be implemented and deployed in your network.</p>
]]></content:encoded>
			<wfw:commentRss>http://ahmeddirie.com/networking/cisco-internetworking-model-distribution-25012010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cisco Hierarchical Internetworking Model with Vyatta &#8211; Core</title>
		<link>http://ahmeddirie.com/networking/bringing-home-the-cisco-internetworking-model-15122009/</link>
		<comments>http://ahmeddirie.com/networking/bringing-home-the-cisco-internetworking-model-15122009/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 04:59:05 +0000</pubDate>
		<dc:creator>ahmeddirie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[3-tier]]></category>
		<category><![CDATA[Access Layer]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Cisco Hierarchical Internetworking Model]]></category>
		<category><![CDATA[Core Layer]]></category>
		<category><![CDATA[DDNS]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[Distribution Layer]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[DynDNS]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[OpenDNS]]></category>
		<category><![CDATA[Routing]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Vyatta]]></category>

		<guid isPermaLink="false">http://ahmeddirie.com/?p=265</guid>
		<description><![CDATA[Building your home network like an enterprise network with a core layer, distribution layer, and an access layer using Vyatta. Vyatta is a network routing OS that can be installed on x-86 computers.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got several computers lying around, and so I think its high time that I begin to make good use of them. More recently, I&#8217;ve been working with Vyatta&#8217;s operating system a lot more for my routing and security purposes. My previous project in getting Vyatta on the cloud has been successful. And so, this post will be about getting that same powerful enterprise network at the office&#8230; home.<br />
<span id="more-265"></span></p>
<p>In my Cisco days, we followed a certain model that is similar to the 3-tier architecture. I won&#8217;t go into too much detail here, but it divides up your network into three levels; Core, Distribution, and Access. You must be wondering how we&#8217;re going to apply this concept to the home?  Below is a visual representation of what I&#8217;ve got in mind. We&#8217;ll break this down piece by piece and build each part as we go along.</p>
<p><img class="alignnone size-full wp-image-272" title="network-model" src="http://ahmeddirie.com/wp-content/uploads/2009/12/network-model.png" alt="network-model" width="480" height="242" /></p>
<p>Typically, the Access Layer can be either switches or routers, depending on your setup. Just so my home network doesn&#8217;t get overly complicated, I&#8217;m going to leave that later as switches. Also, because this is being implemented in a home, you will notice that there are no redundant links here, ie, dual wan connections, etc.</p>
<p><!--more--></p>
<p><strong>Setting up the Core Router</strong></p>
<p>For the Core Router, I&#8217;m using a computer with two network interfaces. We&#8217;re going to</p>
<ul>
<li>configure the external interface</li>
<li>configure the internal interface</li>
<li>configure ssh access so we can connect to this router later</li>
<li>configure dhcp (you can skip this and set the distribution router with a static external)</li>
<li>configure name servers as well as dynamic dns</li>
<li>configure network address translation</li>
</ul>
<p><strong>Getting Started</strong></p>
<p>At this stage, I assume you would have already installed Vyatta. Once you&#8217;ve got it up and running, you should be able to logged in and see the main list of options. To begin configuring the router, type</p>
<pre class="brush: plain; title: ; notranslate">configure</pre>
<p><strong>Configuring the External Interface (eth0)</strong></p>
<p>We&#8217;ll start by configuring the external address. Because most homes don&#8217;t have a static ip address assigned to them for their internet connection, we&#8217;re going to configure our external interface with a dhcp address.</p>
<pre class="brush: plain; title: ; notranslate">set interfaces ethernet eth0 address dhcp
commit</pre>
<p>If you happen to have a static ip, and know your subnet mask, you can enter it as follows</p>
<pre class="brush: plain; title: ; notranslate">set interfaces ethernet eth0 address 1.1.1.1/24
commit</pre>
<p><strong>Configuring the Internal Interface (eth1)</strong></p>
<p>We can now configure the internal address in the same way. However, this time we&#8217;ll have to assign an address ourselves.</p>
<pre class="brush: plain; title: ; notranslate">set interfaces ethernet eth1 address 10.0.0.1/29
commit</pre>
<p>So, from here we&#8217;ve set our internal network to be 10.0.0.0 with a subnet address of 255.255.255.248. Our core router has the .1 address, and so our distribution router will more than likely get a .2 address. This really isn&#8217;t set in stone. But if you feel you want to make it .3 or .6, go right ahead. Basically, all we&#8217;re doing here is using a convention that will be easy to remember.</p>
<p><strong>Configuring SSH access</strong></p>
<p>Configuring SSH will allow us to have secure shell access to the router externally. I would set this up instead of Telnet for security purposes. It&#8217;s relatively simple. Basically, we want to change the port we connect to from the default (22) to something random, like 30000. Also, I&#8217;m going to deny root access to the system. If you wish to have root access, set it to true.</p>
<pre class="brush: plain; title: ; notranslate">set service ssh
set service ssh port 30000
set service ssh allow-root false
set service ssh protocol-version all
commit</pre>
<p><strong>Configuring DHCP</strong></p>
<p>Technically speaking, you want to skip this section all-together. For your core router, you want it to strictly stay on the ball when it comes to doing its job, and this is forwarding packets between the distribution layer to the external network. However, because this is my home network, I&#8217;m not overly concerned.</p>
<p>Here, we&#8217;ll setup the DHCP server, give it a name (like the pool in Cisco), and the other characteristics.</p>
<pre class="brush: plain; title: ; notranslate">set service dhcp-server
set service dhcp-server shared-network-name Pool1
set service dhcp-server shared-network-name Pool1 subnet 10.0.0.0 default-router 10.0.0.1
set service dhcp-server shared-network-name Pool1 subnet 10.0.0.0 start 10.0.0.2 end 10.0.0.6
set service dhcp-server shared-network-name Pool1 subnet 10.0.0.0 exclude 10.0.0.1
set service dhcp-server shared-network-name Pool1 subnet 10.0.0.0 dns-server 208.67.220.220
set service dhcp-server shared-network-name Pool1 subnet 10.0.0.0 dns-server 208.67.222.222
commit</pre>
<p>For the DNS servers, I&#8217;ve set it up here to point to <a href="http://www.opendns.com/">OpenDNS</a>. I setup all my routers to use their DNS servers. You don&#8217;t have to specify it here, you can set it as your router and specify the name servers in your global configuration as we will be doing in the next step.</p>
<p><strong>Configuring DNS</strong></p>
<p>This is pretty straight forward. We&#8217;ll go ahead and plug in the OpenDNS servers in here. Vyatta supports several DDNS service providers right out of the box. I&#8217;m going to add the configurations to connect to <a href="http://dyndns.com/">DynDNS</a> for our dynamic dns updates.</p>
<pre class="brush: plain; title: ; notranslate">set system name-server 208.67.220.220
set system name-server 208.67.222.222
set service dns dynamic interface eth0 service dyndns
set service dns dynamic interface eth0 service dyndns login your-login-name
set service dns dynamic interface eth0 service dyndns password your-password
set service dns dynamic interface eth0 service dyndns host-name your-hostname.domain.com
commit</pre>
<p><strong>Configuring NAT</strong></p>
<p>We&#8217;re using network address translation so that all our internal computers can talk to the outside world as though they are the router itself. Or, to break it down even further, we don&#8217;t have enough public ip address to pass around, but the private ip addresses are endless. You and your neighbor could have 10 or more computers and have the exact same private addresses, but you both have one unique public address. The outside world only talks to public addresses, and this is where NAT kicks in. Your router will basically facilitate that communication for you.</p>
<p>There are several types of NAT. We won&#8217;t get complicated here. So, we&#8217;ll just setup an SNAT (source nat).</p>
<pre class="brush: plain; title: ; notranslate">set service nat rule 100 type masquerade
set service nat rule 100 type source address 10.0.0.0/29
set service nat rule 100 type source outbound-interface eth0
commit</pre>
<p><strong>Wrapping things up</strong></p>
<p>We&#8217;ve now finished configuring the core router. Save all your configurations by typing (save). In the next post, we&#8217;ll look at configuring the distribution router.</p>
]]></content:encoded>
			<wfw:commentRss>http://ahmeddirie.com/networking/bringing-home-the-cisco-internetworking-model-15122009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

