<?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; sshd</title>
	<atom:link href="http://cars.lostroncos.org/tag/sshd/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>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>
