<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet type="text/xsl" href="http://www.germane-software.com/~ser/Software/documentation.xsl"?>
<!DOCTYPE documentation>
<documentation> 
	<head> 
		<title>DHCPCDGUI</title>
		<version>0.1</version> 
		<date>*2002-4</date>
		<home>http://www.germane-software.com/software/dhcpcdgui</home>
		<base>dhcpcdgui</base>
		<archive type="unix">Current release</archive>
		<language>ruby</language>
		<author email="ser@germane-software.com" href="http://www.germane-software.com/~ser">Sean Russell</author>
	</head>


	<overview> 
		<purpose lang="en"> 
			<p>DHCPCDGUI is a <em>very</em> small Ruby script that can be used to
				control dhcp clients through a simple GUI interface.</p>
		</purpose> 

		<general> 
			<p>When I finally caved in and bought laptops for my wife and myself, I
				immediately found myself in need of a more dynamic home network.
				Setting up DHCP and masquerading was nearly trivial (I'll go over the
				basics below), but I had a problem in that there seemed to be no
				user-friendly utilities for starting and stopping the DHCP client on
				the laptops -- something I need to do rather regularly.  I have a
				nagging feeling that I'm missing something obvious, but after a quick
				web search, I decided to hack up a start/stop client utility.  The
				actual program is smaller than this document.</p>
			<p>Why did I use the Qt2 binding for the GUI?  Good question.  I
				could have used the Tk binding and reduced the dependancies list,
				but I think Tk is ugly, and I don't like the API.  I don't much
				like the Qt2 API, either, but at least Qt2 apps look better.  Which
				doesn't matter much for this application, since it consists
				entirely of a single button... but I'm trying to learn the Qt2 API
				for Ruby, and I'm hoping that someday the Qt2 binding will include
				KDE extensions, so I can stick my little app in the dock.  My other
				choice was the FLTK binding, but I'm waffling about which API I
				want to use.  I like the FLTK API and the toolkit itself is
				aesthetic for being small and simple.  On the other hand, FLTK is
				missing some pretty basic, and IMHO, minimal functionality, such as
				layout managers.</p>
			<p><footnote></footnote></p>
		</general>

		<requirements>
			<item><link href="http://www.ruby-lang.org">Ruby</link></item>
			<item>Qt2 (comes with most Linux distributions)</item>
			<item><link href="http://sfns.u-shizuoka-ken.ac.jp/geneng/horie_hp/ruby/index.html">Qt2 for Ruby</link></item>
		</requirements>

		<screenshots>
			<screenshot href="snapshot1.png">This is it.</screenshot>
		</screenshots>
	</overview>

	<operation lang="en">
		<subsection title="Setting up DHCP">
			<p>Setting up the dhcp client is trivial, if you're on an
				RPM based system.  Just install the RPM and (as root) run 'dhcpcd'.
				Easy.  Runnig 'dhcpcd' is basically all dhcpcdgui does.</p>
			<p>For the server, I cheated, and used the 'wizard' utility,
				a Java-based configuration tool supplied on the Mandrake install
				CDs.  If you don't want to use this, I can't help you much, but the
				files you want to look at are in /etc/sysconfig, specifically in
				the network* subdirectories.  Actually, the wizard DHCP
				configuration utility broke my system, killing the loop device,
				among other things, but hacking around in the sysconfig files, I
				eventually got it working.</p>
			<p>Sorry I can't supply more information, but I'm a programmer, not a
				network engineer, dammit.</p>
			<example></example>
		</subsection>
		<subsection title="Setting up masquerading">
			<p>Masquerading is something you set up on your dhcp server (the one
				that is connected to the internet) to allow your local networked
				machines to access the internet.  Masquerading is something you
				need if your machines don't have "registered" IP addresses (usually
				the case for home networks).  Masquerading is only required if the
				machines on your LAN are all getting to the internet through one
				machine; IE, they aren't individually connected to the network.</p>
			<p>There are very good howtos available for the full monty, but the
				basic sequence is to make sure you have the proper modules compiled
				in your kernel (in particular iptables and routing), and then use
				the iptables tool to enable masquerading on your server.  I've set
				up masquerading before, but with ipchains.  The howto I found most
				helpful in setting up masquerading on my 2.4 based systems was
				<link href="http://netfilter.samba.org/unreliable-guides/NAT-HOWTO/NAT-HOWTO.linuxdoc-4.html">the
					NAT-HOWTO</link>, provided by the folks at samba.org.</p>
		</subsection>
		<subsection title="Running dhcpcdgui">
			<p>The best thing to do is chmod u+s and chown root the script,
				unless you're concerned about security.  Then just run the script.
				You may have to change the first line of the script to point to
				your Ruby runtime and chmod +x it when you install it.  If you're
				worried about the security of u+s, then you'll have to work your
				own way around it; I don't have any other suggestions.
			</p>
			<p>Once the app is running, using it is straightforward.  dhcpcdgui
				detects whether dhcpcd is already running and acts accordingly.
				When the button says "Connect", click it to start dhcpcd.  When it
				says "Disconnect", click it to stop dhcpcd nicely.</p>
		</subsection>
	</operation>
</documentation>
