<?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>Sakana.fr - A sysadmin&#039;s blog &#187; Networks</title>
	<atom:link href="http://www.sakana.fr/blog/category/networks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sakana.fr/blog</link>
	<description>On the fly saving of few useful (?) tech tips</description>
	<lastBuildDate>Thu, 26 Jan 2012 15:30:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Gentoo + OpenVPN : getting things started in the correct order</title>
		<link>http://www.sakana.fr/blog/2010/07/03/gentoo-openvpn-getting-things-started-in-the-correct-order/</link>
		<comments>http://www.sakana.fr/blog/2010/07/03/gentoo-openvpn-getting-things-started-in-the-correct-order/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 19:33:16 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openvpn]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=429</guid>
		<description><![CDATA[I&#8217;m running an OpenVPN server, configured in bridging mode. I had quite a bit of trouble getting OpenVPN to start after networking is up, but before the the bridge is setup so that the tap0 device, which is created by OpenVPN can be added to the bridge. The solution is simpler : let the tap0 [...]<p><a href="http://www.sakana.fr/blog/2010/07/03/gentoo-openvpn-getting-things-started-in-the-correct-order/">Gentoo + OpenVPN : getting things started in the correct order</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m running an OpenVPN server, configured in bridging mode. </p>
<p>I had quite a bit of trouble getting OpenVPN to start after networking is up, but before the the bridge is setup so that the tap0 device, which is created by OpenVPN can be added to the bridge.</p>
<p>The solution is simpler : let the tap0 be automatically created and added to the bridge by Gentoo Linux, then start OpenVPN with a config file instructing to use the already created tap0 device.</p>
<p>This post shows the configuration snippets to get things started in the right order on Gentoo.<br />
<span id="more-429"></span></p>
<p>Here is the <b><tt>/etc/conf.d/net</tt></b> file :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.sakana.fr/blog/wp-content/plugins/wp-codebox/wp-codebox.php?p=429&amp;download=net">net</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4294"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" id="p429code4"><pre class="conf" style="font-family:monospace;"># This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
&nbsp;
config_eth0=( &quot;null&quot; )
&nbsp;
tuntap_tap0=&quot;tap&quot;
config_tap0=&quot;null&quot;
&nbsp;
bridge_br0=( &quot;eth0 tap0&quot; )
brctl_br0=( &quot;setfd 0&quot; &quot;sethello 10&quot; &quot;stp on&quot; )
config_br0=( &quot;dhcp&quot; )
&nbsp;
depend_br0() {
        need net.eth0 net.tap0
}</pre></td></tr></table></div>

<p>This files sets up eth0 (null configuration, so that it doesn&#8217;t use DHCP to get configured), creates tap0 device that will be used by OpenVPN and create the bridge br0 with those 2 eth0 and tap0 devices. The <b><tt>depend</tt></b> part ensures that when the bridge will be created, both eth0 and tap0 will have been configured.</p>
<p>You have to link this file to /etc/init.d as net.eth0, net.tap0 and net.br0 and add those to the default runlevel like so :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p429code5'); return false;">View Code</a> SHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4295"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p429code5"><pre class="shell" style="font-family:monospace;">spaghetti init.d # cd /etc/init.d/
spaghetti init.d # ln -s /etc/conf.d/net net.eth0
spaghetti init.d # ln -s /etc/conf.d/net net.tap0
spaghetti init.d # ln -s /etc/conf.d/net net.br0
spaghetti init.d # rc-update add net.eth0 default
 * net.eth0 added to runlevel default
spaghetti init.d # rc-update add net.tap0 default
 * net.tap0 added to runlevel default
spaghetti init.d # rc-update add net.br0 default
 * net.br0 added to runlevel default</pre></td></tr></table></div>

<p>Finally add OpenVPN to the default runlevel as well :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p429code6'); return false;">View Code</a> SHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4296"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p429code6"><pre class="shell" style="font-family:monospace;">spaghetti init.d # rc-update add openvpn default
 * openvpn added to runlevel default</pre></td></tr></table></div>

<p>That&#8217;s it. When you&#8217;ll restart your server, the devices will be configured in the proper order, and OpenVPN will be started and will use the automatically created tap0 device.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4571688872511149";
/* 728x90, created 10/17/09 */
google_ad_slot = "0784069657";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><a href="http://www.sakana.fr/blog/2010/07/03/gentoo-openvpn-getting-things-started-in-the-correct-order/">Gentoo + OpenVPN : getting things started in the correct order</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2010/07/03/gentoo-openvpn-getting-things-started-in-the-correct-order/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux : Configuring a network bridge for your Virtual Machines</title>
		<link>http://www.sakana.fr/blog/2009/04/13/linux-configuring-a-network-bridge-for-your-virtual-machines/</link>
		<comments>http://www.sakana.fr/blog/2009/04/13/linux-configuring-a-network-bridge-for-your-virtual-machines/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 10:46:23 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[QEMU]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=229</guid>
		<description><![CDATA[My new center of interest those days being virtualization, I tried quite a few software starting with Xen, then QEMU, then KVM, and finally VirtualBox. But as far as giving a network access to the VM is concerned, I&#8217;ve always sticked to a network bridge for the reason that this makes the VM appear on [...]<p><a href="http://www.sakana.fr/blog/2009/04/13/linux-configuring-a-network-bridge-for-your-virtual-machines/">Linux : Configuring a network bridge for your Virtual Machines</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>My new center of interest those days being virtualization, I tried quite a few software starting with Xen, then QEMU, then KVM, and finally VirtualBox. But as far as giving a network access to the VM is concerned, I&#8217;ve always sticked to a network bridge for the reason that this makes the VM appear on the network just like any other computer of your network.</p>
<p>This post provided a sample script to setup a bridge suitable to use with all of the named virtualization softwares.</p>
<p><span id="more-229"></span></p>
<p>Here is the script I use for setting up the networking of a VM :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p229code8'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2298"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code" id="p229code8"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># creating tap0 (a TAP device) and setting owner as the non-privileged user who</span>
<span style="color: #666666; font-style: italic;"># will run VirtualBox</span>
tunctl <span style="color: #660033;">-u</span> kattoo
&nbsp;
<span style="color: #666666; font-style: italic;"># creating the bridge</span>
brctl addbr br0
&nbsp;
<span style="color: #666666; font-style: italic;"># stopping the initial networking</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>net.eth0 stop
&nbsp;
<span style="color: #666666; font-style: italic;"># bringing up physical and virtual network interfaces</span>
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span> tap0 up
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span> eth0 up
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span> br0 up
&nbsp;
<span style="color: #666666; font-style: italic;"># connecting the TAP device and the physical NIC onto the bridge</span>
brctl addif br0 tap0
brctl addif br0 eth0
&nbsp;
<span style="color: #666666; font-style: italic;"># starting the bridge</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>net.br0 start</pre></td></tr></table></div>

<p>As you can see, this is pretty simple and straightforward, and there is much room for improvement <img src='http://www.sakana.fr/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>A TAP device is a level 2 (think ethernet) virtual network interface which has one side connected to a process (in our case this will be VirtualBox or any other virtualization software such as Xen, QEMU, KVM &#8230;) and the other side is connected to the hosting Linux Kernel. In our case that end will be plugged in the network bridge so that every packet entering the bridge will be forwarded to the VM as well (and the other way round too).</p>
<p>This example is made with Gentoo Linux in mind, so you may have to adapt a bit for your own Linux distribution.</p>
<p>If you use VirtualBox, you can then set the network parameters for your VM as follow :</p>
<div id="attachment_246" class="wp-caption aligncenter" style="width: 651px"><img class="size-full wp-image-246" title="VirtualBox parameters for a VM using bridged networking" src="http://www.sakana.fr/blog/wp-content/uploads/2009/04/network-vbox-bridge.png" alt="VirtualBox parameters for a VM using bridged networking" width="641" height="622" /><p class="wp-caption-text">VirtualBox parameters for a VM using bridged networking</p></div>
<p>Should you have any question or improvement to suggest, feel free to hit the comments !</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4571688872511149";
/* 728x90, created 10/17/09 */
google_ad_slot = "0784069657";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><a href="http://www.sakana.fr/blog/2009/04/13/linux-configuring-a-network-bridge-for-your-virtual-machines/">Linux : Configuring a network bridge for your Virtual Machines</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2009/04/13/linux-configuring-a-network-bridge-for-your-virtual-machines/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>VLAN + OpenBSD : a simple configuration</title>
		<link>http://www.sakana.fr/blog/2008/04/14/vlan-openbsd-a-simple-configuration/</link>
		<comments>http://www.sakana.fr/blog/2008/04/14/vlan-openbsd-a-simple-configuration/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 14:33:37 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[openbsd]]></category>
		<category><![CDATA[vlan]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=148</guid>
		<description><![CDATA[photo credit: saschaaa This posts gives a short intro about VLAN and a simple configuration sample on a DELL PowerConnect 5224 switch with an OpenBSD machine. VLANs VLANs are a common way to gather ports of multiple connected network switches in groups (VLANs), and isolate thoses different groups as if they were on different physical [...]<p><a href="http://www.sakana.fr/blog/2008/04/14/vlan-openbsd-a-simple-configuration/">VLAN + OpenBSD : a simple configuration</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a title="The worlds network" href="http://www.flickr.com/photos/69697083@N00/152502539/" target="_blank"><img src="http://farm1.static.flickr.com/51/152502539_c4cb9121eb_t.jpg" border="0" alt="The worlds network" /></a><br />
<small><a title="Attribution-NoDerivs License" href="http://creativecommons.org/licenses/by-nd/2.0/" target="_blank"><img src="http://www.sakana.fr/blog/wp-content/plugins/photo_dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="saschaaa" href="http://www.flickr.com/photos/69697083@N00/152502539/" target="_blank">saschaaa</a></small></p>
<p>This posts gives a short intro about VLAN and a simple configuration sample on a DELL PowerConnect 5224 switch with an OpenBSD machine.</p>
<p><span id="more-148"></span></p>
<h3>VLANs</h3>
<p>VLANs are a common way to gather ports of multiple connected network switches in groups (VLANs), and isolate thoses different groups as if they were on different physical networks.</p>
<p>For this to work, Ethernet frames (as standardized by the <a title="IEEE 802.3 standard" href="http://en.wikipedia.org/wiki/IEEE_802.3" target="_blank">IEEE 802.3 standard</a>) are basically extended  with an extra field specifying the VLAN identifier (this is standardized by the <a title="IEEE 802.1q standard" href="http://en.wikipedia.org/wiki/IEEE_802.1Q" target="_blank">IEEE 802.1q standard</a>). A packet with this extra field is said to be &#8220;tagged&#8221;.</p>
<p>Provided with this information, a 802.1q aware switch can deliver ethernet packets only to the VLAN member ports. When this packet leaves the switch by a port, the switch has to decide whether  the frame should be sent as 802.1q (to a  802.1q  aware equipment) or as 802.3 (to a non-802.1q aware equipment) by &#8220;untagging&#8221; the packet.</p>
<p>Likewise, when a packet reaches the switch, either it is already tagged and the switch will propagate it to the matching VLAN, or it is not and the switch will tag it with the port default VLAN identifier (known as the &#8220;PVID&#8221;).</p>
<p>Let&#8217;s see how to setup VLANs on a Dell PowerConnect 5224 switch and an OpenBSD machine.</p>
<h3>Sample configuration</h3>
<p>For this test, we have a DELL PowerConnect 5224 network switch and an OpenBSD 4.2 machine. Both of those equipments are VLAN aware.</p>
<h4>Switch</h4>
<p>Here are the configuration blocks regarding the VLAN setup :<br />
<pre><code>vlan database
vlan 1 name DefaultVlan media ethernet state active
vlan 2 name aSampleVLAN media ethernet state active
!
interface ethernet 1/1
description OpenBSD
switchport allowed vlan add 1 untagged
switchport native vlan 1
switchport allowed vlan add 2 tagged</code></pre></p>
<p>We basically create a VLAN &#8220;aSampleVLAN&#8221; with and the identifier 2 and setup the port 1 of the switch so that packets sent to the VLAN 2 will be sent out on this port too as tagged packet (meaning the packets will be sent as 802.1q packets, hence including the VLAN id).</p>
<p>The &#8220;native vlan 1&#8243; sets the PVID, meaning that untagged packets entering the switch by the port 1 will be tagged as part of the VLAN 1.</p>
<p>That&#8217;s it for the switch setup.</p>
<h4>Server</h4>
<p>OpenBSD has a <a title="vlan(4)" href="http://www.openbsd.org/cgi-bin/man.cgi?query=vlan&amp;sektion=4&amp;arch=i386&amp;apropos=0&amp;manpath=OpenBSD+Current" target="_blank">vlan(4)</a> pseudo-device which takes care of VLANs. Once configured, a vlan pseudo-device will act just like a normal network interface which would be plugged in a VLAN.</p>
<p>The setup is really easy.</p>
<ol>
<li>Bring up the physical network interface which is connected to the switch:<br />
<code># ifconfig xl0 up</code></li>
<li>Create and configure the vlan pseudo-device :<br />
<pre><code># ifconfig vlan2 create
# ifconfig vlan2 vlan 2 vlandev xl0</code></pre></li>
<li>Setup the IP parameters of the vlan interface:<br />
<code># ifconfig vlan2 inet 10.253.21.102 netmask 255.255.255.0</code></li>
</ol>
<p>You can make this persistent over the next reboots by configuring the /etc/hostname.* files as follow :<br />
<pre><code>$ cat /etc/hostname.xl0
up</code></pre><br />
This will take care of bringing up the physical network interface at next reboot.<br />
<pre><code>$ cat /etc/hostname.vlan2
inet 10.10.10.100 255.255.255.0 10.10.10.255 vlandev xl0 description &quot;Interface in VLAN 2&quot;</code></pre><br />
This will setup the VLAN interface.</p>
<p>That&#8217;s pretty much it. You can bring up as many vlan interfaces as you want, for example if you need to have a server share resources on multiple VLAN or if you want to route packets between VLANs but you have more VLANs than the number of physical network interfaces/switch ports you want to use&#8230;</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2008/04/14/vlan-openbsd-a-simple-configuration/">VLAN + OpenBSD : a simple configuration</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2008/04/14/vlan-openbsd-a-simple-configuration/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Dell PowerConnect switches &#8211; Password recovery procedure</title>
		<link>http://www.sakana.fr/blog/2008/04/12/dell-powerconnect-switches-password-recovery-procedure/</link>
		<comments>http://www.sakana.fr/blog/2008/04/12/dell-powerconnect-switches-password-recovery-procedure/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 18:15:11 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[5224]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[factory settings]]></category>
		<category><![CDATA[PowerConnect]]></category>
		<category><![CDATA[recover password]]></category>
		<category><![CDATA[Switch]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=147</guid>
		<description><![CDATA[If you are looking for a procedure to reset the password of a Dell PowerConnect switch, you&#8217;ll find it at the Dell support forum in the following thread : PowerConnect Password Recovery Procedure for managed switches. As far as the 5224 is concerned, you mostly have to hold Ctrl-F from the power-on till the end [...]<p><a href="http://www.sakana.fr/blog/2008/04/12/dell-powerconnect-switches-password-recovery-procedure/">Dell PowerConnect switches &#8211; Password recovery procedure</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>If you are looking for a procedure to reset the password of a Dell PowerConnect switch, you&#8217;ll find it at the Dell support forum in the following thread : 	<a title="PowerConnect Password Recovery Procedure for managed switches" href="http://forums.us.dell.com/supportforums/board/message?board.id=pc_managed&amp;message.id=800" target="_blank">PowerConnect Password Recovery Procedure for managed switches</a>.</p>
<p>As far as the 5224 is concerned, you mostly have to hold Ctrl-F from the power-on till the end of the boot of the switch, which will bring the &#8220;reset to factory ?&#8221; question and solve the problem of the lost password.</p>
<p>The <a title="User Guide for the 5224" href="http://docs.us.dell.com/support/edocs/network/5P788/en/index.htm#online_documentation" target="_blank">User Guide for the 5224</a> is available online.</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2008/04/12/dell-powerconnect-switches-password-recovery-procedure/">Dell PowerConnect switches &#8211; Password recovery procedure</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2008/04/12/dell-powerconnect-switches-password-recovery-procedure/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Debian : update a dynamic DNS</title>
		<link>http://www.sakana.fr/blog/2007/08/23/debian-update-a-dynamic-dns/</link>
		<comments>http://www.sakana.fr/blog/2007/08/23/debian-update-a-dynamic-dns/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 19:15:00 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/08/23/debian-update-a-dynamic-dns/</guid>
		<description><![CDATA[A bit of context : I have a bind 9 DNS allowing DNS updates from clients on the LAN (ok this is fairly insecure, but still my LAN is my home LAN composed of 4 machines &#8230; let&#8217;s say that&#8217;s good enough for me ! ) The named.conf allows those updates with this config directive [...]<p><a href="http://www.sakana.fr/blog/2007/08/23/debian-update-a-dynamic-dns/">Debian : update a dynamic DNS</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A bit of context : I have a <tt>bind 9</tt> DNS allowing DNS updates from clients on the LAN (ok this is fairly insecure, but still my LAN is my home LAN composed of 4 machines &#8230; let&#8217;s say that&#8217;s good enough for me ! <img src='http://www.sakana.fr/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>
<p>The <tt>named.conf</tt> allows those updates with this config directive in the zone config block :<br />
<pre><code>allow-update {mynet; };
</code></pre><br />
and mynet is defined an acl directive to be my LAN.</p>
<p>Then you can update your DNS with the nsupdate tool with a syntax along the following lines :<br />
<pre><code>spaghetti:~# nsupdate
&gt; server 192.168.0.1
&gt; update delete spaghetti.domain.name A
&gt; update add spaghetti.domain.name 8000 A 192.168.0.103
&gt; send
&gt; quit
</code></pre></p>
<p>I was then looking for a place to hook a code snippet doing that update after an update via DHCP and I found the answer in <a href="http://linox.be/index.php/2006/03/07/a_dynamic_dns_update_client_on_debian_with_dhcp3-client/" title="A dynamic dns update client on Debian with dhcp3-client" target="_blank">A dynamic dns update client on Debian with dhcp3-client</a> (many thanks dude !).</p>
<p>Here is the drill down :</p>
<ol>
<li>install the <tt>dhcp3-client</tt> package (<tt>apt-get install  dhcp3-client</tt> ): this version has easy to use hooks before and after querying the DHCP server to get network config</li>
<li>you can drop a script which will automate the <tt>nsupdate</tt> in &#8220;<tt>/etc/dhcp3/dhclient-enter-hooks.d</tt>&#8221; and it will get run right after network configuration (see the sample <tt>debug</tt> script for the variable which are available upon script execution, such as <tt>$new_ip_address</tt>)</li>
</ol>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2007/08/23/debian-update-a-dynamic-dns/">Debian : update a dynamic DNS</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/08/23/debian-update-a-dynamic-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multicast : Listing group memberships</title>
		<link>http://www.sakana.fr/blog/2007/03/15/multicast-listing-group-memberships/</link>
		<comments>http://www.sakana.fr/blog/2007/03/15/multicast-listing-group-memberships/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 17:54:37 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Networks]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/03/15/multicast-listing-group-memberships/</guid>
		<description><![CDATA[Windows XP To see multicast group memberships in Windows XP, you can use netsh : U:&#62;netsh interface ip show joins Interface Addr&#160;&#160; Multicast Group ---------------&#160;&#160;--------------- 192.168.139.1&#160;&#160;&#160;&#160;224.0.0.1 192.168.137.1&#160;&#160;&#160;&#160;224.0.0.1 192.168.136.1&#160;&#160;&#160;&#160;224.0.0.1 Solaris (and probably other Unixen as well) In Solaris, the netstat command can be used : $ netstat -g Group Memberships: IPv4 Interface Group&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;RefCnt --------- -------------------- ------ [...]<p><a href="http://www.sakana.fr/blog/2007/03/15/multicast-listing-group-memberships/">Multicast : Listing group memberships</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<h4>Windows XP</h4>
<p>To see multicast group memberships in Windows XP, you can use netsh :<br />
<pre><pre>
U:&gt;netsh interface ip show joins
Interface Addr&nbsp;&nbsp; Multicast Group
---------------&nbsp;&nbsp;---------------
192.168.139.1&nbsp;&nbsp;&nbsp;&nbsp;224.0.0.1
192.168.137.1&nbsp;&nbsp;&nbsp;&nbsp;224.0.0.1
192.168.136.1&nbsp;&nbsp;&nbsp;&nbsp;224.0.0.1</pre></pre></p>
<h4>Solaris (and probably other Unixen as well)</h4>
<p>In Solaris, the netstat command can be used :<br />
<pre><pre>
$ netstat -g
Group Memberships: IPv4
Interface Group&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RefCnt
--------- -------------------- ------
lo0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 224.0.0.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1
eri0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;224.0.0.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1
$</pre></pre><br />
<!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2007/03/15/multicast-listing-group-memberships/">Multicast : Listing group memberships</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/03/15/multicast-listing-group-memberships/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris 10: &#8220;logical-units&#8221; for network cards (NIC)</title>
		<link>http://www.sakana.fr/blog/2006/07/17/solaris-10-logical-units-for-network-cards-nic/</link>
		<comments>http://www.sakana.fr/blog/2006/07/17/solaris-10-logical-units-for-network-cards-nic/#comments</comments>
		<pubDate>Mon, 17 Jul 2006 06:48:20 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=30</guid>
		<description><![CDATA[The &#8220;interface name&#8221; part of an ifconfig command can be a simple interface name, such as eri0, bge0 and such, or a logical unit such as eri0:1, eri0:2 and so on. This makes it easy to setup more than 1 ip address on a network card, and hence to make virtual servers. Solaris 10: &#8220;logical-units&#8221; [...]<p><a href="http://www.sakana.fr/blog/2006/07/17/solaris-10-logical-units-for-network-cards-nic/">Solaris 10: &#8220;logical-units&#8221; for network cards (NIC)</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The &#8220;interface name&#8221; part of an ifconfig command can be a simple interface name, such as eri0, bge0 and such, or a logical unit such as eri0:1, eri0:2 and so on.</p>
<p>This makes it easy to setup more than 1 ip address on a network card, and hence to make virtual servers.</p>
<p><a href="http://www.sakana.fr/blog/2006/07/17/solaris-10-logical-units-for-network-cards-nic/">Solaris 10: &#8220;logical-units&#8221; for network cards (NIC)</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2006/07/17/solaris-10-logical-units-for-network-cards-nic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenBSD : Creating a transparent bridge</title>
		<link>http://www.sakana.fr/blog/2006/06/04/openbsd-creating-a-transparent-bridge/</link>
		<comments>http://www.sakana.fr/blog/2006/06/04/openbsd-creating-a-transparent-bridge/#comments</comments>
		<pubDate>Sun, 04 Jun 2006 12:18:10 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=25</guid>
		<description><![CDATA[This post will be short, because it is actually easier than I expected &#8230; Anyway, considering my memory, better blog out that for later reference A bridge is a network device used to connect two or more network segments. You can achieve this easily on OpenBSD with the following commands : # echo &#039;up&#039; &#62; [...]<p><a href="http://www.sakana.fr/blog/2006/06/04/openbsd-creating-a-transparent-bridge/">OpenBSD : Creating a transparent bridge</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This post will be short, because it is actually easier than I expected &#8230; Anyway, considering my memory, better blog out that for later reference <img src='http://www.sakana.fr/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>A bridge is a network device used to connect two or more network segments. You can achieve this easily on OpenBSD with the following commands :</p>
<p><pre><code># echo &#039;up&#039; &gt; /etc/hostname.if0
# echo &#039;up&#039; &gt; /etc/hostname.if1
# echo&nbsp;&nbsp;&#039;add if0 add if1 up&#039;&nbsp;&nbsp;&gt; /etc/bridgename.bridge0
</code></pre></p>
<p>This will setup the two interfaces if0 and if1 (replace with your own, like rl0, em0, etc etc) and add them into the bridge0.</p>
<p>Then you need to enable ip forwarding so that IP packets will pass from one interface to the others as needed. You do that by editing the file /etc/sysctl.conf and uncommenting the line which reads :</p>
<p><pre><code> #net.inet.ip.forwarding=1
</code></pre>Once this is all done, reboot to activate.</p>
<p>This bridge is IP-less, which means it is &#8220;harder&#8221; to attack. You can still filter at MAC level and at IP level through PF (the firewall of OpenBSD).</p>
<p>Tested on OpenBSD 3.9</p>
<p>Man pages :</p>
<ul>
<li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=bridgename.if&amp;sektion=5&amp;arch=i386&amp;apropos=0&amp;manpath=OpenBSD+3.9">hostname.if(5)</a></li>
<li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=brconfig&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+3.9&amp;arch=i386&amp;format=html">brconfig(8)</a></li>
<li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ifconfig&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+3.9&amp;arch=i386&amp;format=html">ifconfig(8)</a></li>
<li><a href="http://www.openbsd.org/cgi-bin/man.cgi?query=sysctl.conf&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html">sysctl.conf(5)</a></li>
</ul>
<p><a href="http://www.sakana.fr/blog/2006/06/04/openbsd-creating-a-transparent-bridge/">OpenBSD : Creating a transparent bridge</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2006/06/04/openbsd-creating-a-transparent-bridge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Estimating network throughput / bandwidth / performance with FTP</title>
		<link>http://www.sakana.fr/blog/2006/05/24/estimating-network-throughput-with-ftp/</link>
		<comments>http://www.sakana.fr/blog/2006/05/24/estimating-network-throughput-with-ftp/#comments</comments>
		<pubDate>Wed, 24 May 2006 16:43:33 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=24</guid>
		<description><![CDATA[On a Unix machine, you can use this little ftp trick to have an idea of your throughput : ftp somehost ftp&#62; put &#8220;&#124; dd if=/dev/zero bs=100000 count=100&#8243; /dev/null 200 PORT command successful. 150 ASCII data connection for /dev/null (192.168.0.1,32953). 100+0 records in 100+0 records out 226 Transfer complete. local: &#124; dd if=/dev/zero bs=100000 count=100 [...]<p><a href="http://www.sakana.fr/blog/2006/05/24/estimating-network-throughput-with-ftp/">Estimating network throughput / bandwidth / performance with FTP</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>On a Unix machine, you can use this little ftp trick to have an idea of your throughput :</p>
<p><strong>ftp somehost</strong><br />
ftp&gt; <strong>put &#8220;| dd if=/dev/zero bs=100000 count=100&#8243; /dev/null</strong><br />
200 PORT command successful.<br />
150 ASCII data connection for /dev/null (192.168.0.1,32953).<br />
100+0 records in<br />
100+0 records out<br />
226 Transfer complete.<br />
local: | dd if=/dev/zero bs=100000 count=100 remote: /dev/null<br />
10000000 bytes sent in 2.9 seconds (<strong>3388.52 Kbytes/s</strong>)</p>
<p>This will generate a stream of bytes from one host to another and give you the data rate at the end</p>
<p><a href="http://www.sakana.fr/blog/2006/05/24/estimating-network-throughput-with-ftp/">Estimating network throughput / bandwidth / performance with FTP</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2006/05/24/estimating-network-throughput-with-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proxying HTTPS throught Apache/mod_proxy</title>
		<link>http://www.sakana.fr/blog/2006/03/12/proxying-https-throught-apachemod_proxy/</link>
		<comments>http://www.sakana.fr/blog/2006/03/12/proxying-https-throught-apachemod_proxy/#comments</comments>
		<pubDate>Sun, 12 Mar 2006 09:01:27 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Networks]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=16</guid>
		<description><![CDATA[To allow a proxy to act as a tunnel for SSL connection as in HTTPS, you actually need to provide the HTTP method CONNECT. It took me some time to realize If you do this with Apache/mod_proxy, that means that you have to use the mod_proxy_connect and allow the CONNECT method. Few pointers : CONNECT [...]<p><a href="http://www.sakana.fr/blog/2006/03/12/proxying-https-throught-apachemod_proxy/">Proxying HTTPS throught Apache/mod_proxy</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>To allow a proxy to act as a tunnel for SSL connection as in HTTPS, you actually need to provide the HTTP method CONNECT. It took me some time to realize <img src='http://www.sakana.fr/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>If you do this with Apache/mod_proxy, that means that you have to use the mod_proxy_connect and allow the CONNECT method.</p>
<p>Few pointers :</p>
<ul>
<li><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html">CONNECT</a> method</li>
<li>Apache <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy_connect.html">mod_proxy_connect</a></li>
</ul>
<p><a href="http://www.sakana.fr/blog/2006/03/12/proxying-https-throught-apachemod_proxy/">Proxying HTTPS throught Apache/mod_proxy</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2006/03/12/proxying-https-throught-apachemod_proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

