<?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>Solid State Raam &#187; Networking</title>
	<atom:link href="http://solidstateraam.com/category/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://solidstateraam.com</link>
	<description>Explorations (and exploitations) of the digital world by one of its many netizens.</description>
	<lastBuildDate>Thu, 13 May 2010 19:24:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Script to Install &amp; Configure ifplugd on Debian</title>
		<link>http://solidstateraam.com/a-script-to-install-configure-ifplugd-on-debian/</link>
		<comments>http://solidstateraam.com/a-script-to-install-configure-ifplugd-on-debian/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 05:00:56 +0000</pubDate>
		<dc:creator>Raam</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://solidstateraam.com/?p=148</guid>
		<description><![CDATA[The default configuration on some older Linux systems is to only send a DHCP request while booting up. This means if the network cable gets unplugged, or if the router is powered off, the system may lose its IP configuration. To restore the network connection, the system may need to be manually rebooted or have [...]]]></description>
			<content:encoded><![CDATA[<p>The default configuration on some older Linux systems is to only send a DHCP request while booting up. This means if the network cable gets unplugged, or if the router is powered off, the system may lose its IP configuration. To restore the network connection, the system may need to be manually rebooted or have someone at the local console run the <code>dhclient</code> command to request a DHCP lease. </p>
<p>For systems that are only accessed remotely via SSH, such a scenario can be painful. What is needed is a daemon that watches the link status of the Ethernet jack and reconfigures the network (or sends out another DHCP request) when it detects a cable is plugged in (or the power to the router is restored).</p>
<p><a href="http://0pointer.de/lennart/projects/ifplugd/#overview">ifplugd</a> does exactly that:</p>
<blockquote><p>ifplugd is a Linux daemon which will automatically configure your ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled.</p></blockquote>
<p>On a Debian system, installing and configuring ifplugd is relatively simple using <code>apt-get install ifplugd</code>. Once its been installed, it needs to be configured by editing <code>/etc/default/ifplugd</code>. The most basic configuration is to simply set <code>INTERFACES="auto"</code> and <code>HOTPLUG_INTERFACES="all"</code>. This configuration tells ifplugd to watch all network interfaces for a new link status and automatically reconfigure them using the Debian network configuration defined in <code>/etc/network/interfaces</code>.</p>
<p>I recently needed to automate the install and configuration of ifplugd on many remote Linux systems, so I wrote this simple script.  </p>
<p>Download: <a href="http://solidstateraam.com/wp-content/uploads/2009/06/install-ifplugd.tar.gz">install-ifplugd.tar.gz</a></p>
<pre class="brush: bash;">
#!/bin/sh

#########################################
# Author: Raam Dev
#
# This script installs ifplugd and configures
# it to automatically attempt to restore any
# lost connections.
#
# Must be run as root!
#########################################

# Check if we're running this as root
if [ $EUID -ne 0 ]; then
   echo &quot;This script must be run as root&quot; 1&gt;&amp;2
   exit 1
fi

# Files used when configuring ifplugd
OUTFILE=/tmp/outfile.$$
CONFIG_FILE=/etc/default/ifplugd

# Update package list and install ifplugd, assuming yes to any questions asked
# (to insure the script runs without requiring manual intervention)
apt-get update --assume-yes ; apt-get install --assume-yes ifplugd

# Configure ifplugd to watch all interfaces and automatically attempt configuration
sed 's/INTERFACES=\&quot;\&quot;/INTERFACES=\&quot;auto\&quot;/g' &lt; $CONFIG_FILE &gt; $OUTFILE
mv $OUTFILE $CONFIG_FILE

sed 's/HOTPLUG_INTERFACES=\&quot;auto\&quot;/HOTPLUG_INTERFACES=\&quot;all\&quot;/g' &lt; $CONFIG_FILE &gt; $OUTFILE
mv $OUTFILE $CONFIG_FILE
</pre>
<p>If you&#8217;re interested in doing more with ifplugd, check out <a href="http://www.linux.com/archive/articles/114008">this article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://solidstateraam.com/a-script-to-install-configure-ifplugd-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Static DNS with DHCP on Debian/Ubuntu</title>
		<link>http://solidstateraam.com/configuring-static-dns-with-dhcp-on-debianubuntu/</link>
		<comments>http://solidstateraam.com/configuring-static-dns-with-dhcp-on-debianubuntu/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 04:53:22 +0000</pubDate>
		<dc:creator>Raam</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://solidstateraam.com/?p=74</guid>
		<description><![CDATA[Dynamic Host Configuration Protocol (DHCP) is a commonly used method of obtaining IP and DNS information automatically from the network. In some cases, you may wish to statically define the DNS servers instead of using the ones provided by the DHCP server. For example if your ISP commonly experiences DNS outages, you might want to [...]]]></description>
			<content:encoded><![CDATA[<p>Dynamic Host Configuration Protocol (<a title="Wikipedia entry on DHCP" href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol">DHCP</a>) is a commonly used method of obtaining IP and DNS information automatically from the network. In some cases, you may wish to statically define the DNS servers instead of using the ones provided by the DHCP server. For example if your ISP commonly experiences DNS outages, you might want to use the DNS servers provided by <a title="OpenDNS" href="http://opendns.com">OpenDNS</a> instead of the ones provided by your ISP.</p>
<p>When using a static IP configuration on Linux, you normally add the DNS servers to the <code>/etc/resolv.conf</code>. However, if you try to add a DNS server to <code>/etc/resolv.conf</code> under a DHCP configuration, you&#8217;ll notice that your static entry disappears as soon as the DHCP client runs (usually on boot). To prevent this, you need to tell the DHCP client to prepend the static DNS server(s) to <code>/etc/resolv.conf</code> before adding the ones provided from the DHCP server (if any).</p>
<p>The configuration file you&#8217;ll need to edit is the same on both Debian and Ubuntu, however depending on your setup the location of the file may vary. Here are the two common places I&#8217;ve found the file:</p>
<p><strong>Debian:</strong> <code>/etc/dhclient.conf</code><br />
<strong>Ubuntu:</strong> <code>/etc/dhcp3/dhclient.conf</code></p>
<p>Open the file in your favorite editor and add one of two lines at the top, separating multiple DNS servers with a comma and ending the entry with a semi-colon:</p>
<p>If you simply want to add static DNS servers to be used in addition to the ones provided by DHCP, use a prepend entry:</p>
<pre class="brush: bash;">prepend domain-name-servers 208.67.222.222, 208.67.220.220;</pre>
<p>If you want to override the DNS servers provided by DHCP entirely and force the system to use the ones you provide, use the supersede entry:</p>
<pre class="brush: bash;">supersede domain-name-servers 208.67.222.222, 208.67.220.220;</pre>
<p>Before these static DNS servers will to be appended to your <code>/etc/resolv.conf</code> file, you&#8217;ll need to re-run the DHCP client. The easiest way to do this is by running <code>/etc/init.d/networking restart</code> (sudo required) or you can try running the <code>dhclient</code> command. </p>
<p>After re-running the DHCP client, check your <code>/etc/resolv.conf</code> file to confirm the static DNS servers have been added.</p>
]]></content:encoded>
			<wfw:commentRss>http://solidstateraam.com/configuring-static-dns-with-dhcp-on-debianubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
