<?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>Carlos&#039; Corner &#187; vyatta</title>
	<atom:link href="http://cars.lostroncos.org/tag/vyatta/feed/" rel="self" type="application/rss+xml" />
	<link>http://cars.lostroncos.org</link>
	<description>The tired geek-dad in the corner</description>
	<lastBuildDate>Wed, 12 May 2010 19:46:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simulating a more interesting environment with Vyatta and VMware ESXi &#8211; pt 3</title>
		<link>http://cars.lostroncos.org/2010/03/27/simulating-a-more-interesting-environment-with-vyatta-and-vmware-pt-3/</link>
		<comments>http://cars.lostroncos.org/2010/03/27/simulating-a-more-interesting-environment-with-vyatta-and-vmware-pt-3/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 07:21:33 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Home Lab]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[vyatta]]></category>
		<category><![CDATA[esx3i]]></category>
		<category><![CDATA[esx4i]]></category>
		<category><![CDATA[esxi]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/?p=446</guid>
		<description><![CDATA[Background
<p>[consider this fair warning that this post is a bit long]</p>
<p>In the first part of this series I planned out my &#8220;enterprise&#8221; environment for an Exchange 2003 to 2010 upgrade. In the second part I built the internal router and verified it was working with directly connected subnets. At this point I have something resembling [...]]]></description>
			<content:encoded><![CDATA[<h2>Background</h2>
<p><em>[consider this fair warning that this post is a bit long]</em></p>
<p>In the<a href="http://cars.lostroncos.org/2010/02/17/a-more-interesting-environment-with-vyatta-and-vmware/"> first part of this series</a> I planned out my &#8220;enterprise&#8221; environment for an Exchange 2003 to 2010 upgrade. In the <a href="http://cars.lostroncos.org/2010/02/18/a-more-interesting-environment-with-vyatta-and-vmware-pt2/">second part</a> I built the internal router and verified it was working with directly connected subnets. At this point I have something resembling the following.<br />
<a href="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga1.png"><img class="alignnone size-full wp-image-447" title="Environment to date" src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga1.png" alt="Environment to date" width="401" height="188" /></a></p>
<p>In this entry I&#8217;ll work on adding the DMZ router, enabling the firewall on one of its interfaces and adding static routers to it and<strong><em> rtr-home</em></strong> so that it&#8217;s reachable from my home LAN (essentially the stuff in the red box below). There are two phases to this.<a href="#configuringrouter"> The first phase</a> consists of setting up the router and verifying that it is able to reach hosts on the respective subnets it&#8217;s  directly attached to. As part of this I&#8217;ll also  set up static routing between<strong><em> rtr-dmz</em></strong> and <strong><em>rtr-home</em></strong> so that we can pass traffic from one subnet to another traversing both routers. <a href="#configuringfirewall">In the second phase</a> we&#8217;ll set up a very simple firewall ruleset to limit traffic coming out of the DMZ.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga2.png" alt="" /></p>
<p><a name="configuringrouter"></a></p>
<h2>Configuring the router</h2>
<p>To start I need to create new router rtr-dmz (much as I did in Part 2), with three interfaces. One interface will be on the intranet to DMZ network/VLAN (192.168.4.1/30), another on the DMZ to internet VLAN (192.168.5.1/30)) and the third connected to the DMZ network itself(192.168.254.254/24).</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga3.png" alt="" /></p>
<p>After starting up the VM I assign the IP addresses and enable ssh.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga4.png" alt="" /></p>
<p>Now I want to verify that I can ping devices on the two interface that are connected to the DMZ subnet(192.168.254.254) and the DMZ to intranet switch (192.168.4.1). I could also check the  DMZ to internet interface but don&#8217;t have anything else on that side yet whereas I do have a machine in the DMZ and rtr-home is also on the DMZ-to-intranet switch.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga5.png" alt="" /></p>
<p>Now turning to my PC back on the &#8220;Home&#8221; LAN I can try to ping the interface of the new dmz router….</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga6.png" alt="" /></p>
<p>Oops! that didn&#8217;t work. .. As before I need to add a route on my PC so that it know how to get traffic to that interface through  rtr-home.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga7.png" alt="" /></p>
<p>Now let my try again….</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga8.png" alt="" /></p>
<p>Still no joy… what does traceroute say?</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga9.png" alt="" /></p>
<p>Ok it looks as if traffic is headed in the right direction.</p>
<p>For grins lets ping the DMZ to intranet interface of rtr-home…</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga10.png" alt="" /></p>
<p>Ok so that works and we can see from the traceroute that it&#8217;s starting its journey headed in the right direction.  The issue is that much like my PC the <strong><em>rtr-dmz</em></strong> needs to know where to send packets destined to come back to a subnet it&#8217;s not attached to. To fix this I need to add a static route on <strong><em>rtr-dmz</em></strong> back to my PC.  I also need to add routes to  the HQ and Remote LANs as well.  I&#8217;ll start by adding the route to the router:</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga11.png" alt="" /></p>
<p>Now if I try to ping  the router from my PC it works as we would expect it to.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga12.png" alt="" /></p>
<p>With that working its time to add the routes for the HQ and Remote LANs as well.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga13.png" alt="" /></p>
<p>Now if I look at what I have configured again I&#8217;m noticing that <strong><em>rtr-home</em></strong> will also need to have a static route added to get to the DMZ and the DMZ to Internet network (red-lines). This is also true of my PC.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga14.png" alt="" /><br />
After adding the static routes to<strong><em> rtr-home</em></strong> using 192.168.4.1 as the gateway I&#8217;m now able to ping a machine in the DMZ from <strong><em>rtr-home</em></strong>.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga15.png" alt="" /></p>
<p><em><span style="color: #ff0000;"><strong>Note: Typically for the scenario I&#8217;m trying to simulate there would be two sets of traffic flows. One between hosts on the &#8220;internet&#8221; and &#8220;DMZ&#8221; and the other between the DMZ and the intranet (HQ and Remote LANs).  This means I wouldn&#8217;t normally have any traffic coming across  rtr-home headed to/thru the 192.168.5.1 interface and so wouldn&#8217;t need to add a route for it to rtr-home. But since this my home lab and I prefer being able to ssh/RDP to hosts in the Internet directly rather than using the VM console(s) I&#8217;m going to go ahead and add it.</strong></span></em></p>
<p>After doing the same on my PC ( this time using 192.168.1.254 as the gateway) I&#8217;m also able to ping the machine in the DMZ.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga16.png" alt="" /><br />
Because machines in the DMZ and on the HQ and Remote LANs will use the rtr-dmz and rtr-home as their default gateways we don&#8217;t need to add manual routes to those machines.</p>
<p><span id="more-446"></span></p>
<p><a name="configuringfirewall"></a></p>
<h2>Setting up the internal firewall</h2>
<h3>Planning</h3>
<p>While I want to use the firewall  capability in Vyatta to simulate my production environment,  I also want to keep things simple.  Since I&#8217;m really more interested in the Exchange 2010 portion of the environment I&#8217;m going to take a few liberties with the rules. I&#8217;m planning on ending up with two different machines in the DMZ.  An Exchange 2003 server providing Outlook Web Access (OWA) functionality, and a box running Forefront  Threat Management Gateway (TMG).  The Exchange 2003 server would ordinarily need to have a number of ports opened up back to the domain controller(s) and other Exchange servers to be able to function properly.  Since I&#8217;ve got the Exchange 2003 server and the Domain Controller for each site installed on a single machine, I&#8217;m going to opt to let the  OWA server free access to each combined machine by IP address and not worry about specifying ports.  For the TMG box I&#8217;ll limit it to being able to communicate with the new Exchange 2010 servers by ports (443/80).  I&#8217;ll also want to make sure that I can connect to the DMZ boxes via RDP/Terminal Services.</p>
<p>My preliminary ruleset will look something like:</p>
<ol>
<li>OWA:* to 2K3-HQ:* [OWA to the combined DC/Exchange server in the HQ Lan]</li>
<li>OWA:* to 2K3-Remote:* [OWA to the combined DC/Exchange server in the Remote Lan]</li>
<li>DMZLAN:3389 to HOMELAN:*  [Traffic from any machine/port combination in the Home Lan bound for/coming  the RDP port of any machine in the DMZ]</li>
<li>TMG:* to E2KX-HQ:80 [</li>
<li>
<div>TMG:* to E2KX-HQ:443</div>
</li>
</ol>
<p>I&#8217;ll also need to add rules for traffic coming from the &#8220;Internet&#8221; but will tackle that when I build the Internet LAN.</p>
<p>A rule in Vyatta requires a minimum of three pieces of information.</p>
<ol>
<li>An action: accept packet, reject packet or drop the packet.</li>
<li>A destination (Network, host, range, etc)</li>
<li>A source (network, host, range, etc)</li>
</ol>
<p>In some of the rules I&#8217;ll be adding to the rule set I will also be specifying ports. (ex: 443 for HTTPS, 3389 for RDP, etc). Vyatta allows me to specify which interface I&#8217;ll apply a particular ruleset to, as well as what direction the traffic it&#8217;ll be applied to is going(inbound from outside the router or outbound through the interface) . In this case  I&#8217;ll apply the rules to inbound traffic on the interface attached to the DMZ subnet and not worry about restricting traffic coming into the DMZ LAN since the inbound rules will prevent a reply. I bring this up because Its important to make a decision before I start  about which traffic flow (inbound or outbound) I&#8217;ll be applying because that affects how the rules get written, specifically the source and destination parts.  For inbound traffic, the host in the DMZ will always be the source.</p>
<h3>The actual configuration</h3>
<p>To start the process I need to &#8220;create&#8221; a new ruleset.  To do this I give it a name (line 1).  Then I&#8217;ll add a description (Line 2) so that I&#8217;ll have clue as to what it does when I come back in a few months and look at it again.</p>
<p>Once the ruleset is created I can start to add individual rules by using the &#8220;modify&#8221; keyword to modify the ruleset. I start the first rule by specifying an action(Line 3), in this case it&#8217;s &#8220;accept&#8221; since we want to pass this particular traffic through.  Again I&#8217;ll add a description to this particular rule (Line 4) for allowing the OWA server to connect to the combined DC/Exchange 2003 server in the HQ LAN.   Next I&#8217;ll specify the packet source I want the rule to apply to(Line 5). In this case it&#8217;s the OWA server itself so I&#8217;ll use the IP address of the OWA server as the source.  Then I need to specify the destination (Line 6), the combined server, by IP address as well.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ Ruleset<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset description <span style="color: #ff0000;">&quot;Rule to allow OWA Server to communicate with DC/E2KX3 boxes&quot;</span><br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">1</span> action accept<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">1</span> description <span style="color: #ff0000;">&quot;Allow OWA to HQ DC/E2K3&quot;</span><br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">source</span> address 192.168.254.10<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">1</span> destination address 192.168.2.10</div></td></tr></tbody></table></div>
<p>The second rule which allows OWA traffic to the DC/E2K3 server in the Remote LAN  differs from rule 1 only in the destination.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">2</span> action accept<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">2</span> description <span style="color: #ff0000;">&quot;Allow &nbsp;OWA to Remote DC/E2K3&quot;</span><br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">source</span> address 192.168.254.10<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">2</span> destination address 192.168.2.10</div></td></tr></tbody></table></div>
<p>The third rule, to allow RDP traffic to anything in the DMZ from the Home Lan, is a little bit different from the first two in that it&#8217;s one for which I a) specify a port and b) specify networks for the source and destination.  As before I start with the action (Line 1) and a description  (Line2). Then because I&#8217;m going to specify a port I also need to specify a protocol, here it&#8217;s TCP (Line3).  Because the source can be any machine in the network I specify a network (192.168.254.0) and netmask( 255.255.255.0  a.k.a /24).  I then add the port (Line 5). For the destination I specify the Home Lan network and appropriate netmask, 192.168.1.0/24  (Line 6).</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">3</span> action accept<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">3</span> description <span style="color: #ff0000;">&quot;Allow RDP traffic back to Home LAN&quot;</span><br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">3</span> protocol tcp<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">3</span> <span style="color: #7a0874; font-weight: bold;">source</span> address 192.168.254.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span><br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">3</span> <span style="color: #7a0874; font-weight: bold;">source</span> port <span style="color: #000000;">3389</span><br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">3</span> destination address 192.168.1.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span></div></td></tr></tbody></table></div>
<p>The fourth rule specifies an IP address for both the source and destination like rules 1 and 2, but also incorporates a port option like rule 3.  The only difference between Rules 4 and  5 is that the specified port changes.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">4</span> action accept<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">4</span> description <span style="color: #ff0000;">&quot;TMG HTTP to &nbsp;E2KX-HQ&quot;</span><br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">4</span> protocol tcp<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">4</span> <span style="color: #7a0874; font-weight: bold;">source</span> address 192.168.254.20<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">4</span> destination address 192.168.2.20<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">4</span> destination port <span style="color: #000000;">80</span></div></td></tr></tbody></table></div>
<p>Rule 5</p>
<div class="codecolorer-container bash blackboard codecolorer-noborder" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">5</span> action accept<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">5</span> description <span style="color: #ff0000;">&quot;TMG HTTPS to &nbsp;E2KX-HQ&quot;</span><br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">5</span> protocol tcp<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">5</span> <span style="color: #7a0874; font-weight: bold;">source</span> address 192.168.254.20<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">5</span> destination address 192.168.2.20<br />
<span style="color: #000000; font-weight: bold;">set</span> firewall name DMZ-Ruleset rule <span style="color: #000000;">5</span> destination port <span style="color: #000000;">443</span></div></td></tr></tbody></table></div>
<h3>How I go about things</h3>
<p>Rather than entering all the rules at once, I like to commit each rule  to the running Vyatta configuration so that I can test it before I start the next rule.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga18.png" alt="" /></p>
<p>Above I&#8217;ve create the first rule. Now to I need to actually apply the ruleset to the DMZ facing interface .  This is done using the set interfaces command similar to when I assign an IP Address to an interface.  In this case I&#8217;ll be assigning the ruleset to the eth1 ethernet interface for inbound traffic.  I can then run the show firewalls command  to verify its in effect.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga19.png" alt="" /></p>
<p>Now I want do a simple test and ping the one box I should be able to reach as well as one I shouldn&#8217;t (on the Remote LAN). I do this by logging into the OWA server in the DMZ.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga20.png" alt="" /></p>
<p>Because I&#8217;m paranoid and want to make sure it&#8217;s a valid test, I&#8217;ll try to ping both the HQ and Remote servers from my desktop PC as well.  I would expect both of these pings to succeed.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga21.png" alt="" /></p>
<p>And they&#8217;re both successful. Just for good measure I&#8217;ll try to ping the OWA server in the DMZ from my desktop as well.</p>
<p><strong><span style="color: #ff0000;">Note &#8211; Because I&#8217;ve chose to take a simplistic approach to my firewalls it helps to understand what&#8217;s actually happening.  If I ping the OWA server from my desktop  I expect the ping to fail as show below.</span></strong></p>
<p><strong><span style="color: #ff0000;"> </span></strong><strong><span style="color: #ff0000;"><img src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga22.png" alt="" /></span></strong></p>
<p><strong><span style="color: #ff0000;">What is happening here is that because there isn&#8217;t an outbound rule on dmz-rtr&#8217;s DMZ interface the packet from my PC to the OWA server is actually making it to the OWA server.  It&#8217;s the returning traffic that&#8217;s getting blocked by the firewall.</span></strong></p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga17.png"> <strong><span style="color: #ff0000;"><img class="alignnone size-full wp-image-440" title="032810_0720_Simulatinga17.png" src="http://cars.lostroncos.org/wp-content/uploads/2010/03/032810_0720_Simulatinga17.png" alt="032810_0720_Simulatinga17.png" width="272" height="436" /></span></strong></a></p>
<p><strong><span style="color: #ff0000;">In a production environment you&#8217;d probably want to control the outbound traffic to the DMZ as well as traffic coming in from it.</span></strong></p>
<p>I can test the first and second rules using a couple of different methods. Since these rules govern traffic from the OWA server to the DCs simply trying to join it to the domain would be a good test if it hasn&#8217;t already been joined. If it has ensuring that I can still log on to the domain from it would tell me things seem to be working. Some more manual options would include ping, nslookup against the DNS server on the DC, an LDAP browser etc. The third rule I can test by trying to connect to the server via the Terminal Services client from my desktop PC.   The fourth and fifth rules I can simply test using a browser.</p>
<h2>Summary</h2>
<p>With this initial set of rules in place I now have my two internal networks and DMZ connected together with a  rudimentary firewall in place. Though I&#8217;ve taken some liberties with how laxly I&#8217;ve put the firewall together it sufficient to have the end result that I&#8217;ll want as I go through this process of migrating from Exchange 2003 to 2010.  In the next entry I&#8217;ll add the &#8220;Internet&#8221; and another simple firewall configuration. I&#8217;ll also need to further modify the firewall ruleset on <strong><em>rtr-dmz</em></strong> for communication between the DMZ and &#8220;Internet&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2010/03/27/simulating-a-more-interesting-environment-with-vyatta-and-vmware-pt-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simulating a more interesting environment with Vyatta and VMware ESXi &#8211; pt 2</title>
		<link>http://cars.lostroncos.org/2010/02/18/a-more-interesting-environment-with-vyatta-and-vmware-pt2/</link>
		<comments>http://cars.lostroncos.org/2010/02/18/a-more-interesting-environment-with-vyatta-and-vmware-pt2/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 22:37:37 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[Home Lab]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[vyatta]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/?p=343</guid>
		<description><![CDATA[<p>In an earlier post I went through the process of coming up with a solution to be able to test an Exchange 2003 to Exchange 2010 migration using VMs. In order to simulate a multi-site AD environment I wanted to use Vyatta based routers to create my network infrastructure. In this post I&#8217;ll actually walk [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cars.lostroncos.org/2010/02/17/a-more-interesting-environment-with-vyatta-and-vmware/">In an earlier post</a> I went through the process of coming up with a solution to be able to test an Exchange 2003 to Exchange 2010 migration using VMs. In order to simulate a multi-site AD environment I wanted to use Vyatta based routers to create my network infrastructure. In this post I&#8217;ll actually walk through the process of setting up the ESX and theinternal router. In the next post(s) I&#8217;ll go into configuring the DMZ and internet routers and firewalls. As a reminder the environment I want to set up will look like this&#8230;</p>
<p><a rel="lightbox[100]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga8.png"><img class="alignnone size-medium wp-image-299" title="Final Environment" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga8-300x139.png" alt="Final Environment" width="300" height="139" /></a>.</p>
<p>In order to actually be able to implement this I first had to go configure the appropriate networking configuration on each of the ESXi hosts.</p>
<p>First I needed to create a virtual switch utilizing the NIC attached to the crossover cable. This is done by going to the &#8220;Configuration&#8221; tab for the ESX host within the vSphere Client.</p>
<p><a rel="lightbox[21]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part21.png"><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part21.png" alt="" width="535" height="176" /></a></p>
<p>Clicking the &#8220;Add Networking&#8221; option will walk one through the wizard to configure the new switch. I started by choosing &#8220;Virtual Machine&#8221; on the Connection Type Screen.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part22.png" alt="" /></p>
<p>On the next page I choose to create a new virtual switch and pick the appropriate physical NIC that will be used to communicate with the other host. (If I had the capacity to put all the VMs one one host I could create the vSwitch without having to specify a network adapter)</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part23.png" alt="" /></p>
<p>Then I created an initial Port Group and specified a VLAN ID for it. In this case for the Remote Site (192.168.3.X/24) I&#8217;m specifying VLAN ID 23.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part24.png" alt="" /></p>
<p>Once completed the new virtual switch should look similar to the one shown below.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part25.png" alt="" /></p>
<p>Now that the vSwitch has been created, I can add port groups for the other networks: DMZ (192.168.254.X), Internet (10.0.0.X) and HQ(192.168.2.X).  Each one of these should have a unique VLAN ID associated with it which is also used when these port groups get created on the second host.</p>
<p><span id="more-343"></span></p>
<p>In addition I need to add port groups for the network between the DMZ and Internet router (192.168.5.X), as well as the one between the internal router and the DMZ (192.168.4.X). Because I&#8217;ll put all three routers on the same host, these last two port groups need only exist on that one host.</p>
<p>When all is said and done there should be 6 port groups defined on the vSwitch on the host where I&#8217;ll put the routers and 4 port groups on the other host. Notice that the VLAN IDs for each network match up across the two switches.</p>
<p><a rel="lightbox[26]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part26.png"><img title="Completed vSwitch Configs" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part26.png" alt="" width="544" height="349" /></a></p>
<p>I initially tried this setup using an alpha version 6 of Vyatta but the routers felt a little slow to me (though I have no empirical evidence to back that up) so I went back to using version 5 LiveCDs for the routers as discussed in the earlier entry.</p>
<h2>Building the internal router</h2>
<p>I started by creating a custom VM for the internal or home router with 4 network adapters configured. I used the custom configuration because this VM won&#8217;t actually have a virtual hard disk. The four network adapters will be attached to my home LAN (lostroncos_01), the HQ Site Network, the Remote Site Network and the intranet to DMZ network. (Note: <a href="http://cars.lostroncos.org/2008/09/18/using-vyatta-with-vmware/">This post has a more detailed description</a> of the process I used to create Vyatta routers. )</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part27.png" alt="" /></p>
<p>After powering on the router and opening the VM console I like to enable the NIC on my home network and ssh so I can do the rest of the configuration via an ssh client such as Putty. Once the VM has initially been powered on, I can go back and look at the settings and determine the MAC address of the NIC attached to my home network (lostroncos_01) is 00:0c:29:76:e2:07. Upon logging into the VM console I can go into configure mode by entering the command &#8220;configure&#8221; and then get a list of the interfaces the router knows about by entering &#8220;show interfaces&#8221;.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part28.png" alt="" /><br />
The one I&#8217;m interested in initially configuring is eth0. I can tell because the MAC matches the one I took note of earlier. To configure it to use 192.168.1.254 as it&#8217;s address and enable ssh I can do the following:</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part29.png" alt="" /></p>
<p>Let&#8217;s look at these commands in a little more detail.</p>
<p>The  set interfaces command can take a wide variety of arguments. Here I&#8217;m specifying that I want to work on an ethernet interface. Other interface types include adsl, bonding, bridge, loopback, multilink, openvpn, serial, tunnel and wirelessmodem.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part210.png" alt="" /></p>
<p>Even after specifying the type as <strong><em>ethernet</em></strong> and the particular interface (eth0) I can still use one of several subcommands/options.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part211.png" alt="" /></p>
<p>Because I&#8217;m using VMs and a fairly generic setup I really only need to worry about the <strong><em>address</em></strong> option. So I specify the address and netmask notation by specifying the number of bits to use for the netmask (24).</p>
<p>The next command <strong><em>&#8220;set service ssh</em></strong>&#8221; simply enables the SSH server.</p>
<p>Now I&#8217;ve configured the interface and enabled SSH, but the settings haven&#8217;t been made active. That&#8217;s what the<strong><em> &#8220;commit&#8221;</em></strong> command does.</p>
<p>Executing the &#8220;<strong><em>show interfaces</em></strong>&#8221; command again I can see that the IP(v4) address is set for eth0 but not any of the other interfaces. Now I can use my ssh client to connect to the VM to finish the configuration. (One can also use the VMware console to perform all of the configuration steps, I just prefer an external SSH client).</p>
<p>After making sure the MAC addresses and networks match up the way I think they should, I can set the address for each of the other interfaces and commit the changes. Then I can exit the configuration mode by typing &#8220;<strong><em>exit</em></strong>&#8221; and save the configuration to the virtual floppy using the &#8220;<strong><em>init-floppy</em></strong>&#8221; command.  This then ensures that my configuration will survive reboots of the router.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part212.png" alt="" /></p>
<p>One of the other things than can be helpful to do is to use the &#8220;<strong><em>description</em></strong>&#8221; option with  set interfacse to provide a little more information when logged into the router.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part213.png" alt="" /></p>
<p>After doing this for each interface and then committing the changes I can see the descriptions when doing show interfaces from either the configure mode</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part214.png" alt="" /></p>
<p>Or from the actual router shell</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part215.png" alt="" /></p>
<p>Since I happen to  already have VMs on both the HQ and Remote networks I can verify basic connectivity from the router by pinging those VMs as well as my PC.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part216.png" alt="" /></p>
<p>The next trick is to validate that I can ping the HQ and Remote subnets from my physical PC. Since both of those subnets are directly connected to the router I don&#8217;t need to add any static routes on the router. However I do need to add a route on my PC to reach those subnets. Otherwise it&#8217;ll try to use the default gateway out to my ISP (as shown below) which doesn&#8217;t know anything about this lab environment.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part217.png" alt="" /></p>
<p>To reach the 192.168.[2,3,4] subnets I want to use the interface on rtr-home that&#8217;s attached to my home network (192.168.1.254). So using the &#8220;<strong><em>route</em></strong>&#8221; command from a command prompt on my Windows7 machine I can add the route to 192.168.4.X.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part218.png" alt="" /></p>
<p>The route command in this case takes a few arguments…</p>
<p style="margin-left: 27pt">#1 <strong><em>add </em></strong>tells route I&#8217;m adding a new one</p>
<p style="margin-left: 27pt">#2 Next I specify the destination, and since ultimately I&#8217;m trying to get to a subnet we&#8217;ll specify <strong><em>192.168.4.0</em></strong>.</p>
<p style="margin-left: 27pt">#3 &amp; #4 <strong><em>MASK </em></strong>says the next argument is the netmask relative to the destination</p>
<p style="margin-left: 27pt">#5 is the gateway for this destination, in this case the interface on my virtual router that&#8217;s attached to the home network.</p>
<p>Once that&#8217;s done I can then try to ping &amp; tracert the 192.168.4.2 interface on the router again.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part219.png" alt="" /><br />
<img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part220.png" alt="" /></p>
<p>Executing the <strong><em>&#8220;route print&#8221;</em></strong> command from the Command Prompt  I can see the entry for the 192.168.4.X network as I would expect.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part221.png" alt="" /></p>
<p>Now that this particular routing entry appears to be working properly I can re-run the route command with the <strong><em>-p</em></strong> option so that it&#8217;s persistent across reboots of my home PC.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part222.png" alt="" /><br />
Next I need to add routes for the 192.168.2.X and 192.168.3.X networks to the PC as well.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part223.png" alt="" /></p>
<p>At this point, I can try to do a traceroute from my PC to the VM on the HQ Site network that I was able to ping earlier from the router.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part224.png" alt="" /><br />
Because I&#8217;m occasionally paranoid, the next step for me was to connect to the console of the VMs on the HQ (shown below) and Remote (not shown) subnets and verify that I can ping machines on my home LAN across the internal router, rtr-home.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_2236_Part225.png" alt="" /></p>
<p>At this point my internal Vyatta router is routing traffic between subnets it is directly connected to (Home LAN, the HQ Site and Remote Site). Once the DMZ and Internet routers are set up some changes will need to be made on the internal router to get traffic to those non-connected subnets. I&#8217;ll go through that process in a subsequent post.</p>
<p>-crt</p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2010/02/18/a-more-interesting-environment-with-vyatta-and-vmware-pt2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Simulating a more interesting environment with Vyatta and VMware ESXi</title>
		<link>http://cars.lostroncos.org/2010/02/17/a-more-interesting-environment-with-vyatta-and-vmware/</link>
		<comments>http://cars.lostroncos.org/2010/02/17/a-more-interesting-environment-with-vyatta-and-vmware/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 07:05:08 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Home Lab]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vyatta]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/?p=300</guid>
		<description><![CDATA[<p>[Part 2 of this series which involves the actual configuration of the Vyatta routers is now up here -crt]</p>
<p>At work we&#8217;ve recently made the decision to migrate to Exchange 2010 from Exchange 2003. While we do have an environment that we can use for some testing of the migration it doesn&#8217;t mimic our production environment [...]]]></description>
			<content:encoded><![CDATA[<p><em>[Part 2 of this series which involves the actual configuration of the Vyatta routers is</em><a href="http://cars.lostroncos.org/2010/02/18/a-more-interesting-environment-with-vyatta-and-vmware-pt2/"><em> now up here</em></a><em> -crt]</em></p>
<p>At work we&#8217;ve recently made the decision to migrate to Exchange 2010 from Exchange 2003. While we do have an environment that we can use for some testing of the migration it doesn&#8217;t mimic our production environment closely enough for me to be comfortable using it as the sole test area. Given the changes in how Exchange 2010 (E2KX) works vs 2003 I wanted to be able to simulate multiple (2) Active Directory sites (i.e. subnets), a DMZ, and the &#8220;Internet&#8221; including some really simple firewalls.</p>
<p>I wanted to use virtual machines to go through this exercise so that I could take snapshots and repeat the various steps and/or variations of them if necessary. In order to do this I utilized the Vyatta Community Edition based routers to help create my virtual &#8220;enterprise&#8221; environment. I&#8217;ve talked about<a href="http://cars.lostroncos.org/2008/09/18/using-vyatta-with-vmware/" target="_blank"> Vyatta before in this article</a>. In this post I&#8217;ll talk a little about the process I went through to get to my final configuration (shown below).  In subsequent articles I&#8217;ll go  through the actual router and VMware configuration process.</p>
<div id="attachment_299" class="wp-caption alignnone" style="width: 830px"><a rel="lightbox[8]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga8.png"><img class="size-large wp-image-299" title="Final Environment" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga8-1024x477.png" alt="Final Environment" width="820" height="382" /></a><p class="wp-caption-text">The final environment as laid out on two interconnected servers</p></div>My lab environment at home consists of two Dell PowerEdge servers (one a PE2850, the other a 2950 each with 8Gigs of RAM). Both servers are running ESXi 4.0. Since the 2850 can&#8217;t run 64 bit VMs I was going to install the Exchange 2003 servers and Windows 2003 DCs on it. Then I&#8217;d install VMs running Server 2008R2 on the 2950 with Exchange 2010. Both servers are connected to my home network and since I was going to be using both I wanted to have some way for VMs on each host to be able to communicate with others without necessarily having all the traffic come across my home network. Since both Dells have multiple NICs I connected them with a crossover cable ending up with something like this:</p>
<p><div class="wp-caption alignnone" style="width: 504px"><img title="A physical view" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga1.png" alt="" width="494" height="384" /><p class="wp-caption-text">Physical view of the network </p></div>
<p>In initially penciling out a plan for what I wanted to do I had nine VMs scattered across four subnets.</p>
<div class="wp-caption alignnone" style="width: 706px"><a rel="lightbox[2]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga2.png"><img title="Multi-gateway subnets" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga2.png" alt="" width="696" height="332" /></a><p class="wp-caption-text">Isolated environment with multiple gateways per subnet</p></div>Considering my limited resources and my need to keep some other unrelated VMs up and running while I&#8217;m testing, I trimmed this down to 7 by combining the Domain Controllers and Exchange 2003 servers together in the HQ and Remote subnets.</p>
<p><div class="wp-caption alignnone" style="width: 443px"><img title="Consolidating functions to reduce # of VMs" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga3.png" alt="" width="433" height="387" /><p class="wp-caption-text">Consolidating functions to reduce # of VMs</p></div>
<p>In further looking at this from a networking perspective, I was hit with the realization the initial configuration with two routers attached to the HQ and DMZ subnets would require me to manage routing on<strong><em> each individual VM</em></strong> in each of those subnets as well as on each of the routers. As an example one can look at the Exchange 2010 server in the HQ site/subnet.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga4.png" alt="" /></p>
<p><span id="more-300"></span></p>
<p>In this particular case the Exchange server would need to be able to route some traffic to the DMZ via 192.168.2.253 and other traffic to the &#8220;Remote&#8221; site via 192.168.2.254. (If the server was going to communicate directly with machines in our fake &#8220;Internet&#8221; I&#8217;d have to add yet another routing entry.) I can of course configure a default gateway when configuring the NIC, but still have to manually add a route for the other gateway. This process then has to be repeated on each machine. It then gets more complicated if I want to be able to use Terminal Services (RDP) to connect to the VMs rather than using the VM remote console because I now have to figure out how to connect the virtual routers to my home network and potentially add yet another routing entry.</p>
<p>I decided I&#8217;d rather have a single gateway on each subnet (so I only had to specify a default gateway on each VM) and then rely on the routers to do all the routing. I considered a couple of different ways to do this. One option was do something &#8220;meshy&#8221; where the router for each subnet was connected to common shared subnet.</p>
<p><a rel="lightbox[5]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga5.png"><img title="A &quot;mesh-y&quot; solution" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga5.png" alt="" width="591" height="378" /></a></p>
<p>This would have had the desired effect a single gateway for each subnet regardless of where traffic was going, but would have required 5 virtual routers which seemed a little excessive. Going in the other direction, another option was to have a single router connected to everything.</p>
<div class="wp-caption alignnone" style="width: 626px"><a rel="lightbox[6]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga6.png"><img title="Single-router solution" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga6.png" alt="" width="616" height="336" /></a><p class="wp-caption-text">Single-router solution</p></div><a rel="lightbox[6]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga6.png"><br />
</a></p>
<p>I ended up with a solution somewhere between the &#8220;mesh&#8221; and the single mongo router. It employs three routers. I decided on this partly because I wanted to keep things relatively simple especially since I was going to be enabling the firewall functionality between the DMZ and Internet (and wanting to limit the damage I could do to myself when working late at night).<br />
<a rel="lightbox[7]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga7.png"><br />
<img src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga7.png" alt="" width="649" height="317" /></a></p>
<p>Again, when all was said and done the environment I ended up with looks like the one below. In the next couple of entries I&#8217;ll go through the actual process of building the networking side of this.</p>
<p><div class="wp-caption alignnone" style="width: 784px"><a href="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga8.png"><img title="Physical/Logical view" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/021810_0704_Simulatinga8.png" alt="" width="774" height="361" /></a><p class="wp-caption-text">Physical/Logical view</p></div>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2010/02/17/a-more-interesting-environment-with-vyatta-and-vmware/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Vyatta with VMware</title>
		<link>http://cars.lostroncos.org/2008/09/18/using-vyatta-with-vmware/</link>
		<comments>http://cars.lostroncos.org/2008/09/18/using-vyatta-with-vmware/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 08:10:26 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[Home Lab]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshd]]></category>
		<category><![CDATA[vyatta]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/?p=94</guid>
		<description><![CDATA[<p style="margin-left: 1pt">[Note: I've started another series of posts using Vyatta in VMware for a more complex environment that starts with this one- crt (2/20/2010)]</p>
<p style="margin-left: 1pt">
<p style="margin-left: 1pt">After finally getting around to clearing space in the garage and getting an old Dell PowerEdge 2650 I&#8217;d acquired up and running with VMware ESXi I started [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-left: 1pt"><em>[Note: I've started another series of posts using Vyatta in VMware for a more complex environment that <a href="http://cars.lostroncos.org/2010/02/17/a-more-interesting-environment-with-vyatta-and-vmware/">starts with this one</a>- crt (2/20/2010)]</em></p>
<p style="margin-left: 1pt">
<p style="margin-left: 1pt">After finally getting around to clearing space in the garage and getting an old Dell PowerEdge 2650 I&#8217;d acquired up and running with VMware ESXi I started to think about what I&#8217;d need to do to set up a few tests/scenarios I wanted to play with. One of these includes the use of Read Only Domain Controllers in Windows Server 2008. Setting up a virtualized Domain Controller (DC) in VMware is easy enough, the trick was trying to figure out how to  simulate multiple IP subnets given that I only have one ESX box at the moment.</p>
<p style="margin-left: 1pt">At work I can do the whole assigning port groups and VLANs thing and let our physical routers do the routing.  For my home lab what I needed was some sort of virtual router that didn&#8217;t require 1) a bunch of work to configure, 2) lots of resources on my small host. That&#8217;s where Vyatta comes in.  In addition to their networking appliances they also provide a &#8220;Community Edition&#8221; of their software as either a Virtual Appliance (for VMware server it appears) or as a Live CD.</p>
<p style="margin-left: 1pt">I&#8217;ve chosen to use the Live CD for my particular lab scenario because it&#8217;s much smaller and since it&#8217;s based on an ISO image I can have multiple installations/configurations for just the cost of a virtual floppy image for each instance.</p>
<p style="margin-left: 1pt">Ultimately my goal is to get to a configuration resembling the following diagram all on one physical server:</p>
<p style="margin-left: 1pt">
<p style="margin-left: 1pt"><img src="http://cars.lostroncos.org/wp-content/uploads/2008/09/091808-0810-usingvyatta1.png" alt="" /><span style="font-family:Times New Roman; font-size:12pt"><br />
</span></p>
<p style="margin-left: 1pt">
<p style="margin-left: 1pt">In this post I&#8217;ll describe setting up Vyatta using the LiveCD image and validating that routing is happening.</p>
<p style="margin-left: 1pt"><span id="more-94"></span></p>
<p style="margin-left: 1pt">The first thing I had to do was create a second virtual switch (vSwitch1) on my ESX box for the second subnet. One could just as easily create port groups and  use VLANs on the first switch but I wanted to keep it really simple for now plus I think that conceptually this fits the model a little better.</p>
<p style="margin-left: 1pt">
<p style="margin-left: 1pt"><img src="http://cars.lostroncos.org/wp-content/uploads/2008/09/091808-0810-usingvyatta2.png" alt="" /><span style="font-family:Times New Roman; font-size:12pt"><br />
</span></p>
<p style="margin-left: 1pt">
<p style="margin-left: 1pt"><span style="font-size:16pt"><strong>Creating the second virtual switch<br />
</strong></span></p>
<p style="margin-left: 1pt">
<p style="margin-left: 1pt">The second virtual switch can be created by navigating to the server node in the Virtual infrastructure client. Then going to the Configuration tab. Select the Add Networking option. Choose the &#8220;Virtual machine&#8221; connection type. Click next. Choose &#8220;create a virtual switch&#8221; and uncheck the NIC (if applicable). Click next. Specify a network label. (in my case this is the virtual &#8220;remote site&#8221;). Click &#8220;Next&#8221; click Finish<span style="font-family:Times New Roman; font-size:12pt"><br />
</span></p>
<p style="margin-left: 1pt">
<p style="margin-left: 1pt"><img src="http://cars.lostroncos.org/wp-content/uploads/2008/09/091808-0810-usingvyatta3.png" alt="" /><span style="font-family:Times New Roman"><br />
</span></p>
<p style="margin-left: 1pt">
<p style="margin-left: 1pt"><span style="font-size:16pt"><strong>Creating the Vyatta VM.<br />
</strong></span></p>
<p style="margin-left: 1pt">I started by downloading the  Vyatta Live-CD image from <a href="http://www.vyatta.com/download/swdl.php">http://www.vyatta.com/download/swdl.php</a>.  Once I had a local copy of the ISO,  I uploaded it to the ESXi box.</p>
<p style="margin-left: 1pt">Actually creating the VM four our purposes consists of two parts: the initial creation, and then the creation of the floppy image to store the configuration. Because I prefer to keep the floppy image with the VM&#8217;s config files I have to perform that portion of the configuration after the VM (and it&#8217;s associated folder) is created.   Using your good friend the VMware Infrastructure Client here&#8217;s the first set of steps to follow, (<em>they&#8217;ll probably be fairly familiar with the slight change that we&#8217;re <strong>not going to add a hard disk</strong></em>).</p>
<p style="margin-left: 1pt">
<p style="margin-left: 28pt">Steps for Initial creation</p>
<p style="margin-left: 55pt">
<ol>
<li>File -&gt; New Virtual Machine</li>
<li>Custom Virtual Machine Configuration (Next)</li>
<li>Specify the Virtual Machine&#8217;s Name (Next)</li>
<li>Select the Datastore where you want to store the VM (Next)</li>
<li>Choose Linux for the guest Operating System  and  RHEL5-32bit as the version. (Next)</li>
<li>Select the number of virtual CPUs, I chose 1. (Next)</li>
<li>Specify the amount of memory 128 MB RAM</li>
<li>Specify the number of NICs. For my scenario I chose 2 and assigned one to each virtual switch (Next)</li>
<li>Pick a Scsi adapter type  the choice here doesn&#8217;t really matter since we won&#8217;t be adding a hard drive to this VM.(Next)</li>
<li>Choose &#8220;Do Not create a disk&#8221;. (Next)</li>
<li>Finish</li>
</ol>
<p>Now that the VM has been created we want to right click on it in the VIClient and choose &#8220;Edit Settings&#8221;</p>
<p style="margin-left: 28pt">
<p style="margin-left: 28pt">In the Virtual Machine Properties window go to the Hardware tab.</p>
<p style="margin-left: 28pt">Select the Floppy Drive.</p>
<ol>
<li>
<ol>
<li>Choose &#8220;Create new floppy image in datastore&#8221; as the Device Type</li>
<li>Click &#8220;Browse&#8221; and navigate to the directory in the datastore where you want to keep the floppy image.</li>
<li>Specify the name of the floppy image. (ex: vyatta-config) and click &#8220;OK.&#8221;</li>
<li>Ensure that the checkbox next to &#8220;Connect at power on&#8221; is checked,</li>
<li>Click Ok.</li>
</ol>
</li>
</ol>
<p style="margin-left: 28pt">Select the CD/DVD Drive</p>
<ol>
<li>
<ol>
<li>Choose Datastore ISO file as the Device Type.</li>
<li>Click Browse and navigate to where the ISO image is stored.</li>
<li>Set to connect at power on and click OK</li>
</ol>
</li>
</ol>
<p>You&#8217;re now ready to poweron the vm and begin the process of configuring it. Power it on via the VI client and connect to the console.  You can log in as &#8216;vyatta&#8217; with the password &#8216;vyatta&#8217;. The first thing you should do is make sure your VM sees both of the assigned NICs. This can be done by typing:  /sbin/ifconfig | grep -i ethernet. You should see two lines of output; one starting with &#8216;eth0&#8242; the other with &#8216;eth1&#8242;.</p>
<pre> 

vyatta@vyatta:/$ /sbin/ifconfig | grep -i ethernet

eth0      Link encap:Ethernet  HWaddr 00:0c:29:be:8e:2d

eth1      Link encap:Ethernet  HWaddr 00:0c:29:be:8e:37

vyatta@vyatta:/$</pre>
<p>To configure the router to match our diagram above we&#8217;re going to assign eth0 the IP address 192.168.1.10 and use a subnet mask of 255.255.255.0 (/24). The second NIC will be assigned the IP address 192.168.2.10.  To do this we&#8217;ll enter the four following commands.</p>
<p style="padding-left: 30px; ">configure</p>
<p style="padding-left: 30px; ">Set interfaces ethernet eth0 address 192.168.1.10/24</p>
<p style="padding-left: 30px; ">Set interfaces ethernet eth1 address 192.168.2.10/24</p>
<p style="padding-left: 30px; ">commit</p>
<p style="padding-left: 30px; ">exit</p>
<p>The first &#8216;configure&#8217; puts Vyatta into configuration mode where we can enter actual configuration commands. You might notice that the prompt changes from <strong><em>vyatta@vyatta:~$</em></strong> to <em><strong>vyatta@vyatta#.</strong></em> The second command assigns an IP address to the interface eth0, while the third does the same for eth1. The fourth command &#8220;commit&#8221; actually commits the changes so that they&#8217;re in use in the running config. The last command exits the configuration mode and you&#8217;ll notice that the prompt has changed back as well</p>
<pre> yatta@vyatta:~$ configure
[edit]
vyatta@vyatta# set interfaces ethernet eth0 address 192.168.1.10/24
[edit]
vyatta@vyatta# set interfaces ethernet eth1 address 192.168.2.10/24
[edit]
vyatta@vyatta# commit
[edit]
vyatta@vyatta# exit
exit
vyatta@vyatta:~$</pre>
<p style="margin-left: 55pt; padding-left: 30px; ">
<p style="margin-left: 1pt">To validate that this is now the running configuration you can type: show configuration</p>
<p style="margin-left: 1pt">
<p style="margin-left: 1pt">Now to ensure that this configuration sticks with the VM between reboots we need to initialize the attached floppy by entering &#8216;init-floppy&#8217; This will cause the VM to (re)format the floppy and write the configuration to the floppy.</p>
<pre>vyatta@vyatta:/$ init-floppy

This will erase all data on floppy /dev/fd0.

Your configuration was saved in: /media/floppy/config/config.boot

vyatta@vyatta:/$

<img src="http://cars.lostroncos.org/wp-content/uploads/2008/09/091808-0810-usingvyatta5.png" alt="" /></pre>
<p style="margin-left: 1pt">To validate that the configuration has been properly saved to the floppy and will be automatically available and in use upon reboot you can reboot the VM by typing &#8220;reboot&#8221; and waiting for the VM to reboot. Upon logging back in you can again run the &#8217;show configuration&#8217; command to see if the config has been kept through the reboot.</p>
<p style="margin-left: 27pt">
<h2><strong> How do I know routing is working? </strong></h2>
<p>Now that the router has been set up with an interface on each of your virtual switches/subnets you need to verify that it will actually route packets between the two subnets. One way to do this is to create two VMs, one on each virtual switch configured to use the appropriate router interface as its default router.  That can be a bunch of work just to test the routing depending on what kind of guest you use. Another option which I used to do my intital testing was to create two more VMs using the Vyatta LiveCD.  Simply by entering a few commands I can quickly have a configured VM on each subnet that I can use to ping back and forth with.  For the VM on the 192.168.1 subnet I could enter the following commands to configure the new VM.</p>
<pre>configure
set interfaces eth0 address 192.168.1.11/24
set system gateway-address 192.168.1.1
commit
exit</pre>
<h2>Enabling SSH</h2>
<p>I also like to enable ssh access for the vyatta router so I can use Putty from my Windows box to administer the VM and not have to use the VI Client console. That can be done by entering:</p>
<pre>configure
set service ssh
commit
exit</pre>
<h2>Saving your configuration</h2>
<p>Again to ensure that this is kept in the config through reboots you need to execute the &#8216;init-floppy&#8217; command.</p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2008/09/18/using-vyatta-with-vmware/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
