<?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>Sekolah Linux Indonesia &#187; linux command</title>
	<atom:link href="http://www.sekolahlinux.com/tag/linux-command/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sekolahlinux.com</link>
	<description>Place for Indonesian Linuxer</description>
	<lastBuildDate>Sat, 13 Aug 2011 04:41:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Linux Mount: Quickie</title>
		<link>http://www.sekolahlinux.com/linux-mount-quickie/</link>
		<comments>http://www.sekolahlinux.com/linux-mount-quickie/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 11:17:39 +0000</pubDate>
		<dc:creator>Abu Syams</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[Linux ls command]]></category>
		<category><![CDATA[linux mount]]></category>
		<category><![CDATA[linux system administration]]></category>

		<guid isPermaLink="false">http://www.sekolahlinux.com/linux-mount-quickie/</guid>
		<description><![CDATA[Image via Wikipedia The Linux mount command is used to mount a filesystem by assigning a mount point (such as a directory below the /mnt directory) to a hard disk partition or other disk device, such as a CD-ROM drive. After the partition or device has been mounted, it can be accessed by application Linux [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sekolahlinux.com%2Flinux-mount-quickie%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sekolahlinux.com%2Flinux-mount-quickie%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 253px;">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/Image:SuSE_logo.svg"><img title="SUSE Linux distributions" src="http://upload.wikimedia.org/wikipedia/en/thumb/0/0a/SuSE_logo.svg/243px-SuSE_logo.svg.png" alt="SUSE Linux distributions" width="243" height="153" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/Image:SuSE_logo.svg">Wikipedia</a></dd>
</dl>
</div>
</div>
<div>
<p>The Linux mount command is used to mount a filesystem by assigning a mount point (such as a directory below the /mnt directory) to a hard disk partition or other disk device, such as a CD-ROM drive.</p>
<p>After the partition or device has been mounted, it can be accessed by application Linux software programs, utilities and commands.</p>
<p><strong> Example of Using the Linux mount Command </strong></p>
<p>For example, the following command:</p>
<p>$ <strong> mount     /dev/cdrom     /mnt/cdrom </strong> causes the device file named cdrom in the /dev directory to be mounted &#8220;onto&#8221; the cdrom directory below /mnt.</p>
<p>The cdrom directory becomes the &#8220;mount point&#8221; for the CD and this allows you to access the filesystem of the CD.</p>
<p>The files in the / (root) directory of the CD become accessible below the full path of /mnt/cdrom.</p>
<p><strong> </strong></p>
<p><strong>Listing the Contents of the Linux /dev System Directory Below The / (Root) Directory</strong></p>
<p>Many of the important Linux system directories, such as the /dev directory, are located directly below the / (root) directory.</p>
<p>Now look at the contents of the /dev directory and find out what Linux uses it for.</p>
<p><strong> Examples of Using the Linux ls Command to the List System Directories and the /dev Directory</strong></p>
<p>The following command lists the contents of the / directory &#8211; from any directory. The &#8220;-l&#8221; option of the ls command is not required here.</p>
<p>$ <strong> ls     / </strong> Notice the dev directory, which is below the / (root) directory in the full path of /dev.</p>
<p><strong> Viewing the Contents (Directories and Files) in the /dev Directory Path</strong></p>
<p>Now run the following command to see the contents of the /dev directory, without having to change directory.</p>
<p>$ <strong> ls    /dev </strong> <strong>Example of Using the Linux nl Command To Number Lines of Output</strong></p>
<p>The Linux <strong>nl</strong> (<strong>n</strong>umber <strong>l</strong>ine) command can be used to count and display the number of lines in a file or the output of a command.</p>
<p>In the folloinwg example, the output of the ls command is &#8220;piped&#8221; (with the vertical bar symbol) to the nl command to display a count of the output of the command.</p>
<p>$ <strong> ls     -l     /dev     |     nl </strong> This shows the device driver files for many different types of Linux hardware devices that are located in /dev and a count of the number of them.</p>
<p><strong>Linux Commands Training Tips: </strong> On more current Linux systems, the mount command may not be required and your devices may automatically mount below the /media directory. For example, if you put a CD in your drive and it automatically appears on your Linux desktop, you do not need to use the mount command to do the steps in the command example above. The Linux ls command and dev system directory concepts covered here apply to ALL Linux distributions and versions, including Ubuntu, openSUSE, Debian, SUSE, Fedora, Slackware and Red Hat Linux.</p>
<p>By the way&#8230;do you want to learn exactly how to use Linux and run Linux commands for Linux System Administration and get real, practical Linux training experience by running hundreds of examples of Linux commands? Stay tune as I add more about <a href="http://www.sekolahlinux.com/linux/">Linux.</a></p>
</div>
<p>Other related articles:</p>
<ul>
<li><a href="http://beginlinux.com/blog/2009/12/editing-mount-points/">Mounting Partitions | Editing Linux Mount Points with /etc/fstab &#8230;</a> &#8211; This tutorial explains how /etc/fstab and /etc/mtab reveal both potential and mounted partitions on the Linux server.</li>
<li><a href="http://spiralbound.net/2005/05/10/how-to-copy-a-solaris-boot-drive-to-a-disk-with-a-different-partition-layout">Copy a Solaris Boot Drive to a New Disk | spiralbound.net</a> &#8211; If you&#8217;ve ever gone to mirror a system drive with Solstice Disk suite, you know how frustrating it can be when you either don&#8217;t have any more slices to use for your meta database partitions, or all the space on the disk has already been &#8230;</li>
<li><a href="http://spiralbound.net/2005/04/05/forcing-sun-network-interfaces-to-100full-duplex">Forcing Sun Network Interfaces to 100/Full Duplex | spiralbound.net</a> &#8211; Forcing Sun Network Interfaces to 100/Full Duplex. For one reason or another, many network switches don&#8217;t like to negotiate properly with the ethernet cards in Sun servers. This can result in a lot of headaches, and sometimes the &#8230;</li>
<li><a href="http://blog.josefsson.org/2007/04/27/hacking-jobo-device/">Hacking Jobo device « Simon Josefsson&#8217;s blog</a> &#8211; I blogged earlier about buying the Linux-based Jobo Giga Vu Pro Evolution. On 2007-04-14 I asked about the source code, and on 2007-04-23 I received a reply pointing at this URL. I see now that the file can also be downloaded (much &#8230;</li>
<li><a href="http://spiralbound.net/2007/08/13/moving-large-directories-on-solaris">Moving Large Directories on Solaris | spiralbound.net</a> &#8211; Moving Large Directories on Solaris. When moving or copying really really large directories on Solaris, you can sometimes run into trouble, especially when some of the files in those directories are larger than 8 Gigabytes. &#8230;</li>
<li><a href="http://systemsboy.com/2006/12/backing-up-with-rsyncx.html">Backing Up with RsyncX – The Adventures of Systems Boy!</a> &#8211; In an earlier post I talked generally about my backup procedure for large amounts of data. In the post I discussed using RsyncX to back up staff Work drives over a network, as well as my own personal Work drive data, to a spare hard drive. Today I&#8217;d like to get a bit more specific.</li>
<li><a href="http://fox21.at/linux-mount-iso-img-ntfs-smbfs-usb-umount.html">Linux mount | FOX21.at: Free Software, Freeware, Perl, PHP, MySQL &#8230;</a> &#8211; Linux, FS, FileSystem, Mount, mounten, Partition mounten, img, iso, iso9660, NTFS, Windows, Partition, Loop, SATA, Festplatte.</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=0afdb3a9-b298-440c-8379-aa2ccfd97a75" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/linux' rel='tag' target='_self'>linux</a>, <a class='technorati-link' href='http://technorati.com/tag/linux+command' rel='tag' target='_self'>linux command</a>, <a class='technorati-link' href='http://technorati.com/tag/Linux+ls+command' rel='tag' target='_self'>Linux ls command</a>, <a class='technorati-link' href='http://technorati.com/tag/linux+mount' rel='tag' target='_self'>linux mount</a>, <a class='technorati-link' href='http://technorati.com/tag/linux+system+administration' rel='tag' target='_self'>linux system administration</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sekolahlinux.com/linux-mount-quickie/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Linux DHCP</title>
		<link>http://www.sekolahlinux.com/linux-dhcp-2/</link>
		<comments>http://www.sekolahlinux.com/linux-dhcp-2/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 05:46:42 +0000</pubDate>
		<dc:creator>Abu Syams</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[Linux DHCP]]></category>
		<category><![CDATA[linux ftp server]]></category>

		<guid isPermaLink="false">http://www.sekolahlinux.com/linux-dhcp-2/</guid>
		<description><![CDATA[Linux DHCP is Dynamic Host Configuration Protocol. It is used to control vital networking parameters of hosts (running clients)with the help of a server. DHCP is backward compatible with BOOTP. For more information see RFC 2131 (old RFC 1541) and other. (See Internet Resources section at the end of the document). This mini-tutorial covers both [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sekolahlinux.com%2Flinux-dhcp-2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sekolahlinux.com%2Flinux-dhcp-2%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div>
<p>Linux DHCP is Dynamic Host Configuration Protocol. It is used to control vital networking parameters of hosts (running clients)with the help of a server. DHCP is backward compatible with BOOTP. For more information see RFC 2131 (old RFC 1541) and other. (See Internet Resources section at the end of the document).</p>
<p>This mini-tutorial covers both the DHCP _SERVER_ daemon as well as DHCP_CLIENT_ daemon. Most people need the client daemon which is used byworkstations to obtain network information from a remote server. The serverdaemon is used by system administrators to distribute network informationto clients so if you are just a regular user you need the _CLIENT_ daemon.</p>
<h2 class="SECT2"><span style="font-weight: normal;"><span style="font-size: medium;">Downloading the client daemon (dhcpcd)</span></span></h2>
<p>Depending on your distribution you might have to download the DHCP client daemon. If you want to compile it from the source youpackage you need is called dhcpcd and the current version is 1.3.18. It is maintained by Sergei Viznyuk <tt class="EMAIL">&lt;<a href="mailto:sergei@phystech.com">sergei@phystech.com</a>&gt;</tt> andtoday it comes as a binary package with most distributions.</p>
<p>dhcpcd source can be downloaded from following locations</p>
<ul>
<li><a href="ftp://ftp.phystech.com/pub/" target="_top">ftp://ftp.phystech.com/pub/</a> (Primary site)</li>
<li><a href="http://www.cps.msu.edu/%7Edunham/out/" target="_top">http://www.cps.msu.edu/~dunham/out/</a></li>
</ul>
<p>Then follow the instructions below. They should be the same.</p>
<h2 class="SECT2"><span style="font-weight: normal;"><span style="font-size: medium;">Tying it all together</span></span></h2>
<p>After your machine reboots your network interface should be configured.Type: <strong class="COMMAND">ifconfig</strong>.</p>
<p>You should get something like this:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">          lo        Link encap:Local Loopback            inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0          UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1          RX packets:302 errors:0 dropped:0 overruns:0 frame:0          TX packets:302 errors:0 dropped:0 overruns:0 carrier:0 coll:0eth0      Link encap:Ethernet  HWaddr 00:20:AF:EE:05:45          inet addr:24.128.53.102  Bcast:24.128.53.255  Mask:255.255.254.0          ^^^^^^^^^^^^^^^^^^^^^^^          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:24783 errors:1 dropped:1 overruns:0 frame:1          TX packets:11598 errors:0 dropped:0 overruns:0 carrier:0 coll:96          Interrupt:10 Base address:0x300</pre>
</td>
</tr>
</tbody>
</table>
<p>If you have some normal number under <tt class="LITERAL">inet addr</tt> you are set. If you see0.0.0.0 don&#8217;t despair, it is a temporary setting before<strong class="COMMAND">dhcpcd</strong> acquiresthe IP address. If even after few minutes you are seeing 0.0.0.0 pleasecheck out  <a href="http://tldp.org/HOWTO/DHCP/x74.html#TROUBLESHOOTING"><em>Troubleshooting</em></a>.  DHCPcd is a daemon and willstay running as long as you have your machine on. Every three hours itwill contact the DHCP server and try to renew the IP address lease. Itwill log all the messages in the syslog (on Slackware<tt class="FILENAME">/var/adm/syslog</tt>, RedHat/OpenLinux<tt class="FILENAME">/var/log/syslog</tt>).</p>
<p>One final thing. You need to specify your nameservers. There are two ways to doit, you can either ask your provider to provide you with the addresses of yourname server and then put those in the<tt class="FILENAME">/etc/resolv.conf</tt> or DHCPcd will obtainthe list from the linux DHCP server and will build a<tt class="FILENAME">resolv.conf</tt> in <tt class="FILENAME">/etc/dhcpc</tt>.</p>
<p>I decided to use linux DHCPcd&#8217;s <tt class="FILENAME">resolv.conf</tt> by doing the following:</p>
<p>Back up your old <tt class="FILENAME">/etc/resolv.conf</tt>: <strong class="COMMAND">mv /etc/resolv.conf/etc/resolv.conf.OLD</strong></p>
<p>If directory <tt class="FILENAME">/etc/dhcpc</tt> doesn&#8217;texist create it: <strong class="COMMAND">mkdir /etc/dhcpc</strong></p>
<p>Make a link from <tt class="FILENAME">/etc/dhcpc/resolv.conf</tt> to<tt class="FILENAME">/etc/resolv.conf</tt>: <strong class="COMMAND">ln -s/etc/dhcpc/resolv.conf /etc/resolv.conf</strong></p>
<p>If that doesn&#8217;t work try this (fix suggested by<tt class="EMAIL">&lt;<a href="mailto:nothing@cc.gatech.edu">nothing@cc.gatech.edu</a>&gt;</tt> with a little amendment by HenrikStoerner):</p>
<p>This last step I had to perform only because my dhcpcd doesn&#8217;tcreate an <tt class="FILENAME">/etc/dhcpc/resolv.conf</tt>.  In <tt class="FILENAME">/etc/sysconfig/network-scripts/ifup</tt> Imade the following changes (which are a very poor hack, but they workfor me):</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then    echo -n "Using DHCP for ${DEVICE}... "    /sbin/dhcpcd -c /etc/sysconfig/network-scripts/ifdhcpc-done ${DEVICE}    echo "echo \$$ &gt; /var/run/dhcp-wait-${DEVICE}.pid; exec sleep 30" | sh    if [ -f /var/run/dhcp-wait-${DEVICE}.pid ]; then^^^^        echo "failed."        exit 1</pre>
</td>
</tr>
</tbody>
</table>
<p>I changed to:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then    echo -n "Using DHCP for ${DEVICE}... "    /sbin/dhcpcd    echo "echo \$$ &gt; /var/run/dhcp-wait-${DEVICE}.pid; exec sleep 30" | sh    if [ ! -f /var/run/dhcp-wait-${DEVICE}.pid ]; then^^^^^^       echo "failed."       exit 1</pre>
</td>
</tr>
</tbody>
</table>
<div class="NOTE">
<blockquote class="NOTE"><p><strong>Note: </strong>Notice the ! (bang) in <tt class="LITERAL">if [ ! -f/var/run/dhcp-wait-${DEVICE}.pid ];</tt></p></blockquote>
</div>
<p>Now sit back and enjoy <img src='http://www.sekolahlinux.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<div class="SECT2">
<h2 class="SECT2"><span style="font-weight: normal;"><span style="font-size: medium;">DHCP server for UNIX</span></span></h2>
<p>There are several DHCP servers available for U*X-like OSes,both commercial and free. One of the more popular free DHCP serversis Paul Vixie/ISC DHCPd. Currently the latest version is 2.0 (suggestedfor most users) but 3.0 is in beta testing.  You can get them from</p>
<p><a href="ftp://ftp.isc.org/isc/dhcp/" target="_top">ftp://ftp.isc.org/isc/dhcp/</a></p>
<p>Some of the distributions provide binary packages for dhcpd soskip the following section if you got it installed that way.</p>
<p>After you download unpack it. After you do cd into thedistribution directory and type: <strong class="COMMAND">./configure</strong></p>
<p>It will take some time to configure the settings. After it is done type:<strong class="COMMAND">make</strong> and <strong class="COMMAND">make install</strong>.</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><span style="font-weight: normal;"><span style="font-size: medium;">DHCP server configuration</span></span></h2>
<p>When done with installation type <strong class="COMMAND">ifconfig -a</strong>. Youshould see something like this:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">eth0      Link encap:10Mbps Ethernet  HWaddr 00:C0:4F:D3:C4:62          inet addr:183.217.19.43  Bcast:183.217.19.255  Mask:255.255.255.0          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:2875542 errors:0 dropped:0 overruns:0          TX packets:218647 errors:0 dropped:0 overruns:0          Interrupt:11 Base address:0x210</pre>
</td>
</tr>
</tbody>
</table>
<p>If it doesn&#8217;t say MULTICAST you should reconfigure yourkernel and add multicast support. On most systems you will not need to do this.</p>
<p>Next step is to add route for 255.255.255.255. Quoted from DHCPd README:</p>
<blockquote class="BLOCKQUOTE"><p>&#8220;In order for dhcpd to work correctly with picky DHCP clients (e.g., Windows 95), it must be able to send packets with an IP destination address of 255.255.255.255.  Unfortunately, Linux insists on changing 255.255.255.255 into the local subnet broadcast address (here, that&#8217;s 192.5.5.223).  This results in a DHCP protocol violation, and while many DHCP clients don&#8217;t notice the problem, some (e.g., all MicrosoftDHCP clients) do.  Clients that have this problem will appear not to see DHCPOFFER messages from the server.&#8221;</p></blockquote>
<p>Type: <strong class="COMMAND">route add -host 255.255.255.255 dev eth0</strong></p>
<p>If you get a message &#8220;<tt class="LITERAL">255.255.255.255: Unknown host</tt>&#8220;,you should try adding the following entry to your<tt class="FILENAME">/etc/hosts</tt> file:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">255.255.255.255 all-ones</pre>
</td>
</tr>
</tbody>
</table>
<p>Then, try:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">route add -host all-ones dev eth0</pre>
</td>
</tr>
</tbody>
</table>
<p>or</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">route add 255.255.255.0 dev eth0</pre>
</td>
</tr>
</tbody>
</table>
<p><tt class="LITERAL">eth0</tt> is of course the name of the network device youare using.  If it differs change appropriately.</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><span style="font-weight: normal;">Options for DHCPd</span></h2>
<p>Now you need to configure DHCPd. In order to do this youwill have to create or edit <tt class="FILENAME">/etc/dhcpd.conf</tt>. Thereis a graphical interface for dhcpd configuration under KDE ( <a href="http://www.kde.org/" target="_top">http://www.kde.org/</a> ) called kcmdhcpdthat is very similar to the DHCP configurator on Windows NT. When KDE2.0 comes out it should come with kcmdhcpd or you could get it directlyfrom <a href="http://www.sekolahlinux.com/linuxftp-server-setup/">linux ftp server</a> at:</p>
<p><a href="ftp://ftp.us.kde.org/pub/kde/unstable/apps/network/" target="_top">ftp://ftp.us.kde.org/pub/kde/unstable/apps/network/</a></p>
<p>If you want to configure it by hand follow instructions below.</p>
<p>Most commonly what you want to do is assign IP addresses randomly. Thiscan be done with settings as follows:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING"># Sample /etc/dhcpd.conf# (add your comments here) default-lease-time 600;max-lease-time 7200;option subnet-mask 255.255.255.0;option broadcast-address 192.168.1.255;option routers 192.168.1.254;option domain-name-servers 192.168.1.1, 192.168.1.2;option domain-name "mydomain.org";subnet 192.168.1.0 netmask 255.255.255.0 {   range 192.168.1.10 192.168.1.100;   range 192.168.1.150 192.168.1.200;}</pre>
</td>
</tr>
</tbody>
</table>
<p>This will result in linux DHCP server giving a client an IP addressfrom the range 192.168.1.10-192.168.1.100 or 192.168.1.150-192.168.1.200. It will lease an IP address for600 seconds if the client doesn&#8217;t ask for specific timeframe. Otherwise the maximum (allowed) lease will be 7200 seconds. Theserver will also &#8220;advise&#8221; the client that it should use 255.255.255.0 asits subnet mask,  192.168.1.255 as its broadcast address, 192.168.1.254 asthe router/gateway and 192.168.1.1 and 192.168.1.2 as its DNS servers.</p>
<p>If you need to specify a WINS server for your Windows clients youwill need to include the <tt class="LITERAL">netbios-name-servers</tt> option e.g.</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">option netbios-name-servers 192.168.1.1;</pre>
</td>
</tr>
</tbody>
</table>
<p>You can also assign specific IP addresses based on clientsethernet address e.g.</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">host haagen {   hardware ethernet 08:00:2b:4c:59:23;   fixed-address 192.168.1.222;}</pre>
</td>
</tr>
</tbody>
</table>
<p>This will assign IP address 192.168.1.222 to a client with ethernetaddress 08:00:2b:4c:59:23.</p>
<p>You can also mix and match e.g. you can have certain clients getting&#8221;static&#8221; IP addresses (e.g. servers) and others being alloteddynamic IPs (e.g. mobile users with laptops). There are a number of otheroptions e.g. nis server addresses, time server addresses etc., if youneed any of those options please read the<tt class="FILENAME">dhcpd.conf</tt> man page.</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><span style="font-weight: normal;"><span style="font-size: medium;">Starting the server</span></span></h2>
<p>There is only one thing to do before starting the server. In most casesDHCP installation doesn&#8217;t create a <tt class="FILENAME">dhcpd.leases</tt>files. This file is used by DHCPd to store information about currentleases. It is in the plain text form so you can view it during theoperation of DHCPd. To create <tt class="FILENAME">dhcpd.leases</tt> type:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">touch /var/state/dhcp/dhcpd.leases</pre>
</td>
</tr>
</tbody>
</table>
<p>This will create an empty file (file size = 0).Some of the older version of dhcpd 2.0 placed the file in<tt class="FILENAME">/etc/dhcpd.leases</tt>.  You do not need to make anychanges to the leases file it will be manipulated by the dhcpd.  If youget a message saying that file exists simply ignore it and go to thenext step.</p>
<p>You can now invoke the Linux DHCP server. Simply type (or include in the bootupscripts)</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">/usr/sbin/dhcpd</pre>
</td>
</tr>
</tbody>
</table>
<p>This will invoke dhcpd on eth0 device. If you want to invoke iton another device simply supply it on the command line e.g.</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">/usr/sbin/dhcpd eth1</pre>
</td>
</tr>
</tbody>
</table>
<p>To verify that everything is working fine youshould first turn on the debugging mode and put the serverin foreground. You can do this by typing</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">/usr/sbin/dhcpd -d -f</pre>
</td>
</tr>
</tbody>
</table>
<p>Then boot up one of your clients and check out the console of your server. You will see a number of debugging messages come up. If everything works outfine you are done <img src='http://www.sekolahlinux.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Quit dhcpd and start it without the<strong class="COMMAND">-d</strong> <strong class="COMMAND">-f</strong> and arguments. If you wantdhcpd to start at boot-up include dhcpd in e.g.</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">/etc/rc.d/rc.local</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>Now you can maintain your <a href="http://www.sekolahlinux.com/network-systems/">network systems</a> by using Linux DHCP Server and you must not worry about giving DHCP manually to each client computer.</p>
<p>Other related articles:</p>
<ul>
<li><a href="http://blog.thewulph.com/?p=90">PXE Server for Clonezilla/ESX 4</a> &#8211; Alright, this blog is as much about me as a DJ as it is about what&#8217;s going on in my life, so in following with the open-source I help you if you help me movement, I have a post that&#8217;s a how-to for getting a PXE server running with support for Clonezilla and ESX (vSphere) 4. (For those of you who read this on facebook, it gets auto-uploaded there after I post it on my main site at blog. Also keeping in mind that the steps presented could be modified for just about anything except a Windows boot but there&#8217;s plenty of resources for THAT out there as well (if you&#8217;re interested, look into WinPE it&#8217;s designed for Windows booting over PXE).</li>
<li><a href="http://www.itinfusion.ca/?p=74">LTSP Linux Thin Client School Project Update | | IT Infusion in &#8230;</a> &#8211; I just got back from my son&#8217;s school where we&#8217;ve been rolling out LTSP thin clients into the classrooms. Eventually we&#8217;ll be converting almost all of the computers in both buildings (200+ PCs) into thin clients. There are no other words to describe it.</li>
<li><a href="http://magazine.redhat.com/2008/08/05/linux-dhcp-server-static-ips-are-gone-in-60-seconds/">Red Hat Magazine | Linux DHCP server: Static IPs are gone in 60 &#8230;</a> &#8211; Linux DHCP is a low-cost alternative to proprietary network servers that depend on the user doing a series of GUI clicks. On the surface it may seem convenient to have a “wizard” setup your network for you. But it&#8217;s often better to tap &#8230;</li>
<li><a href="http://www.adamsinfo.com/linux-dhcp-server/">Linux DHCP Server | Adam Palmer, Linux, PHP Programmer, MySQL &#8230;</a> &#8211; Linux DHCP Server.</li>
</ul>
</div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/linux' rel='tag' target='_self'>linux</a>, <a class='technorati-link' href='http://technorati.com/tag/linux+command' rel='tag' target='_self'>linux command</a>, <a class='technorati-link' href='http://technorati.com/tag/Linux+DHCP' rel='tag' target='_self'>Linux DHCP</a>, <a class='technorati-link' href='http://technorati.com/tag/linux+ftp+server' rel='tag' target='_self'>linux ftp server</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sekolahlinux.com/linux-dhcp-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

