<?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>Gettin' My Geek On &#187; HomeNetworking</title>
	<atom:link href="http://www.markstevens20.net/blog/tag/homenetworking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markstevens20.net/blog</link>
	<description>Ramblings on my experiments with Linux, networking, and collaboration aps</description>
	<lastBuildDate>Sat, 30 Jan 2010 01:23:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>NFSv4 Configuration</title>
		<link>http://www.markstevens20.net/blog/2009/09/nfsv4-configuration/</link>
		<comments>http://www.markstevens20.net/blog/2009/09/nfsv4-configuration/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 01:35:35 +0000</pubDate>
		<dc:creator>Mark Stevens</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[HomeNetworking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.markstevens20.net/blog/?p=278</guid>
		<description><![CDATA[Having figured out Samba shares, I thought I would tackle remote file systems between Linux machines using NFS (Network File Service). The documentation looked clear enough, but it wasn&#8217;t quit as easy as I expected, largely due to the differences between version 3 and 4 of NFS with respect to: firewall behavior exporting file system [...]]]></description>
			<content:encoded><![CDATA[<p>Having figured out <a href="http://www.markstevens20.net/blog/2009/06/linux-windows-xp-home-networking/" target="_blank" title="my Samba config blog post">Samba shares</a>, I thought I would tackle remote file systems between Linux machines using NFS (Network File Service).  The <a href="http://www.centos.org/docs/5/html/5.2/Deployment_Guide/ch-nfs.html" target="_blank" title="Centos.org doc for NFS">documentation</a> looked clear enough, but it wasn&#8217;t quit as easy as I expected, largely due to the differences between version 3 and 4 of NFS with respect to:</p>
<ul>
<li>firewall behavior</li>
<li>exporting file system syntax and use of pseudo file systems</li>
<li>difference in mount command syntax</li>
</ul>
<p>I am running systems that use SELinux and <a href="#footnote" title="link to blog footnote">firewalls*</a>.  I have one Centos 5.3 NFS server and three client machines running as <a href="#footnote" title="link to blog footnote">virtual machines**</a> on the server.  My goal was to establish remote file systems for the virtual machine clients. I&#8217;ll skip some of the introductory steps to set up the nfs server process that are listed in the <a href="http://www.centos.org/docs/5/html/5.2/Deployment_Guide/ch-nfs.html" target="_blank" title="Centos.org doc for NFS">doc</a>.</p>
<p>I&#8217;ll list the commands that I used to export the file system from the server and the mount command I first used on the client.  The file system that I was attempting to export was /junk/client1.  On the server (server.stevens.net), I added the following to /etc/exports:</p>
<div class="code">
[root@sserver ~]# <b>vi /etc/exports</b><br />
<b>/junk/client1  client1.stevens.net(rw)</b> <i>(:wq!)</i><br />
[root@sserver /]# <b>exportfs -rv</b><br />
[root@sserver /]# exportfs -rv<br />
exporting client1.stevens.net:/junk/client1<br />
[root@sserver /]# service nfs restart<br />
Shutting down NFS mountd:                                  [  OK  ]<br />
Shutting down NFS daemon:                                  [  OK  ]<br />
Shutting down NFS quotas:                                  [  OK  ]<br />
Shutting down NFS services:                                [  OK  ]<br />
Starting NFS services:                                     [  OK  ]<br />
Starting NFS quotas:                                       [  OK  ]<br />
Starting NFS daemon:                                       [  OK  ]<br />
Starting NFS mountd:                                       [  OK  ]
</div>
<p>and I used the following mount command on client1.stevens.net (and received the error shown):</p>
<div class="code">
[root@client1 ~]# <b>mount -t nfs4 sserver.stevens.net:/junk/client1 /remotesys</b><br />
mount.nfs4: sserver.stevens.net:/junk/client1 failed, reason given by server: No<br />
such file or directory.
</div>
<p>A bit surprised that it didn&#8217;t work, I poked around the Internet and I found some good info that ultimately helped me get on the right track at <a href="http://www.brennan.id.au/19-Network_File_System.html#nfs4" target="_blank" title="http://www.brennan.id.au/index.html"> Miles Brennan&#8217;s Linux Home Server HOWTO page</a>. He does an excellent job explaining the pseudo file system configuration required for version 4 of NFS.</p>
<p>I built out the following psuedo file system on the server:</p>
<div class="code">
[root@sserver /]# <b>mkdir NFS4exports</b><br />
[root@sserver /]# <b>cd NFS4exports</b><br />
[root@sserver NFS4exports]# <b>mkdir client1</b><br />
[root@sserver NFS4exports]# <b>mkdir client2</b>
</div>
<p>I then created bindings in /etc/fstab between /NFS4exports and /junk directories as follows (Bindings are like symbolic links, but the files are available in both filesystems, rather than being linked to the source location.):</p>
<div class="code">
[root@sserver /]# <b>vi /etc/fstab</b><br />
<b>/junk/client1            /NFS4exports/client1    none    bind         0 0<br />
/junk/client2            /NFS4exports/client2    none    bind         0 0</b><br />
[root@sserver /]# <b>mount -a -t none</b><br />
[root@sserver /]# <b>cd /NFS4exports/client1</b><br />
[root@sserver client1]# <b>ls -ltr</b> <i> This actually displays the files &#038; directories in the /junk/client1/ directory. </i><br />
total 24<br />
drwxrwxrwx 2 root root 4096 Sep  7 13:38 backup<br />
drwxrwxrwx 2 root root 4096 Sep  7 13:38 filestore<br />
-rwxrwxrwx 1 root root   39 Sep  7 13:41 client1.txt
</div>
<p>Then I list the pseudo file systems in the /etc/exports file, and it is critical to note that the fsid=0 option be defined on the /NFS4exports file system (even though /NFS4exports itself will not be mounted by a remote client).  Then all exported file systems are sub-directories of this system.  If I had additional file systems elsewhere on the server that I wanted to share (say, /home), I would need to create an entry in the pseudo file system and bind it to /home in fstab.</p>
<div class="code">
[root@sserver client1]# <b>vi /etc/exports<br />
/NFS4exports *.stevens.net(ro,fsid=0)<br />
/NFS4exports/client1 client1.stevens.net(rw,nohide)</b><br />
<b>/NFS4exports/client2 client2.stevens.net(rw,nohide)</b><br />
<i>then export with <b>exportfs -rv</b> and restart nfs</i>
</div>
<p>Then I mounted the file systems from the client1 system.  A major difference between the NFSv3 and NFSv4 command is that the root pseudo filesystem is <b>not</b> included in the identity of the remote file system (i.e., the NFS4exports directory is omitted from the command.</p>
<div class="code">
[root@client1 /]# <b>mount -t nfs4 sserver.stevens.net:/client1 /remotesys</b><br />
[root@client1 /]# <b>ls -ltr /remotesys</b><br />
total 24<br />
drwxrwxrwx 2 root root 4096 Sep 7 13:38 backup<br />
drwxrwxrwx 2 root root 4096 Sep 7 13:38 filestore<br />
-rwxrwxrwx 1 root root 39 Sep 7 13:41 client1.txt
</div>
<p>And on client2, showing an example that it can mount the client1 directory, but can&#8217;t see anything or write to it:</p>
<div class="code">
[root@client2 /]# <b>mount -t nfs4 sserver.stevens.net:/client1 /remotesys</b><br />
[root@client2 /]# <b> cd /remotesys</b><br />
[root@client2 remotesys]# <b>ls</b><br />
[root@client2 remotesys]# <b>mkdir test</b><br />
mkdir: cannot create director &#8216;test&#8217;: Read-only file system<br />
[root@client2 remotesys]# <b>cd..</b><br />
root@client2 /]# <b>umount /remotesys</b><br />
[root@client2 /]# <b>mount -t nfs4 sserver.stevens.net:/client2/remotesys</b><br />
[root@client2 /]# <b> cd /remotesys</b><br />
[root@client2 remotesys]# <b>ls -ltr</b><br />
total 24<br />
drwxrwxrwx 2 root root 4096 Sep 7 13:38 backup<br />
drwxrwxrwx 2 root root 4096 Sep 7 13:38 filestore<br />
-rwxrwxrwx 1 root root 39 Sep 7 13:41 client2.txt
</div>
<p>And that completed my setup (except to modify /etc/fstab so that the new /remotesys file system will automount at boot).  The main point was to learn about NFS, but I also ended up with a way to provide storage for my virtual machines outside of the .vmdk virtual file system.<br />
<a name="footnote" id="footnote"></a><br />
<i><br />
Footnotes:<br />
* NFSv4 plays better with firewall because, unlike NFSv3, it does not make use of portmapper and rpc.mountd, rpc.statd, and rpc.lockd. I just had to open port 2049 on the firewall for NFS. However, during some troubleshooting, I needed to execute &#8220;showmount -e sserver.stevens.net&#8217; from a client machine.  The firewall blocked it, because it uses rpc.mountd and portmapper picks a random port by default.  I used /etc/sysconfig/nfs to define a static port for rpc.mountd and then opened this port on the firewall too.<br />
**  As a side note with respect to the virtualization setup, I created one vm and installed a small, simple Centos image.  Then I copied the files twice to new folders in /var/lib/vmware/VirtualMachines. Then I imported these virtual machines into VMware Server to quickly make some clones.  Just a quick edit of the /etc/sysconfig/network file to update each machine to a unique hostname, and I had 3 distinct client machines.</i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.markstevens20.net/blog/2009/09/nfsv4-configuration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux &#8211; Windows XP Home Networking</title>
		<link>http://www.markstevens20.net/blog/2009/06/linux-windows-xp-home-networking/</link>
		<comments>http://www.markstevens20.net/blog/2009/06/linux-windows-xp-home-networking/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 19:54:19 +0000</pubDate>
		<dc:creator>Mark Stevens</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[HomeNetworking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PC]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.markstevens20.net/blog/?p=88</guid>
		<description><![CDATA[I want to play with computers and networking.  My family doesn&#8217;t.  They are content with a basic Windows XP PC with email, web browsing and support for MP3 players and digital cameras.  Our XP PC is 5 years old and has exhausted its 80 GB hard drive.  Rather than buying a new Vista machine, I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/ehecatzin/63760739/"><img class="alignright" src="http://farm1.static.flickr.com/31/63760739_42e72b9ed1.jpg?v=0" alt="" width="320" height="240" /></a>I want to play with computers and networking.  My family doesn&#8217;t.  They are content with a basic Windows XP PC with email, web browsing and support for MP3 players and digital cameras.  Our XP PC is 5 years old and has exhausted its 80 GB hard drive.  Rather than buying a new Vista machine, I decided to <a title="Building a PC blog post" href="http://www.markstevens20.net/blog/?p=30" target="_blank">buy the parts to make a PC</a>, then <a title="Loading CentOS blog post" href="http://www.markstevens20.net/blog/?p=74" target="_blank">loaded CentOS Linux on it.</a> In addition to the new Liunx machine&#8217;s function as a &#8216;lab&#8217; for me to play with, it also had to provide additional storage and backup facilities for the family&#8217;s XP machine.   I know the simpler thing to do would be to simply buy a USB HDD for the XP machine, but this isn&#8217;t about simple, it&#8217;s about creating &#8216;learning opportunities.&#8217;</p>
<p>So, I have a Linux machine with tons of HDD storage space  (250 + 500 GB) .  The XP machine needs additional space.  And it must be transparent to the rest of the family.  I used <a title="http://us1.samba.org/samba/" href="http://us1.samba.org/samba/" target="_blank">Samba</a> to create file shares on the Linux machine, then created mapped network drives on the XP machine that connect automatically to the Linux machine&#8217;s HDDs at login.  It wasn&#8217;t hard, but did trip me up on a couple points.</p>
<p>Samba is an open source software package that allows Linux/Unix machines to participate in Windows networking as nodes in the Windows &#8220;Network Neighborhood&#8221; and therefore provide file sharing between Linux and Windows machines.  It was easy to install the Samba package on CentOS, using the Add/Remove software package from the desktop GUI, and included a GUI configuration tool for Samba.  The <a title="Depolyment Guide Samba Chapter" href="http://www.centos.org/docs/5/html/5.2/Deployment_Guide/ch-samba.html" target="_blank">CentOS deployment guide</a> provides good guidance for configuration, and the <a title="samba.org" href="http://us6.samba.org/samba/" target="_blank">samba.org</a> site provide an excellent extra level of detail for the software.  A couple of points to add that were key learnings for me:</p>
<ol>
<li><a href="http://www.markstevens20.net/blog/wp-content/uploads/2009/06/screenshot-package-manager.png"><img class="alignright size-medium wp-image-96" title="Samba Packages" src="http://www.markstevens20.net/blog/wp-content/uploads/2009/06/screenshot-package-manager-300x213.png" alt="Samba Packages" width="300" height="213" /></a>The Samba GUI provides a simple, easy configuration tool for the basic samba config, identifying the workgroup name, shared volumes and users/passwords.  The manual config is accomplished via the smb.conf file in /etc/samba.  Manual edit of the conf file provides more options than the GUI, including logging level, source IP address filtering, and preventing access to home directory.  However, if you make changes to this conf file, then make changes to the config via the GUI, your manual changes to the conf file will be removed.  So make the simple GUI config changes first, get a functioning system, then tweak the configuration with vi edits of the smb.conf file.</li>
<li>Windows XP required that I set samba up with &#8220;user&#8221; authentication, not &#8220;share&#8221;, and I had to encrypt the passwords on the Samba config.  Windows would not attempt to make connections when Samba was configured with unencrypted passwords.</li>
</ol>
<p>The Samba config was easier to config than the Windows XP side.  Once I had the Samba server running, I was able to go into &#8220;Network Neighborhood&#8221;, view the &#8220;workgroup nodes&#8221; and connect with the user/password set up in Samba.  Then I could map a drive letter to a share folder on the Linux box.  Easy, right?  Almost.  Even though I asked Windows to &#8216;reconnect at login&#8217;, Windows could not.  Looking at the Samba logs in var/log/samba/smbd.log (with logging set to level 3 via the conf file &#8220;log level = 3) I could tell that the problem was with XP, not Samba, and I suspect that Windows was not chaching the password.</p>
<p>The solution was a batch file that runs at startup on the XP machine.  I f<a title="http://www.watchingthenet.com/create-a-batch-file-to-map-drives-folders.html" href="http://www.watchingthenet.com/create-a-batch-file-to-map-drives-folders.html" target="_blank">ound a forum post</a> that explained the syntax very well, using the net use command.  My specific command was &#8220;net use S: \\server\storage passwd /USER:username&#8221;  Then I just had to store the batch file in the &#8216;startup&#8217; programs folder for &#8220;All Users&#8221;, and now the drive maps automatically at startup.  Then I&#8217;ll convert the &#8220;My Pictures&#8221; folder to a shortcut to a folder on the Samba shared volume.  Perfectly transparent to my family.</p>
<p>As long as the power is on the Linux box.</p>
<p><strong>Update Jul 20, 2009:</strong></p>
<p>I rebuilt my machine and used a firewall and Security Enhanced Linux (SELinux), which created a couple additional challenges.  First, the firewall had to be configured to allow smb protocol for Samba, which was easy.  Second, (and a bit more tricky) the smb.conf file had notes for SELinux, indicating that the shared folders needed to be marked with &#8220;samba_share_t&#8221;. The current labels can be displayed with &#8220;ls -ldZ /path&#8221;, and the label on a share folder can be set with &#8220;chcon -t samba_share_t /path&#8221;.<strong> </strong>Once I resolved these issues, all was fine.<strong><br />
</strong></p>
<p>Photo credit, <a title="http://www.flickr.com/photos/ehecatzin/63760739/" href="http://www.flickr.com/photos/ehecatzin/63760739/" target="_blank">eheçatzin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.markstevens20.net/blog/2009/06/linux-windows-xp-home-networking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
