{"id":265,"date":"2009-12-15T00:59:05","date_gmt":"2009-12-15T04:59:05","guid":{"rendered":"http:\/\/ahmeddirie.com\/?p=265"},"modified":"2012-11-25T15:49:43","modified_gmt":"2012-11-25T20:49:43","slug":"bringing-home-the-cisco-internetworking-model","status":"publish","type":"post","link":"https:\/\/ahmeddirie.com\/blog\/networking\/bringing-home-the-cisco-internetworking-model\/","title":{"rendered":"Cisco Hierarchical Internetworking Model with Vyatta &#8211; Core"},"content":{"rendered":"<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.<\/p>\n<p><!--more--><\/p>\n<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? \u00a0Below 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>\n<p><img loading=\"lazy\" decoding=\"async\" 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\" srcset=\"https:\/\/ahmeddirie.com\/blog\/wp-content\/uploads\/2009\/12\/network-model.png 480w, https:\/\/ahmeddirie.com\/blog\/wp-content\/uploads\/2009\/12\/network-model-300x151.jpg 300w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/p>\n<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>\n<p><!--more--><\/p>\n<p><strong>Setting up the Core Router<\/strong><\/p>\n<p>For the Core Router, I&#8217;m using a computer with two network interfaces. We&#8217;re going to<\/p>\n<ul>\n<li>configure the external interface<\/li>\n<li>configure the internal interface<\/li>\n<li>configure ssh access so we can connect to this router later<\/li>\n<li>configure dhcp (you can skip this and set the distribution router with a static external)<\/li>\n<li>configure name servers as well as dynamic dns<\/li>\n<li>configure network address translation<\/li>\n<\/ul>\n<p><strong>Getting Started<\/strong><\/p>\n<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>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">configure<\/pre>\n<p><strong>Configuring the External Interface (eth0)<\/strong><\/p>\n<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>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">set interfaces ethernet eth0 address dhcp\r\ncommit<\/pre>\n<p>If you happen to have a static ip, and know your subnet mask, you can enter it as follows<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">set interfaces ethernet eth0 address 1.1.1.1\/24\r\ncommit<\/pre>\n<p><strong>Configuring the Internal Interface (eth1)<\/strong><\/p>\n<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>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">set interfaces ethernet eth1 address 10.0.0.1\/29\r\ncommit<\/pre>\n<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>\n<p><strong>Configuring SSH access<\/strong><\/p>\n<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>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">set service ssh\r\nset service ssh port 30000\r\nset service ssh allow-root false\r\nset service ssh protocol-version all\r\ncommit<\/pre>\n<p><strong>Configuring DHCP<\/strong><\/p>\n<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>\n<p>Here, we&#8217;ll setup the DHCP server, give it a name (like the pool in Cisco), and the other characteristics.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">set service dhcp-server\r\nset service dhcp-server shared-network-name Pool1\r\nset service dhcp-server shared-network-name Pool1 subnet 10.0.0.0 default-router 10.0.0.1\r\nset service dhcp-server shared-network-name Pool1 subnet 10.0.0.0 start 10.0.0.2 end 10.0.0.6\r\nset service dhcp-server shared-network-name Pool1 subnet 10.0.0.0 exclude 10.0.0.1\r\nset service dhcp-server shared-network-name Pool1 subnet 10.0.0.0 dns-server 208.67.220.220\r\nset service dhcp-server shared-network-name Pool1 subnet 10.0.0.0 dns-server 208.67.222.222\r\ncommit<\/pre>\n<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>\n<p><strong>Configuring DNS<\/strong><\/p>\n<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\u00a0to add the configurations to connect to <a href=\"http:\/\/dyndns.com\/\">DynDNS<\/a> for our dynamic dns updates.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">set system name-server 208.67.220.220\r\nset system name-server 208.67.222.222\r\nset service dns dynamic interface eth0 service dyndns\r\nset service dns dynamic interface eth0 service dyndns\u00a0login your-login-name\r\nset service dns dynamic interface eth0 service dyndns\u00a0password your-password\r\nset service dns dynamic interface eth0 service dyndns\u00a0host-name your-hostname.domain.com\r\ncommit<\/pre>\n<p><strong>Configuring NAT<\/strong><\/p>\n<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>\n<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>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">set service nat rule 100 type masquerade\r\nset service nat rule 100 type source\u00a0address 10.0.0.0\/29\r\nset service nat rule 100 type source\u00a0outbound-interface eth0\r\ncommit<\/pre>\n<p><strong>Wrapping things up<\/strong><\/p>\n<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>\n","protected":false},"excerpt":{"rendered":"<p>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.<\/p>\n","protected":false},"author":2,"featured_media":2966,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85],"tags":[98,97,60,94,95,102,100,96,101,104,74,85,103,64,99,16],"_links":{"self":[{"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/posts\/265"}],"collection":[{"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/comments?post=265"}],"version-history":[{"count":34,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/posts\/265\/revisions"}],"predecessor-version":[{"id":2967,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/posts\/265\/revisions\/2967"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/media\/2966"}],"wp:attachment":[{"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/media?parent=265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/categories?post=265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahmeddirie.com\/blog\/wp-json\/wp\/v2\/tags?post=265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}