<?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>Krzysztof Burghardt’s blog &#187; Linux</title>
	<atom:link href="http://blog.burghardt.pl/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.burghardt.pl</link>
	<description>Create. Break. Fix. Repeat.</description>
	<lastBuildDate>Fri, 30 Mar 2012 17:41:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>ESE Key Daemon 1.2.7 released</title>
		<link>http://blog.burghardt.pl/2010/07/ese-key-daemon-1-2-7-released/</link>
		<comments>http://blog.burghardt.pl/2010/07/ese-key-daemon-1-2-7-released/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 07:35:52 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[daemon]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[multimedia]]></category>

		<guid isPermaLink="false">http://blog.burghardt.pl/?p=432</guid>
		<description><![CDATA[<p>New version of ESE Key Daemon was released today.</p> <p>New features include the ability to handle multiple key combinations and distinguish between key presses and releases. A problem with the handling of the last line in a configuration file when there is no newline on the last line is gone. Numeric keys are now also [...]]]></description>
			<content:encoded><![CDATA[<p>New version of <a href="/2007/12/ese-key-daemon/">ESE Key Daemon</a> was released today.</p>
<p>New features include the ability to handle multiple key combinations and distinguish between key presses and releases. A problem with the handling of the last line in a configuration file when there is no newline on the last line is gone. Numeric keys are now also allowed in the configuration file.</p>
<p>Download: <a href="http://www.burghardt.pl/files/esekeyd-1.2.7.tar.gz">esekeyd-1.2.7.tar.gz</a> (<a href="http://www.burghardt.pl/files/esekeyd-1.2.7.tar.gz.asc">.asc</a>)</p>
<p>MD5: 5937ad6d7815dbc6ab6983411a9f37d4<br />
SHA1: 07671be42b61973a3270aaf1b41c3467568ae7ac</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2010/07/ese-key-daemon-1-2-7-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Debian GNU/Linux on Dell Inspiron 1764</title>
		<link>http://blog.burghardt.pl/2010/04/debian-gnulinux-on-dell-inspiron-1764/</link>
		<comments>http://blog.burghardt.pl/2010/04/debian-gnulinux-on-dell-inspiron-1764/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 18:17:59 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[AMD64]]></category>
		<category><![CDATA[BCM4353]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[GNU]]></category>
		<category><![CDATA[Inspiron]]></category>
		<category><![CDATA[Radeon]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=387</guid>
		<description><![CDATA[<p>Installing, configuring and using Debian GNU/Linux on Dell Inspiron 1764 (N0476409) notebook.</p> <p></p> Hardware overview Intel Core i5-520M (2.4GHz, 4 Threads, turbo Boost up to 2.93GHz, 3M cache) 17.3&#8243; WLED High Definition+ (1600&#215;900) TFT Display 1GB ATI Mobility Radeon HD 5450 4096MB 1067MHz Dual Channel DDR3 SDRAM (2&#215;2048) 500GB (5400RPM) Serial ATA Hard Drive DVD [...]]]></description>
			<content:encoded><![CDATA[<p>Installing, configuring and using Debian GNU/Linux on <a href="http://www1.euro.dell.com/uk/en/home/Laptops/inspiron-1764/pd.aspx?refid=inspiron-1764&#038;cs=ukdhs1&#038;s=dhs">Dell Inspiron 1764</a> (<a href="http://www.google.com/search?q=N0476409">N0476409</a>) notebook.</p>
<p><span id="more-387"></span></p>
<h2>Hardware overview</h2>
<ul>
<li>Intel Core i5-520M (2.4GHz, 4 Threads, turbo Boost up to 2.93GHz, 3M cache)</li>
<li>17.3&#8243; WLED High Definition+ (1600&#215;900) TFT Display</li>
<li>1GB ATI Mobility Radeon HD 5450</li>
<li>4096MB 1067MHz Dual Channel DDR3 SDRAM (2&#215;2048)</li>
<li>500GB (5400RPM) Serial ATA Hard Drive</li>
<li>DVD +/- RW Drive (read/write CD &#038; DVD)</li>
<li>Dell Wireless 1520 (802.11a/b/g/n)</li>
<li>Dell Bluetooth 365</li>
<li>Integrated 1,3MP webcam</li>
</ul>
<h2>Devices that works with Linux</h2>
<ul>
<li>CPU: both cores and HT works, recent Linux kernels support speedstep,</li>
<li>USB: works (even with Debian Installer images),</li>
<li>DVD+/-RW: works (even with Debian Installer images),</li>
<li>Graphic: basic features (2D, hardware accelerated 3D rendering) works with <strong>proprietary drivers only</strong>, most other features (CAL, POWERplay, multihead) unsupported; <strong>no FLOSS alternative</strong>,</li>
<li>Sound: works, but I need to pass options to module to make sound work properly,</li>
<li>Ethernet: works (even with Debian Installer images),</li>
<li>Wireless LAN: basic features (STA mode) supported by <strong>proprietary drivers only</strong>, other features (monitor mode and packet injection) not supported; <strong>no FLOSS alternative</strong>,</li>
<li>Bluetooth: works (as HCI only after reset with hid2hci),</li>
<li>Card reader: works (tested with MicroSD and Memory Stick PRO Duo, both with adapters),</li>
<li>Webcam: works.</li>
</ul>
<p></p>
<p>Also &#8220;Suspend to RAM&#8221; works using sysfs method of hibernate script. &#8220;Suspend to disk&#8221; works using ususpend method.</p>
<h2>Devices that does not work with Linux</h2>
<ul>
<li>none :-D</li>
</ul>
<h2>Devices</h2>
<ul>
<li><a href='/wp-content/uploads/2010/04/dmesg.txt' title='Linux kernel messages'>Linux kernel messages</a></li>
<li><a href='/wp-content/uploads/2010/04/lspci.txt' title='PCI devices list'>PCI devices list</a></li>
<li><a href='/wp-content/uploads/2010/04/lsusb.txt' title='USB devices list'>USB devices list</a></li>
<li><a href='/wp-content/uploads/2010/04/cpuinfo.txt' title='Processor details'>Processor details</a></li>
</ul>
<h2>Configuration</h2>
<h3>Graphic</h3>
<p>Download and install <a href="http://support.amd.com/us/gpudownload/Pages/index.aspx">fglrx</a> driver. <a href="http://www.google.com/search?q=fglrx+install">Google</a> is full of instruction how to install it, so I skip this step.</p>
<p>When driver is installed and fglrx is loaded into kernel its time to configure X.Org. Probably aticonfig would be best choice, but it fails on Mobility Radeon HD 5000 series cards with message:</p>
<pre>
# aticonfig --initial
aticonfig: No supported adapters detected
</pre>
<p>Download <a href='/wp-content/uploads/2010/04/xorg.txt'>my xorg.conf</a> and put it into <em>/etc/X11</em> directory. Then start X-server using <em>startx</em> command. My default layout include Inspiron&#8217;s built-in TFT screen, ATI Mobility Radeon HD 5450, ALPS touchpad and any other mice connected to it.</p>
<p>You will probably see &#8220;AMD unsupported hardware&#8221; watermark in lower right corner of the screen. There is no configuration option to remove it. Removal is possible by patching <em>fglrx_drv.so</em> file. <a href="http://www.phoronix.com/forums/member.php?u=6147">Kano</a> posted small script to replace call to EnableLogo with NOPs on <a href="http://www.phoronix.com/forums/showthread.php?t=19875">Phoronix Forums&#8217; thread &#8220;Unsupported Hardware watermark&#8221;</a>:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<span style="color: #007800;">DRIVER</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>xorg<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>fglrx_drv.so<br />
<span style="color: #000000; font-weight: bold;">for</span> x <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>objdump <span style="color: #660033;">-d</span> <span style="color: #007800;">$DRIVER</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'/call/&amp;&amp;/EnableLogo/{print &quot;\\x&quot;$2&quot;\\x&quot;$3&quot;\\x&quot;$4&quot;\\x&quot;$5&quot;\\x&quot;$6}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp;<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;s/<span style="color: #007800;">$x</span>/\x90\x90\x90\x90\x90/g&quot;</span> <span style="color: #007800;">$DRIVER</span><br />
<span style="color: #000000; font-weight: bold;">done</span></div></div>
<h3>Sound</h3>
<p>Create file <em>/etc/modprobe.d/sound</em> with following content:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">alias snd-card-0 snd-hda-intel<br />
options snd-hda-intel model=dell index=0</div></div>
<p>Reload alsa driver (or reboot).</p>
<h3>Wireless LAN</h3>
<p>Drivers need to be compiled from sources. First prepare your system for kernel module building. Install <em>build-essential</em> and <em>module-assistant</em> packages.Then prepare kernel headers:</p>
<pre>
# aptitude install build-essential module-assistant
# m-a prepare
</pre>
<p>When kernel headers are ready download <a href="http://www.broadcom.com/support/802.11/linux_sta.php">802.11 Linux STA driver</a> for Broadcom&#8217;s IEEE 802.11a/b/g/n devices (this includes BCM4311, BCM4312, BCM4313, BCM4321 and BCM4322). Compile it. Install. And finally load into running kernel:</p>
<pre>
# cd /usr/src
# wget http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_64-v5.60.48.36.tar.gz
# mkdir hybrid-portsrc-x86_64-v5.60.48.36
# cd hybrid-portsrc-x86_64-v5.60.48.36
# tar zxf ../hybrid-portsrc-x86_64-v5.60.48.36.tar.gz
# make
# mkdir /lib/modules/`uname -r`/local
# cp wl.ko /lib/modules/`uname -r`/local
# depmod -A
# modprobe -v wl
</pre>
<p>Command <em>dmesg | tail</em> should output something similar to this:</p>
<pre>
wlan0: Broadcom BCM4353 802.11 Hybrid Wireless Controller 5.60.48.36
</pre>
<h3>Bluetooth</h3>
<p>Dell Bluetooth 365 is detected as HCI on kernel <a href="http://packages.debian.org/lenny-backports/linux-headers-2.6.32-bpo.4-amd64">2.6.32-bpo.4-amd64</a> only if previously reset with hid2hci (get a copy form <a href="http://packages.debian.org/lenny-backports/bluez">bluez 4.6</a>). This is actually <a href="http://idebian.wordpress.com/2008/07/06/manage-hid-bluetooth-devices-in-linux/">a feature, not a bug</a>. Use recent hid2hci to put device into HCI mode:</p>
<pre>
# hid2hci -m dell -v 413c -p 8162
Attempting to switch device 413c:8162 to HCI mode was successful
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2010/04/debian-gnulinux-on-dell-inspiron-1764/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>nCipher HSM with OpenSSL</title>
		<link>http://blog.burghardt.pl/2010/03/ncipher-hsm-with-openssl/</link>
		<comments>http://blog.burghardt.pl/2010/03/ncipher-hsm-with-openssl/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 22:36:50 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[CHIL]]></category>
		<category><![CDATA[HSM]]></category>
		<category><![CDATA[nCipher]]></category>
		<category><![CDATA[OpenSSL]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=370</guid>
		<description><![CDATA[<p>I just finished playing with some nCipher&#8217;s HSM. Unfortunately there is no integration guide for OpenSSL that cover CHIL interface and nCipher hardware security modules.</p> <p>nCipher&#8217;s installation guide is quite good, but after you finish installing hardware, drivers and daemons, you are on your own.</p> <p>I found only two helpful sources: Andrea Campi&#8217;s blog entry [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished playing with some <a href="http://iss.thalesgroup.com/">nCipher&#8217;s</a> <a href="http://en.wikipedia.org/wiki/Hardware_security_module">HSM</a>. Unfortunately there is no integration guide for <a href="http://www.openssl.org/">OpenSSL</a> that cover CHIL interface and nCipher hardware security modules.</p>
<p>nCipher&#8217;s installation guide is quite good, but after you finish installing hardware, drivers and daemons, you are on your own.</p>
<p>I found only two helpful sources: Andrea Campi&#8217;s blog entry about <a href="http://blog.webcom.it/articles/2006/04/07/ncipher-nethsm-with-openssl-tutorial/">nCipher NetHSM and OpenSSL</a> and Marek Marcola&#8217;s <a href="http://www.mail-archive.com/openssl-users@openssl.org/msg47199.html">post on openssl-users mailing list</a>.</p>
<p>Both guides ends on key generation and self-signed certificates. Its enough to get CHIL enabled application to work with nCipher&#8217;s HSM, but will not help you to convert any existing OpenSSL (not an CHIL-aware) application to use HSM.</p>
<p><span id="more-370"></span></p>
<h2>CHIL enabled OpenSSL</h2>
<p>When you have driver, hardserver and chil library for your HSM installed the next step is to install OpenSSL with CHIL support enabled. Modern Linux distribution may have CHIL already enabled. If so, there should be <em>libchil.so</em> library in <em>/usr/lib/ssl/engines</em> directory.</p>
<p>If <em>libchil.so</em> is missing follow OpenSSL installation steps as described in <a href="http://iss.thalesgroup.com/Resources/~/media/Files/Integration%20Guides/Apache22x.ashx">Apache2.2.x, OpenSSL 0.9.8x and nCipher Modules Integration Guide</a>.</p>
<p>When OpenSSL in installed, add <em>/opt/nfast/toolkits/hwcrhk</em> to LD_LIBRARY_PATH:</p>
<pre>
$ export LD_LIBRARY_PATH=/opt/nfast/toolkits/hwcrhk
</pre>
<p>To check if OpenSSL is able to communicate with HSM trough CHIL interface run:</p>
<pre>
$ openssl engine -t chil
(chil) CHIL hardware engine support
     [ available ]
</pre>
<p>If CHIL is <strong>available</strong> benchmark HSM with:</p>
<pre>
$ openssl speed rsa -engine chil -elapsed -multi 50
</pre>
<h2>Hardware accelerated cryptography</h2>
<p>Use <a href="http://www.openssl.org/docs/crypto/engine.html">engine</a> interface to switch to cryptography implementation from hardware security module.</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">#include &lt;openssl/engine.h&gt;</span><br />
<br />
ENGINE <span style="color: #339933;">*</span>hwEngine <span style="color: #339933;">=</span> NULL<span style="color: #339933;">;</span><br />
<br />
<span style="color: #993333;">int</span> enable_chil<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; ENGINE_load_builtin_engines<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>hwEngine <span style="color: #339933;">=</span> ENGINE_by_id<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;CHIL&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>ENGINE_set_default<span style="color: #009900;">&#40;</span>hwEngine<span style="color: #339933;">,</span> ENGINE_METHOD_ALL<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">2</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>When application finish its cryptography operations, it should free engine.</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333;">void</span> disable_chil<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>hwEngine<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ENGINE_finish<span style="color: #009900;">&#40;</span>hwEngine<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; hwEngine <span style="color: #339933;">=</span> NULL<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ENGINE_cleanup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<h2>Hardware key protection/storage</h2>
<p>If you want to make your private keys more secure you should use hardware key protection (or even storage).</p>
<p>Hardware protected keys are stored on local filesystem, but encrypted by key stored only in HSM. To generate such key use:</p>
<pre>
$ /opt/nfast/bin/generatekey hwcrhk
</pre>
<p>Answer some questions (Protected by? module, Key type? RSA, Key size? 4096, Key identifier? keyname) and your encrypted (by module, as you choose in question above) private key is saved in <em>/opt/nfast/kmdata/local/key_hwcrhk_rsa-keyname</em>.</p>
<p>When using locally stored encryption keys you load them as in this example (I use <a href="http://www.openssl.org/docs/crypto/evp.html">EVP</a> interface for high-level cryptographic functions):</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">EVP_PKEY <span style="color: #339933;">*</span>pkey <span style="color: #339933;">=</span> NULL<span style="color: #339933;">;</span><br />
<br />
<span style="color: #993333;">int</span> load_key<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; fp <span style="color: #339933;">=</span> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html"><span style="color: #000066;">fopen</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;filename.key&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>fp <span style="color: #339933;">==</span> NULL<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; pkey <span style="color: #339933;">=</span> PEM_read_PrivateKey<span style="color: #009900;">&#40;</span>fp<span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>When you have CHIL keys, loading them is also very simple:</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333;">void</span> load_key_chil<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pkey <span style="color: #339933;">=</span> ENGINE_load_private_key<span style="color: #009900;">&#40;</span>hwEngine<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;rsa-keyname&quot;</span><span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>When key is no longer in use destroy it with:</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333;">void</span> free_key<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; EVP_PKEY_free<span style="color: #009900;">&#40;</span>pkey<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>If application just need to do some hardware accelerated RSA or it need to use hardware protected keys those code pieces along with CHIL-enabled OpenSSL is all you need.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2010/03/ncipher-hsm-with-openssl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Aktualizacja OpenWRT</title>
		<link>http://blog.burghardt.pl/2009/10/aktualizacja-openwrt/</link>
		<comments>http://blog.burghardt.pl/2009/10/aktualizacja-openwrt/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 23:11:34 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Polish]]></category>
		<category><![CDATA[Asus]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[WL-500g]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=327</guid>
		<description><![CDATA[<p>W styczniu opisałem jak zainstalować dopasowaną do własnych potrzeb dystrybucję OpenWRT na routerze ASUS WL-500g Premium. Pora na aktualizację.</p> <p></p> Kopia zapasowa <p>Na wszelki wypadek, gdyby aktualizacja się nie powiodła warto wykonać kopię bezpieczeństwa aktualnego systemu. Informacje na temat wykonywania kopii całego oprogramowania (kernel + squashfs + jffs2) znajdziemy w wiki pod hasłem &#8220;BackupAndRestore&#8220;.</p> Aktualizacja [...]]]></description>
			<content:encoded><![CDATA[<p>W styczniu opisałem jak zainstalować dopasowaną do własnych potrzeb dystrybucję OpenWRT na routerze <a href="/2009/01/openwrt-na-miare-naszych-mozliwosci-i-potrzeb">ASUS WL-500g Premium</a>. Pora na aktualizację.</p>
<p><span id="more-327"></span></p>
<h2>Kopia zapasowa</h2>
<p>Na wszelki wypadek, gdyby aktualizacja się nie powiodła warto wykonać kopię bezpieczeństwa aktualnego systemu. Informacje na temat wykonywania kopii całego oprogramowania (kernel + squashfs + jffs2) znajdziemy w <a href="http://nuwiki.openwrt.org/">wiki</a> pod hasłem &#8220;<a href="http://nuwiki.openwrt.org/oldwiki/BackupAndRestore">BackupAndRestore</a>&#8220;.</p>
<h2>Aktualizacja źródeł</h2>
<p>Zgodnie z instrukcją na stronie <a href="https://dev.openwrt.org/wiki/GetSource">zatytułowanej &#8220;GetSource&#8221;</a> pobieramy źródła. Jeśli mamy jeszcze poprzednie używamy <em>svn switch &#8211;relocate</em>, aby zmienić protokół z <em>https://</em> na <em>svn://</em>, a następnie wydajemy polecenie <em>svn up</em>.</p>
<h2>Nakładanie łatek</h2>
<p>Łatka zwiększająca domyślny limit wielkości obszaru rootfs nie jest już potrzebna. Aktualny limit jest ustawiony wyżej niż ustawiała go łatka.</p>
<p>Łatka włączająca wsparcie dla <a href="http://ocf-linux.sourceforge.net/">OCF</a> w OpenSSL wygląda tak:</p>
<div class="codecolorer-container diff default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="diff codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Index: package/openssl/Makefile<br />
===================================================================<br />
<span style="color: #888822;">--- package/openssl/Makefile &nbsp; &nbsp;<span style="">&#40;</span>wersja 18079<span style="">&#41;</span></span><br />
<span style="color: #888822;">+++ package/openssl/Makefile &nbsp; &nbsp;<span style="">&#40;</span>kopia robocza<span style="">&#41;</span></span><br />
<span style="color: #440088;">@@ -81,6 +81,8 @@</span><br />
&nbsp;define Build/Configure<br />
&nbsp; &nbsp; <span style="">&#40;</span>cd $<span style="">&#40;</span>PKG_BUILD_DIR<span style="">&#41;</span>; \<br />
&nbsp; &nbsp; &nbsp; &nbsp; ./Configure linux-openwrt \<br />
<span style="color: #00b000;">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --with-cryptodev \</span><br />
<span style="color: #00b000;">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --with-cryptodev-digests \</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --prefix=/usr \<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --openssldir=/etc/ssl \<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="">&#40;</span>TARGET_CPPFLAGS<span style="">&#41;</span> \</div></div>
<h2>Konfiguracja źródeł</h2>
<p>Uruchamiamy <em>make menuconfig</em> i wczytujemy poprzednio użyty plik konfiguracyjny.</p>
<p>Następnie w menu wybieramy <strong>Advanced configuration options (for developers)</strong>, a w podmenu <strong>Use ccache</strong> oraz <strong>Toolchain Options</strong>, a w nim <strong>Enable Stack-Smashing Protection support</strong>.</p>
<p>Aby używać najnowszej wersji sterownika WiFi oraz najnowszego firmware wybieramy w menu głównym <strong>Kernel modules</strong>, a następnie <strong>Wireless Drivers</strong>. W tym podmenu wybieramy <strong>kmod-b43</strong> oraz upewniamy się, że <strong>odznaczona pozostaje</strong> opcja <em>kmod-b43legacy</em>.</p>
<p>W tym samym podmenu możemy wybrać <strong>b43 firmware version</strong>. Wybieramy <strong>4.178.10.4 (experimental)</strong>.</p>
<h2>Kompilacja i instalacja</h2>
<p>Kompilację i instalację przeprowadzamy zgodnie z <a href="/2009/01/openwrt-na-miare-naszych-mozliwosci-i-potrzeb/">wcześniejszą instrukcją</a>.</p>
<h2>Problemy</h2>
<p>Jedyny, i w dodatku prosty do usunięcia problem jaki napotkałem to&#8230;</p>
<h3>OPKG: Could not obtain administrative lock</h3>
<p>Jeśli po wydaniu polecenia <em>opkg update</em> zobaczymy komunikat:</p>
<pre>
Collected errors:
 * Could not obtain administrative lock
</pre>
<p>Należy utworzyć katalog <em>/usr/lib/opkg</em>. Jeśli katalog istnieje należy usunąć z niego plik <em>lock</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/10/aktualizacja-openwrt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Szwajcarski nóż^Wpendrive oficerski</title>
		<link>http://blog.burghardt.pl/2009/07/szwajcarski-nozwpendrive-oficerski/</link>
		<comments>http://blog.burghardt.pl/2009/07/szwajcarski-nozwpendrive-oficerski/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 20:46:52 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Polish]]></category>
		<category><![CDATA[GRUB]]></category>
		<category><![CDATA[GRUB4DOS]]></category>
		<category><![CDATA[PenDrive]]></category>
		<category><![CDATA[QEMU]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=325</guid>
		<description><![CDATA[<p>Szwajcarskie noże oficerskie słyną ze swej funkcjonalności. Odkąd zaczęto produkować wersje z wbudowaną pamięcią flash na USB zastanawiałem się, jak zapewnić oprogramowaniu zainstalowanemu na przenośnej pamięci równie dużą funkcjonalność.</p> <p></p> PenDrive do zadań specjalnych <p>Plan minimum to możliwość uruchamiania z pamięci klucza USB przynajmniej:</p> Programu rozruchowego GRUB Ultimate Boot CD Parted Magic OS <p>Dodatkowo przydatna [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://pl.wikipedia.org/wiki/Szwajcarski_nóż_oficerski">Szwajcarskie noże oficerskie</a> słyną ze swej funkcjonalności. Odkąd zaczęto produkować <a href="http://victorinox.com.pl/?p=1:25">wersje z wbudowaną pamięcią flash na USB</a> zastanawiałem się, jak zapewnić oprogramowaniu zainstalowanemu na przenośnej pamięci równie dużą funkcjonalność.</p>
<p><span id="more-325"></span></p>
<h2>PenDrive do zadań specjalnych</h2>
<p>Plan minimum to możliwość uruchamiania z pamięci klucza USB przynajmniej:</p>
<ul>
<li>Programu rozruchowego <a href="http://www.gnu.org/software/grub/">GRUB</a></li>
<li><a href="http://www.ultimatebootcd.com/">Ultimate Boot CD</a></li>
<li><a href="http://www.partedmagic.com/">Parted Magic OS</a></li>
</ul>
<p>Dodatkowo przydatna byłaby dystrybucja typu LiveCD (<a href="http://debian-live.alioth.debian.org/">Debian Live</a>?) oraz możliwość uruchamiania <a href="http://www.debian.org/devel/debian-installer/">instalatora Debiana</a>.</p>
<h2>Przygotowanie pamięci</h2>
<p>Przygotowanie dysku USB rozpoczynamy od usunięcia aktualnej tablicy partycji. W wyniku wykonania tego kroku dane na dysku nie będą już dostępne. Mój dysk jest w systemie widoczny jako <em>/dev/sda</em>.</p>
<pre>
# dd if=/dev/zero of=/dev/sda bs=512 count=1
</pre>
<p>Gdy tablica partycji jest już czysta, tworzymy partycję startową. W tym celu użyjemy programu <em>mkdiskimage</em> z pakietu <a href="http://packages.debian.org/syslinux-common">syslinux-common</a>. Użycie tego narzędzia pozwala na stworzenie dysku, który będzie można uruchamiać zarówno jako <strong>USB-HDD</strong>, jak i jako <strong>USB-ZIP</strong>. Partycja startowa będzie oznaczona numerem 2, dzięki czemu systemy Windows, nie będą jej używały.</p>
<pre>
# mkdiskimage -2 -z /dev/sda 1024
</pre>
<p>Ostatni parametr to wielkość partycji. W moim przypadku 1024, czyli największy rozmiar, który jest obsługiwany przez wszystkie systemy <a href="http://pl.wikipedia.org/wiki/BIOS">BIOS</a>. Możemy stworzyć mniejszą partycję, jeśli mamy mniejszą <a href="http://pl.wikipedia.org/wiki/Pamięć_flash">pamięć flash</a>. Stworzenie większej, może spowodować problemy z uruchamianiem systemu z tej partycji.</p>
<h2>Instalacja GRUB-a</h2>
<p>Kolejnym krokiem będzie instalacja <a href="http://sourceforge.net/projects/grub4dos/">GRUB4DOS</a>. Po pobraniu i rozpakowaniu programu wydajemy, w katalogu z programem, polecenia:</p>
<pre>
# ./bootlace.com /dev/sda
# ./bootlace.com --floppy /dev/sda2
</pre>
<p>Aby dokończyć instalację, montujemy partycję <em>/dev/sda2</em> i kopiujemy na nią plik <em>grldr</em>:</p>
<pre>
# mount /dev/sda2 /mnt
# cp grldr /mnt
</pre>
<h2>Instalacja Ultimate Boot CD i Parted Magic OS</h2>
<p>W tym przypadku ciężko mówić nawet o instalacji. Po prostu umieszczamy pliki <em>ubcd.iso</em> i <em>pmagic-4.1.iso</em> na nośniku (obok skopiowanego wcześniej <em>grldr</em>).</p>
<h2>Łączenie elementów układanki w działającą całość</h2>
<p>Pewnie już każdy zastanawia się jak to ma niby zadziałać? GRUB i obrazy ISO płyt CD!? Odpowiedź jest prosta: <em>menu.lst</em>.</p>
<p>Po rozpakowaniu GRUB4DOS otrzymamy plik <em>menu.lst</em>, w którym odnajdziemy m.in. takie wpisy:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">title Parted Magic ISO<br />
fallback 7<br />
find --set-root /pmagic.iso<br />
map /pmagic.iso (0xff) || map --mem /pmagic.iso (0xff)<br />
map --hook<br />
chainloader (0xff)<br />
savedefault --wait=2<br />
<br />
title Ultimate Boot CD ISO<br />
fallback 8<br />
find --set-root /ubcd.iso<br />
map /ubcd.iso (0xff) || map --mem /ubcd.iso (0xff)<br />
map --hook<br />
chainloader (0xff)<br />
savedefault --wait=2</div></div>
<p>Oto cała magia GRUB4DOS. Potrafi on załadować system z bootowalnego obrazu ISO.</p>
<h2>Testowanie z pomocą QEMU</h2>
<p>Aby przetestować działanie PenDrive-a bez konieczności restartowania komputera użyjemy <a href="http://pl.wikipedia.org/wiki/QEMU">QEMU</a>. Po odmontowaniu systemu plików wydajemy polecenie:</p>
<pre>
$ qemu -monitor stdio -kernel-kqemu -m 1024 -hda /dev/sda
</pre>
<p>Użyte parametry włączają linię komend QEMU na konsoli, z której go uruchomiliśmy; 1024MB pamięci RAM w maszynie wirtualnej; oraz użycie <em>kqemu</em> również dla kodu jądra.</p>
<p>Plan minimum wykonany. Uruchamianie instalatora Debiana i dystrybucji Live jest bardziej skomplikowane, ale również możliwe.</p>
<h2>Debian-Installer</h2>
<p>Niestety ISO aktualnej wersji stabilnej (&#8220;<a href="http://www.debian.org/releases/lenny/">Lenny</a>&#8220;) nie potrafi wystartować w ten sposób, dlatego użyjemy <em>hd-media/boot.img.gz</em> dla <a href="http://ftp.pl.debian.org/debian/dists/lenny/main/installer-i386/current/images/hd-media/">i386</a> (lub <a href="http://ftp.pl.debian.org/debian/dists/lenny/main/installer-amd64/current/images/hd-media/">amd64</a>).</p>
<p>Plik ten należy poddać dekompresji i skopiować na PenDrive-a:</p>
<pre>
# gunzip boot.img.gz
# cp boot.img /mnt/debian-installer.img
</pre>
<p>Do <em>menu.lst</em> należy dodać następujący wpis:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">title Debian-Installer<br />
find --set-root /debian-installer.img || root (fd0)<br />
map /debian-installer.img (fd0)<br />
map --hook<br />
chainloader (fd0)+1<br />
rootnoverify (fd0)<br />
map --floppies=1</div></div>
<p>Oprócz <em>hd-media/boot.img.gz</em> na nośniku potrzebne jest jeszcze zwykłe ISO instalatora Debiana. Można wybrać dowolny obraz z dostępnych (netinst, cd1 a nawet dvd1, jeśli mamy około 4GB wolnego miejsca). Obraz może znajdować się na innej partycji.</p>
<h2>Debian Live</h2>
<p>Instalacja Debian Live na PenDrive jest bardziej skomplikowana. Zaczynamy od <a href="http://cdimage.debian.org/cdimage/release/current-live/i386/iso-cd/">wybrania &#8220;smaku&#8221; dystrybucji Live</a>. Do wyboru mamy: Gnome, KDE, XFCE, LXDE, Rescue oraz standard.</p>
<p>Gdy pobraliśmy już plik ISO. Za pomocą <em>mount -o loop</em> lub <a href="http://pl.wikipedia.org/wiki/Midnight_Commander">Midnight Commandera</a> kopiujemy plik <em>live/filesystem.squashfs</em> do katalogu <em>live</em> na dysku USB, a pozostałe pliki z płyty CD do jednego katalogu (np. <em>/tmp/debian-live</em>).</p>
<p>Z wszystkich plików (poza <em>live/filesystem.squashfs</em>!) tworzymy nowy plik ISO komendą:</p>
<pre>
mkisofs -o /tmp/debian-live.iso -J -l -cache-inodes -allow-multidot -no-emul-boot -boot-load-size 4 -boot-info-table -r -b isolinux/isolinux.bin -c isolinux/boot.cat -m isolinux/isolinux.bin /tmp/debian-live
</pre>
<p>Plik <em>/tmp/debian-live.iso</em> kopiujemy na PenDrive-a, a do <em>menu.lst</em> dodajemy następujący wpis:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">title Debian Live<br />
find --set-root /debian-live.iso || root (fd0)<br />
map /debian-live.iso (0xff) || map --mem /debian-live.iso (0xff)<br />
map --hook<br />
chainloader (0xff)</div></div>
<h2>Partycja &#8220;na dane&#8221; oraz ukrywanie partycji numer 2</h2>
<p>Na koniec powinniśmy stworzyć partycję <em>/dev/sda1</em> zajmującą całe pozostałe miejsce oraz nadać partycjom etykiety, aby łatwiej było je rozróżnić. Na koniec warto ukryć partycję <em>/dev/sda1</em>. Wszystkiego tego dokonamy uruchamiając komputer z&#8230; naszego PenDrive-a za pomocą Parted Magic OS.</p>
<h2>Windows</h2>
<p>W podobny sposób można z PenDrive-a uruchamiać obrazy płyt CD (<a href="http://en.wikipedia.org/wiki/BartPE">BartPE</a>) z Windows XP przygotowane programem <a href="http://www.nu2.nu/pebuilder/">PE Builder</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/07/szwajcarski-nozwpendrive-oficerski/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sptrace 1.4.2 released</title>
		<link>http://blog.burghardt.pl/2009/03/sptrace-142-released/</link>
		<comments>http://blog.burghardt.pl/2009/03/sptrace-142-released/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 09:00:06 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[LKM]]></category>
		<category><![CDATA[ltrace]]></category>
		<category><![CDATA[ptrace]]></category>
		<category><![CDATA[strace]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=292</guid>
		<description><![CDATA[<p>New version of sptrace was released today. Sptrace is a secure ptrace() Linux Kernel Module (LKM). It limits users&#8217; access to the ptrace() call. Module was updated to reflect changes in new kernel releases and tested with 2.6.26.</p> <p></p> <p>When someone not allowed to trace processes uses program that call ptrace() (like strace, ltrace or [...]]]></description>
			<content:encoded><![CDATA[<p>New version of <a href="/2007/12/limiting-access-to-ptrace-call-in-linux/">sptrace</a> was released today. Sptrace is a <strong>secure ptrace()</strong> Linux Kernel Module (LKM). It limits users&#8217; access to the <em>ptrace()</em> call. Module was updated to reflect changes in new kernel releases and tested with 2.6.26.</p>
<p><span id="more-292"></span></p>
<p>When someone not allowed to trace processes uses program that call <em>ptrace()</em> (like strace, ltrace or gdb) current and parent processes names, pids, uids and euids are logged, e.g.:</p>
<pre>
Mar 13 08:51:11 ghost kernel: [ 8086.730499] sptrace: ptrace() DENIED for (gdb:6810) UID(1000) EUID(1000), parent (gdb:6785) UID(1000) EUID(1000)
Mar 13 08:51:11 ghost kernel: [ 8086.984694] sptrace: ptrace() DENIED for (gdb:6785) UID(1000) EUID(1000), parent (tcsh:32216) UID(1000) EUID(1000)
Mar 13 08:51:44 ghost kernel: [ 8119.928920] sptrace: ptrace() DENIED for (gdb:6923) UID(1000) EUID(1000), parent (tcsh:32216) UID(1000) EUID(1000)
</pre>
<p>Program that call <em>ptrace()</em> will get EPERM error:</p>
<pre>
$ strace ls
strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted
$ ltrace ls
PTRACE_TRACEME: Operation not permitted
PTRACE_SETOPTIONS: Operation not permitted
$ gdb -p 32215
GNU gdb 6.8-debian
[...]
This GDB was configured as "i486-linux-gnu".
Attaching to process 32215
ptrace: Operation not permitted.
</pre>
<p>Module log both allowed and denied <em>ptrace()</em> calls. Allowed traces as logged as:</p>
<pre>
Mar 11 19:14:48 ghost kernel: [ 6445.524669] sptrace: ptrace() by (ltrace:27558) UID(1000) EUID(1000), parent (ltrace:27557) UID(1000) EUID(1000)
Mar 11 19:14:48 ghost kernel: [ 6445.525460] sptrace: ptrace() by (ltrace:27557) UID(1000) EUID(1000), parent (tcsh:26606) UID(1000) EUID(1000)
</pre>
<p>By default <strong>sptrace</strong> deny access to <em>ptrace()</em> to all non root users (GID != 0). Root group (or wheel) is allowed to use this call. To disable tracing for all users, including those in root group pass parameter <strong>ptrace_group=-1</strong>, e.g.:</p>
<pre>
$ insmod ./sptrace.ko ptrace_group=-1
</pre>
<p>Download: <a href="http://www.burghardt.pl/files/sptrace-1.4.2.tar.gz">sptrace-1.4.2.tar.gz</a> (<a href="http://www.burghardt.pl/files/sptrace-1.4.2.tar.gz.asc">.asc</a>)</p>
<p>md5sum: 9a23198cbdcd256b11e2b0dc2c03b331<br />
sha1sum: 458f9b15e9a5b02cd18759b6b09a4b41d062d7cd</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/03/sptrace-142-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClamFS 1.0.0 has been released</title>
		<link>http://blog.burghardt.pl/2009/02/clamfs-100-has-been-released/</link>
		<comments>http://blog.burghardt.pl/2009/02/clamfs-100-has-been-released/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 14:18:45 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[ClamAV]]></category>
		<category><![CDATA[ClamFS]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[WINE]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=273</guid>
		<description><![CDATA[<p>ClamFS 1.0.0 has been released yesterday. It contains some new features that might be quite interesting for its users.</p> <p></p> Completed clamd results caching <p>This was a long waiting feature. Version 0.9.1 cache only information about clean files. Infected files was scanned on every access. Starting from version 1.0.0 information about both clean and infected [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://clamfs.sourceforge.net/">ClamFS</a> <a href="http://freshmeat.net/releases/293686/">1.0.0</a> has been released yesterday. It contains some new features that might be quite interesting for its users.</p>
<p><span id="more-273"></span></p>
<h2>Completed clamd results caching</h2>
<p>This was a long waiting feature. Version 0.9.1 cache only information about clean files. Infected files was scanned on every access. Starting from version 1.0.0 information about both clean and infected files are kept in cache while files that cannot be scanned (mostly because of permission problems) are discarded from cache.</p>
<h2>Starting without clamd available</h2>
<p>A new &#8220;check&#8221; option was added to allow you to mount a ClamFS file system when clamd is not available, such as during an early stage of the boot process. To disable ClamAV Daemon (clamd) check on ClamFS startup set option check to no:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;clamd</span> <span style="color: #000066;">socket</span>=<span style="color: #ff0000;">&quot;/var/run/clamav/clamd.ctl&quot;</span> <span style="color: #000066;">check</span>=<span style="color: #ff0000;">&quot;no&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></div>
<h3>Mounting file systems from /etc/fstab</h3>
<p>With &#8220;check=no&#8221; mounting ClamFS file systems form <em>/etc/fstab</em> is possible using fuse mount helper (<em>/sbin/mount.fuse</em>). ClamFS will be started on boot with configuration file defined here provided as its argument. Simple definition of ClamFS mount point in <em>/etc/fstab</em> looks like:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">clamfs#/etc/clamfs/share.xml &nbsp;/clamfs/share &nbsp;fuse &nbsp;defaults &nbsp;0 &nbsp;0</div></div>
<h2>Read-only mounts</h2>
<p>The &#8220;readonly&#8221; option was added to the filesystem options allowing you to create a read-only protected file system. Just extend filesystem definition in config file with readonly option set to yes:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filesystem</span> <span style="color: #000066;">root</span>=<span style="color: #ff0000;">&quot;/share&quot;</span> <span style="color: #000066;">mountpoint</span>=<span style="color: #ff0000;">&quot;/clamfs/share&quot;</span> <span style="color: #000066;">readonly</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></div>
<h2>File system and cache statistics</h2>
<p>ClamFS has file system statistics that allow you to monitor and tune its performance. Statistics module keep track of file system usage and cache hits. Stats module is configured with &#8220;stats&#8221; tag. It can dump statistics periodically and on ClamFS dismount:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stats</span> <span style="color: #000066;">atexit</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000066;">every</span>=<span style="color: #ff0000;">&quot;3600&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></div>
<p>Statistics are dumped to configured logging target. Here is an example of such statistics dumped to syslog:</p>
<pre>
Feb  8 14:52:51 ghost clamfs: --- begin of statistics ---
Feb  8 14:52:51 ghost clamfs: Early cache hit: 1038
Feb  8 14:52:51 ghost clamfs: Early cache miss: 1030
Feb  8 14:52:51 ghost clamfs: Late cache hit: 1038
Feb  8 14:52:51 ghost clamfs: Late cache miss: 0
Feb  8 14:52:51 ghost clamfs: Whitelist hit: 10
Feb  8 14:52:51 ghost clamfs: Blacklist hit: 108
Feb  8 14:52:51 ghost clamfs: Files bigger than maximal-size: 3
Feb  8 14:52:51 ghost clamfs: open() function called 2081 times (allowed: 1803, denied: 278)
Feb  8 14:52:51 ghost clamfs: Scan failed 278 times
Feb  8 14:52:51 ghost clamfs: --- end of statistics ---
</pre>
<h2>Better default extension blacklist</h2>
<p>Default blacklist in configuration file was extended. I advise all users to incorporate <a href="http://clamfs.svn.sourceforge.net/viewvc/clamfs/tags/clamfs-1.0.0/doc/clamfs.xml?view=markup">blacklist from version 1.0.0</a> into their configuration files.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/02/clamfs-100-has-been-released/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Huawei E272 jako zapasowe łącze routera OpenWRT</title>
		<link>http://blog.burghardt.pl/2009/01/huawei-e272-jako-zapasowe-lacze-routera-openwrt/</link>
		<comments>http://blog.burghardt.pl/2009/01/huawei-e272-jako-zapasowe-lacze-routera-openwrt/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 18:30:08 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Polish]]></category>
		<category><![CDATA[Huawei]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[PPP]]></category>
		<category><![CDATA[pppd]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=252</guid>
		<description><![CDATA[<p>Niedawno opisałem instalację &#8220;mydelniczki&#8221; DSL Thomson SpeedTouch 330 w OpenWRT. Tym razem instalujemy &#8220;mydelniczkę&#8221; trzeciej generacji &#8211; Huawei E272 &#8211; jako zapasowe łącze w routerze.</p> <p></p> Konfiguracja źródeł i kompilacja <p>W pliku .config włączamy program chat odpowiedzialny za komunikację z modemem oraz sterownik portów szeregowych na magistrali USB &#8211; usbserial. Możemy włączyć też moduł option [...]]]></description>
			<content:encoded><![CDATA[<p>Niedawno opisałem instalację <a href="/2009/01/openwrt-na-miare-naszych-mozliwosci-i-potrzeb/">&#8220;mydelniczki&#8221; DSL Thomson SpeedTouch 330</a> w OpenWRT. Tym razem instalujemy &#8220;mydelniczkę&#8221; <a href="http://pl.wikipedia.org/wiki/3G">trzeciej generacji</a> &#8211; Huawei E272 &#8211; jako zapasowe łącze w routerze.</p>
<p><span id="more-252"></span></p>
<h2>Konfiguracja źródeł i kompilacja</h2>
<p>W pliku <em>.config</em> włączamy program <em>chat</em> odpowiedzialny za komunikację z modemem oraz sterownik <a href="http://pl.wikipedia.org/wiki/Port_szeregowy">portów szeregowych</a> na magistrali <a href="http://pl.wikipedia.org/wiki/USB">USB</a> &#8211; <em>usbserial</em>. Możemy włączyć też moduł <em>option</em> lub inny odpowiedni dla naszego modemu. Pozostałe ustawienia pozostawiamy niezmienione. Można dodatkowo zainstalować <em>microcom</em>, aby ułatwić sobie ewentualne &#8220;ręczne sterowanie&#8221; modemem.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">CONFIG_PACKAGE_chat=y<br />
CONFIG_PACKAGE_kmod-usb-serial=y<br />
CONFIG_PACKAGE_kmod-usb-serial-option=y<br />
CONFIG_PACKAGE_microcom=y</div></div>
<p>Rekompilujemy i instalujemy OpenWRT. (Ewentualnie można doinstalować brakujące pakiety do istniejącej instalacji OpenWRT za pomocą <em>opkg</em>.)</p>
<h2>Port szeregowy</h2>
<p>Ponieważ modem GPRS po podłączeniu nie jest przypisywany przez system do żadnego sterownika (w <a href="http://www.debian.org/">Debianie</a> obsługuje go moduł <em>option</em>, jeśli go nie włączymy możemy użyć ogólnego sterownika portu szeregowego na USB). Dopisujemy w pliku <em>/etc/modules.d/60-usb-serial</em> opcje <strong>vendor</strong> i <strong>product</strong> oraz <em>maxSize</em>.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">usbserial vendor=0x12d1 product=0x1001 maxSize=4096</div></div>
<p>Po tej operacji należy ponownie załadować moduł <em>usbserial</em> poleceniem:</p>
<pre>
# rmmod usbserial
# insmod /lib/modules/`uname -r`/usbserial.ko vendor=0x12d1 product=0x1001 maxSize=4096
</pre>
<h2>Skrypty chata</h2>
<p>Do inicjacji modemu należy użyć skryptów programu <em>chat</em>. Należy stworzyć katalog, np. <em>/etc/chatscripts</em>.</p>
<pre>
# mkdir /etc/chatscripts
</pre>
<p>A następnie w stworzonym katalogu utworzyć pliki <em>/etc/chatscripts/iplus</em> i <em>/etc/chatscripts/iplus-off</em> o następującej zawartości:</p>
<p><em>/etc/chatscripts/iplus</em>:</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">TIMEOUT <span style="color: #0000dd;">10</span><br />
ECHO ON<br />
ABORT <span style="color: #ff0000;">&quot;NO CARRIER&quot;</span><br />
ABORT <span style="color: #ff0000;">&quot;NO DIALTONE&quot;</span><br />
ABORT <span style="color: #ff0000;">&quot;ERROR&quot;</span><br />
ABORT <span style="color: #ff0000;">&quot;NO ANSWER&quot;</span><br />
ABORT <span style="color: #ff0000;">&quot;BUSY&quot;</span><br />
<span style="color: #ff0000;">''</span> <span style="color: #ff0000;">'rATZ'</span><br />
CLR_ABORT <span style="color: #ff0000;">&quot;ERROR&quot;</span><br />
OK AT<span style="color: #339933;">+</span>CPIN<span style="color: #339933;">=</span><span style="color: #0000dd;">1234</span><br />
<span style="color: #ff0000;">''</span> AT<span style="color: #339933;">+</span>CGDCONT<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;IP&quot;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;www.plusgsm.pl&quot;</span><br />
OK ATD<span style="color: #339933;">*</span><span style="color: #0000dd;">99</span><span style="color: #339933;">#</span><br />
ABORT <span style="color: #ff0000;">&quot;ERROR&quot;</span><br />
CONNECT ``</div></div>
<p><em>/etc/chatscripts/iplus-off</em>:</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ABORT <span style="color: #ff0000;">&quot;NO CARRIER&quot;</span><br />
ABORT <span style="color: #ff0000;">&quot;NO DIALTONE&quot;</span><br />
ABORT <span style="color: #ff0000;">&quot;ERROR&quot;</span><br />
ABORT <span style="color: #ff0000;">&quot;NO ANSWER&quot;</span><br />
ABORT <span style="color: #ff0000;">&quot;BUSY&quot;</span><br />
<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #ff0000;">&quot;K&quot;</span><br />
<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #ff0000;">&quot;+++ath&quot;</span></div></div>
<p>W pierwszym skrypcie należy ustawić własny PIN. Cała ta dziwna sekcja zaczynająca się od <strong>CLR_ABORT</strong> służy do ignorowania odpowiedzi ERROR modemu podczas ponownego łączenia, czyli gdy <a href="http://pl.wikipedia.org/wiki/Karta_SIM">karta SIM</a> jest już odblokowana.</p>
<h2>Konfiguracja połączenia</h2>
<p>Aby skonfigurować połączenie <a href="http://pl.wikipedia.org/wiki/GPRS">GPRS</a> (albo <a href="http://pl.wikipedia.org/wiki/EDGE">EDGE</a> lub <a href="http://pl.wikipedia.org/wiki/HSDPA">HSDPA</a>, ponieważ tutaj o typie połączenia decyduje modem) dodajemy do pliku <em>/etc/config/network</em>:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">config interface backup<br />
&nbsp; &nbsp; &nbsp; &nbsp; option ifname &quot;ppp0&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; option proto ppp<br />
&nbsp; &nbsp; &nbsp; &nbsp; option device /dev/ttyUSB0<br />
&nbsp; &nbsp; &nbsp; &nbsp; option connect &quot;/usr/sbin/chat -v -f /etc/chatscripts/iplus&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; option disconnect &quot;/usr/sbin/chat -v -f /etc/chatscripts/iplus-off&quot;</div></div>
<p>Aby połączenie to uczynić domyślnym połączeniem WAN zmieniamy linię <em>config interface backup</em> na <em>config interface <strong>wan</strong></em>.</p>
<p>Aby używać zapasowego łącza wydajemy komendy:</p>
<pre>
# ifdown wan
# ifup backup
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/01/huawei-e272-jako-zapasowe-lacze-routera-openwrt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenWRT na miarę naszych możliwości i potrzeb</title>
		<link>http://blog.burghardt.pl/2009/01/openwrt-na-miare-naszych-mozliwosci-i-potrzeb/</link>
		<comments>http://blog.burghardt.pl/2009/01/openwrt-na-miare-naszych-mozliwosci-i-potrzeb/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 16:06:32 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Polish]]></category>
		<category><![CDATA[Asus]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[PPPoA]]></category>
		<category><![CDATA[PSK]]></category>
		<category><![CDATA[QoS]]></category>
		<category><![CDATA[WL-500g]]></category>
		<category><![CDATA[WPA]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=214</guid>
		<description><![CDATA[<p>Ile kosztuje router z 5 portowym zarządzlanym przełącznikiem z obsługą VLAN-ów, Wi-Fi (802.11b/g) z WPA-2 PSK, PPPoA (np. Noestrada), PPPoE (np. Multimo), dwoma portami USB (dyskiem twardym lub flash na USB?), możliwością logowania przez SSH, Firewallem (netfilter/iptables), NAT, QoS (z rozpoznawaniem aplikacji na poziomie warstwy 7), (c&#124;r)torrent, wget, DHCP, DNS z pamięcią podręczną, serwerem WWW [...]]]></description>
			<content:encoded><![CDATA[<p>Ile kosztuje router z 5 portowym zarządzlanym przełącznikiem z obsługą <a href="http://pl.wikipedia.org/wiki/Sieć_wirtualna">VLAN</a>-ów, <a href="http://pl.wikipedia.org/wiki/Wi-Fi">Wi-Fi</a> (802.11b/g) z <a href="http://pl.wikipedia.org/wiki/WPA2">WPA-2 PSK</a>, PPPoA (np. Noestrada), <a href="http://pl.wikipedia.org/wiki/PPPoE">PPPoE</a> (np. Multimo), dwoma portami USB (dyskiem twardym lub flash na USB?), możliwością logowania przez <a href="http://pl.wikipedia.org/wiki/SSH">SSH</a>, Firewallem (netfilter/iptables), <a href="http://pl.wikipedia.org/wiki/NAT">NAT</a>, <a href="http://pl.wikipedia.org/wiki/QoS">QoS</a> (z rozpoznawaniem aplikacji na poziomie <a href="http://l7-filter.sourceforge.net/">warstwy 7</a>), (<a href="http://pl.wikipedia.org/wiki/CTorrent">c</a>|<a href="http://pl.wikipedia.org/wiki/RTorrent">r</a>)<a href="http://pl.wikipedia.org/wiki/BitTorrent">torrent</a>, <a href="http://pl.wikipedia.org/wiki/Wget">wget</a>, <a href="http://pl.wikipedia.org/wiki/Dnsmasq">DHCP, DNS z pamięcią podręczną</a>, serwerem WWW i FTP, <a href="http://www.baseciq.org/2002/01/01/oidentd">oidentd</a> z wsparciem dla NAT i na deser obsługą <a href="http://pl.wikipedia.org/wiki/IPv6">IPv6</a>?</p>
<p>Sprzęt: około 300 złotych. Oprogramowanie: wyłącznie darmowe. Czas instalacji: kilka godzin (najdłuższa część to kompilacja całego systemu operacyjnego i wszystkich pakietów, ale jest ona zautomatyzowana i nie wymaga interwencji użytkownika, a sama instalacja zajmuje kilka minut).</p>
<p><span id="more-214"></span></p>
<h2>Od czego zacząć?</h2>
<p>Zaczynamy od kupna <a href="http://wiki.openwrt.org/TableOfHardware">wspieranego przez OpenWRT routera</a>. Chodzi nam wyłącznie o najlepszy sprzęt. Oprogramowanie wymienimy zaraz po zakupie. Według moich priorytetów najlepszym wyborem jest <a href="http://wiki.openwrt.org/OpenWrtDocs/Hardware/Asus/WL500GP">ASUS WL-500g Premium</a>. Na drugim miejscu uplasował się <a href="http://wiki.openwrt.org/OpenWrtDocs/Hardware/Linksys/WRTSL54GS">Linksys WRTSL54GS</a>.</p>
<h2>Gdy mamy już router</h2>
<p>Możemy zacząć od instalacji OpenWRT w wersji <a href="http://downloads.openwrt.org/whiterussian/">WhiteRussian</a>. Opisywać instalacji i konfiguracji WhiteRussian nie będę, każdy najdzie na <a href="http://wiki.openwrt.org/OpenWrtDocs/WhiteRussian/Distributions">ten temat</a> <a href="http://wiki.openwrt.org/OpenWrtDocs/Installation">wiele</a> <a href="http://wiki.openwrt.org/OpenWrtDocs/WhiteRussian/Configuration">informacji</a>. Jeśli się uda i router spełnia nasze oczekiwania możemy skończyć w tym miejscu. Ale jeśli chcemy skonfigurować router w zupełnie dowolny sposób najlepszym rozwiązaniem jest zbudowanie OpenWRT ze źródeł.</p>
<h2>Oprogramowanie niezbędne do zbudowania OpenWRT</h2>
<p>Do zbudowania OpenWRT w <a href="http://www.debian.org/">Debianie</a> lub <a href="http://www.ubuntu.com/">Ubuntu</a> niezbędne jest posiadanie następujących pakietów:</p>
<pre>
# aptitude install build-essential binutils flex bison autoconf gettext texinfo sharutils subversion libncurses5-dev ncurses-term zlib1g-dev
</pre>
<h2>Źródła z repozytorium Subversion</h2>
<p>Pobieramy źródła OpenWRT z repozytorium Subversion:</p>
<pre>
$ svn co https://svn.openwrt.org/openwrt/trunk/ openwrt-svn
$ svn co https://svn.openwrt.org/openwrt/packages/ openwrt-svn/feeds/packages
</pre>
<p>Następnie tworzymy dowiązania dla pakietów z katalogu <em>feeds</em>:</p>
<pre>
$ make package/symlinks
</pre>
<h2>Konfiguracja obrazu OpenWRT</h2>
<p>Kolejnym krokiem jest konfiguracja obrazu OpenWRT, wybieramy rodzaj obrazu (np. <a href="http://pl.wikipedia.org/wiki/SquashFS">SquashFS</a>), opcje <a href="http://pl.wikipedia.org/wiki/BusyBox">Busybox</a>, <a href="http://pl.wikipedia.org/wiki/Linux">Linuksa</a> i pakietów:</p>
<pre>
$ make menuconfig
</pre>
<h3>Opcje Target System, Profile, Image</h3>
<p>Dla Asusa WL-500gP <em>Target System</em> należy ustawić na <strong>Broadcom BCM947xx/953xx [2.6]</strong> lub <strong>Broadcom BCM947xx/953xx [2.4]</strong>. Opcja ta wybiera linię jądra, odpowiednio 2.6 lub 2.4. Generalnie należy wybrać 2.6. Jeśli 2.6 nie będzie działało kolejnym krokiem będzie wypróbowanie jądra 2.4.</p>
<p>Jako <em>Target Profile</em> wybieramy <strong>Broadcom BCM43xx WiFi (default)</strong>. Jeśli mamy inny rodzaj kontrolera sieci bezprzewodowej wybieramy właściwą opcję. Przydatne jeśli wymieniliśmy kartę <a href="http://pl.wikipedia.org/wiki/MiniPCI">MiniPCI</a> w routerze np. na opartą na kontrolerze Atheros.</p>
<p><em>Target Images</em> definiuje rodzaj systemu plików używanego jako <strong>/</strong>. Najlepszym wyborem jest <strong>squashfs</strong> zapewniający wyższy stopień kompresji niż <strong>jffs2</strong>. Drugą ważną różnicą jest to, iż jffs2 umożliwia zapis, a squashfs jest tylko do odczytu. Jeśli wybierzemy squashfs na główny system plików, na routerze zostanie stworzony obszar przeznaczony do zapisywania danych w formacie jffs2.</p>
<h3>Advanced configuration options (for developers)</h3>
<p>W menu <em>Build Options</em> wybrałem opcje <strong>Clean all ipkg files before building the rootfs</strong> oraz <strong>Use ccache</strong>. Pierwsza powoduje przebudowanie wszystkich pakietów za każdym razem, a druga włącza użycie pamięci podręcznej dla plików obiektów. program <a href="http://ccache.samba.org/">ccache</a> przyspiesza kompilację w przypadku budowania OpenWRT po raz kolejny, z niewielkimi zmianami w stosunku do poprzedniej konfiguracji.</p>
<p>Natomiast w menu <em>Toolchain Options</em> zaznaczyłem <strong>Enable Smash Stacking Protection support</strong>, która (przynajmniej teoretycznie) powinna utrudniać wykonywanie kodu przez <a href="http://pl.wikipedia.org/wiki/Przepełnienie_bufora">przepełnienie bufora</a>. Podnosi to (nieco) poziom bezpieczeństwa w przypadku próby wykorzystania przez atakującego tego typu błędów.</p>
<h3>Wybór pakietów</h3>
<p>Wybór pakietów jest najdłuższą czynnością. Na szczęście dla większości pakietów dostępny jest krótki opis. Mój <a href="http://www.burghardt.pl/files/openwrt-hurricane.config">plik konfiguracyjny dla ASUS WL-500g Premium</a> umieściłem tutaj jako referencję. Może on być użyty jako baza do dalszych eksperymentów albo bezpośrednio do zbudowania OpenWRT w wersji r13858.</p>
<h3>Zmiana limitu wielkości dla rootfs</h3>
<p>Domyślny limit wielkości obszaru rootfs jest zdefiniowany w <em>tools/firmware-utils/src/trx.c</em> i wynosi 0x5A0000 (<a href="https://dev.openwrt.org/ticket/2626">większość routerów ma mniej pamięci flash niż WL500GP</a>). W moim przypadku było to zbyt mało aby pomieścić wszystkie aplikacje, a ponieważ router bezproblemowo obsługuje większe rozmiary rootfs powiększyłem rootfs o 1MB. Poniżej patch:</p>
<div class="codecolorer-container diff default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="diff codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Index: tools/firmware-utils/src/trx.c<br />
===================================================================<br />
<span style="color: #888822;">--- tools/firmware-utils/src/trx.c &nbsp; &nbsp; &nbsp;<span style="">&#40;</span>wersja 13876<span style="">&#41;</span></span><br />
<span style="color: #888822;">+++ tools/firmware-utils/src/trx.c &nbsp; &nbsp; &nbsp;<span style="">&#40;</span>kopia robocza<span style="">&#41;</span></span><br />
<span style="color: #440088;">@@ -60,7 +60,7 @@</span><br />
<br />
&nbsp;#define TRX_MAGIC &nbsp; &nbsp; &nbsp;0x30524448 &nbsp; &nbsp; &nbsp;/* &quot;HDR0&quot; */<br />
&nbsp;#define TRX_VERSION &nbsp; &nbsp;<span style="">1</span><br />
<span style="color: #991111;">-#define TRX_MAX_LEN &nbsp; &nbsp;0x5A0000</span><br />
<span style="color: #00b000;">+#define TRX_MAX_LEN &nbsp; &nbsp;0x6A0000</span><br />
&nbsp;#define TRX_NO_HEADER &nbsp;<span style="">1</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* Do not write TRX header */<br />
<br />
&nbsp;struct trx_header <span style="">&#123;</span></div></div>
<h3>Sprzętowo wspomagana biblioteka OpenSSL</h3>
<p>Jeśli router posiada <strong>Sonics Silicon Backplane</strong> (ssb) i rdzeń IPSEC (<strong>Core 7 found: IPSEC (cc 0x80B, rev 0&#215;00, vendor 0&#215;4243)</strong>) warto w pliku <em>.config</em> włączyć:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">CONFIG_PACKAGE_kmod-crypto-ocf=y<br />
CONFIG_PACKAGE_kmod-ocf-ubsec-ssb=y<br />
CONFIG_PACKAGE_ocf-crypto-headers=y</div></div>
<p>Oraz dodać do biblioteki OpenSSL opcję włączającą wsparcie dla <a href="http://ocf-linux.sourceforge.net/">OCF</a>:</p>
<div class="codecolorer-container diff default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="diff codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Index: package/openssl/Makefile<br />
===================================================================<br />
<span style="color: #888822;">--- package/openssl/Makefile &nbsp; &nbsp;<span style="">&#40;</span>wersja 13876<span style="">&#41;</span></span><br />
<span style="color: #888822;">+++ package/openssl/Makefile &nbsp; &nbsp;<span style="">&#40;</span>kopia robocza<span style="">&#41;</span></span><br />
<span style="color: #440088;">@@ -81,6 +81,8 @@</span><br />
&nbsp;define Build/Configure<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="">&#40;</span>cd $<span style="">&#40;</span>PKG_BUILD_DIR<span style="">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ./Configure linux-openwrt<br />
<span style="color: #00b000;">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --with-cryptodev</span><br />
<span style="color: #00b000;">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --with-cryptodev-digests</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --prefix=/usr<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --openssldir=/etc/ssl<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="">&#40;</span>TARGET_CPPFLAGS<span style="">&#41;</span></div></div>
<p>Aplikacje używające libssl powinny teraz korzystać ze sprzętowej akceleracji operacji szyfrowania i haszowania. Aplikacje takie to m.in.: <a href="http://openvpn.net/">OpenVPN</a>, <a href="http://libtorrent.rakshasa.no/">rTorrent</a> i <a href="http://www.gnu.org/software/wget/">wget</a>. <a href="http://matt.ucc.asn.au/dropbear/dropbear.html">Dropbear</a> (domyślny serwer SSH w OpenWRT) nie korzysta z OpenSSL i dlatego nie jest wspomagany sprzętowo.</p>
<h2>Budowanie OpenWRT</h2>
<p>Aby pobrać wszystkie niezbędne do zbudowania OpenWRT pliki wydajemy polecenie (jeśli tego nie zrobimy pliki będą pobierane przed budowaniem każdego pakietu):</p>
<pre>
$ make download
</pre>
<p>Gdy wszystko jest już skonfigurowane wydajemy polecenie:</p>
<pre>
$ make world
</pre>
<p>W zależności od ilości wybranych pakietów, mocy obliczeniowej procesora i ilości pamięci RAM zbudowanie wszystkiego zajmie od kilku do kilkudziesięciu minut. Włączenie ccache przyspiesza budowanie w momencie gdy wprowadzimy niewielkie zmiany w konfiguracji i budujemy OpenWRT po raz kolejny.</p>
<h2>Instalacja OpenWRT na routerze</h2>
<p>Ta czynność jest bardzo prosta w przypadku WL-500gP. Po odłączeniu routera od zasilania wciskamy i trzymamy przycisk <strong>reset</strong>. Trzymając reset podłączamy zasilanie. Gdy dioda informująca o stanie zasilania zacznie migać zwalniamy przycisk reset. Podłączamy kabel Ethernet do portu LAN routera i do komputera.</p>
<p>Ustawiamy adres IP na interfejsie eth0:0 za pomocą komendy:</p>
<pre>
# ifconfig eth0:0 192.168.1.5 up
</pre>
<p>A następnie przechodzimy do katalogu <em>bin</em> i wydajemy polecenie:</p>
<pre>
$ atftp --trace --option "timeout 1" --option "mode octet" --put --local-file openwrt-brcm47xx-squashfs.trx 192.168.1.1
</pre>
<p>Czekamy do zakończenia kopiowania pliku. Po zakończeniu sesji tftp czekamy około 5 minut na zapisanie obrazu OpenWRT w pamięci flash i odłączamy zasilanie. Po ponownym podłączeniu zasilania router będzie bardzo długo startował ze względu na konieczność utworzenia obszaru <em>jffs2</em> i wygenerowania kluczy SSH routera.</p>
<h2>Konfiguracja OpenWRT</h2>
<p>Łączymy się z routerem za pomocą telnetu:</p>
<pre>
$ telnet 192.168.1.1
</pre>
<p>Następnie ustawiamy hasło:</p>
<pre>
# passwd
</pre>
<p>Ustawienie hasła uniemożliwia dalsze logowanie przez telnet. Od tej chwili należy używać wyłącznie SSH. Wylogowujemy się z routera i logujemy za pomocą SSH:</p>
<pre>
$ ssh root@192.168.1.1
</pre>
<h3>Wyłączanie niepotrzebnych usług</h3>
<p>Jeśli nie zamierzamy korzystać z serwera telnet i http możemy je wyłączyć:</p>
<pre>
# /etc/init.d/telnet disable
# /etc/init.d/httpd disable
</pre>
<h3>Nazwa hosta i strefa czasowa</h3>
<p>W <em>/etc/config/system</em> ustawiamy:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">config system<br />
&nbsp; &nbsp; &nbsp; &nbsp; option hostname myrouter<br />
&nbsp; &nbsp; &nbsp; &nbsp; option timezone &quot;CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00&quot;</div></div>
<h3>Dropbear</h3>
<p>Aby włączyć logowanie wyłącznie za pomocą kluczy SSH zapisujemy w <em>/etc/dropbear/authorized_keys</em> nasz klucz publiczny, a następnie w <em>/etc/config/dropbear</em> ustawiamy:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; option PasswordAuth 'off'</div></div>
<h3>QoS</h3>
<p>Ustawiamy w <em>/etc/config/qos</em> przepływność interfejsu WAN:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">option upload 256<br />
option download 1024</div></div>
<p>Na początek pozostałe opcje warto pozostawić bez zmian.</p>
<h3>Thomson SpeedTouch 330, PPPoA i Neostrada</h3>
<p><a href="http://pl.wikipedia.org/wiki/Thomson_SpeedTouch_330">Thomson SpeedTouch 330</a> otrzymany od TP za 1 zł jest obsługiwany przez Linuksa. Pakiet z firmware również jest obecny w OpenWRT.</p>
<p>W przypadku <a href="http://pl.wikipedia.org/wiki/SAGEM_F@st_800">SAGEM F@st 800</a> OpenWRT posiada jedynie sterownik. Firmware należy skopiować ręcznie do katalogu <em>/lib/firmware/ueagle-atm</em> po zainstalowaniu OpenWRT.</p>
<p>Aby sprawdzić, czy po podłączeniu do portu USB routera modem został wykryty, oprogramowanie firmware załadowane, a synchronizacja ukończona pomyślnie wydajemy polecenie <strong>dmesg | tail</strong>. Powinniśmy zobaczyć taki komunikat:</p>
<pre>
speedtch 2-1:1.0: found stage 1 firmware speedtch-1.bin.4
speedtch 2-1:1.0: found stage 2 firmware speedtch-2.bin.4

ATM dev 0: ADSL line is synchronising
ATM dev 0: ADSL line is up (1312 kb/s down | 320 kb/s up)
</pre>
<p>Modem jest gotowy i możemy skonfigurować połączenie <a href="http://pl.wikipedia.org/wiki/PPP">PPP</a>. W tym celu ustawiamy w pliku <em>/etc/config/network</em> w sekcji <strong>WAN configuration</strong>:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">config interface &nbsp; &nbsp; &nbsp; &nbsp;wan<br />
&nbsp; &nbsp; &nbsp; &nbsp; option ifname &nbsp; &quot;ppp0&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; option proto &nbsp; &nbsp;pppoa<br />
&nbsp; &nbsp; &nbsp; &nbsp; option encaps &nbsp; llc<br />
&nbsp; &nbsp; &nbsp; &nbsp; option vpi &nbsp; &nbsp; &nbsp;0<br />
&nbsp; &nbsp; &nbsp; &nbsp; option vci &nbsp; &nbsp; &nbsp;35<br />
&nbsp; &nbsp; &nbsp; &nbsp; option username &quot;XXXXXXX@neostrada.pl&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; option password &quot;XXXXXXXX&quot;</div></div>
<p>Aby nawiązać połączenie używamy:</p>
<pre>
# ifup wan
</pre>
<h3>IPv6</h3>
<p>Opcje połączenia IPv6 przez tunel w <a href="http://www.sixxs.net/">SixXS</a> definiujemy w <em>/etc/config/aiccu</em>. Konfiguracja <a href="http://www.litech.org/radvd/">radvd</a> znajduje się w <em>/etc/config/radvd</em>.</p>
<h3>OpenDNS</h3>
<p>Konfigurację <a href="/2009/01/openwrt-meets-opendns/">OpenDNS na OpenWRT</a> opisałem już wcześniej.</p>
<h2>Gdy 8MB pamięci flash to zbyt mało&#8230;</h2>
<p>Można do portu USB podłączyć dysk twardy USB lub bezgłośny Pendrive na którym można przechowywać pliki pobierane z Internetu. Można na nim również stworzyć partycję wymiany (co przyda się gdy będziemy chcieli uruchamiać więcej programów).</p>
<p>Konfiguracja dodatkowych nośników danych jest przechowywana w <em>/etc/config/fstab</em>. Przykładowa konfiguracja z pratycją <em>/home</em> na pliki uzytkownika, <em>/opt</em> na dodatkowe, niemieszczące się w pamięci flash routera aplikacje oraz partycją swap:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">config mount home<br />
&nbsp; &nbsp; &nbsp; &nbsp; option target &nbsp; /home<br />
&nbsp; &nbsp; &nbsp; &nbsp; option device &nbsp; /dev/sda1<br />
&nbsp; &nbsp; &nbsp; &nbsp; option fstype &nbsp; ext3<br />
&nbsp; &nbsp; &nbsp; &nbsp; option options &nbsp;rw<br />
<br />
config mount opt<br />
&nbsp; &nbsp; &nbsp; &nbsp; option target &nbsp; /opt<br />
&nbsp; &nbsp; &nbsp; &nbsp; option device &nbsp; /dev/sda2<br />
&nbsp; &nbsp; &nbsp; &nbsp; option fstype &nbsp; ext3<br />
&nbsp; &nbsp; &nbsp; &nbsp; option options &nbsp;rw<br />
<br />
config swap<br />
&nbsp; &nbsp; &nbsp; &nbsp; option device &nbsp; /dev/sda3</div></div>
<h3>opkg-link</h3>
<p>Aby móc instalować pakiety na zewnętrznej pamięci dodajemy do <em>/etc/opkg.conf</em> linię:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dest usb /opt</div></div>
<p>Pakiety instalujemy na dysku USB poleceniem:</p>
<pre>
# opkg -d usb install nazwa_pakietu
</pre>
<p>Aby dodać link do pakietu w <em>/opt</em> w <em>/</em> możemy użyć skryptu opkg-link. Możemy go skopiować z <a href="http://wiki.openwrt.org/UsbStorageHowto">UsbStorageHowto</a> i zapisać jako <em>/bin/opkg-link</em>.</p>
<h2>Podsumowanie</h2>
<p>Nieźle jak na sprzęt za niecałe 400 zł (~300 zł router, 80 zł pendrive, 1zł modem DSL), co?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/01/openwrt-na-miare-naszych-mozliwosci-i-potrzeb/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>OpenWRT meets OpenDNS</title>
		<link>http://blog.burghardt.pl/2009/01/openwrt-meets-opendns/</link>
		<comments>http://blog.burghardt.pl/2009/01/openwrt-meets-opendns/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 00:52:52 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[OpenDNS]]></category>
		<category><![CDATA[OpenWRT]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=209</guid>
		<description><![CDATA[<p>To make whole home network use OpenDNS I need to change only 3 files on my OpenWRT router.</p> First step &#8211; resolv.conf <p>Create /etc/resolv.conf.opendns with OpenDNS servers addresses, eg:</p> nameserver 208.67.222.222 nameserver 208.67.220.220 <p>Make sure /etc/resolv.conf defines 127.0.0.1 as a name server.</p> Second step &#8211; dnsmasq <p>In /etc/config/dhcp set resolvfile variable:</p> option resolvfile '/etc/resolv.conf.opendns' <p>Restart [...]]]></description>
			<content:encoded><![CDATA[<p>To make whole home network use <a href="http://www.opendns.com/">OpenDNS</a> I need to change only 3 files on my <a href="http://www.openwrt.org/">OpenWRT</a> <a href="http://en.wikipedia.org/wiki/Router">router</a>.</p>
<h3>First step &#8211; resolv.conf</h3>
<p>Create <em>/etc/resolv.conf.opendns</em> with OpenDNS servers addresses, eg:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nameserver 208.67.222.222<br />
nameserver 208.67.220.220</div></div>
<p>Make sure <em>/etc/resolv.conf</em> defines 127.0.0.1 as a name server.</p>
<h3>Second step &#8211; dnsmasq</h3>
<p>In <em>/etc/config/dhcp</em> set resolvfile variable:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">option resolvfile '/etc/resolv.conf.opendns'</div></div>
<p>Restart <a href="http://en.wikipedia.org/wiki/Dnsmasq">dnsmasq</a> with:</p>
<pre>
# /etc/init.d/dnsmasq restart
</pre>
<p><span id="more-209"></span></p>
<h3>Third step &#8211; /etc/hotplug.d/iface</h3>
<p>This step is only needed if you have a <a href="http://en.wikipedia.org/wiki/IP_address#Static_and_dynamic_IP_addresses">dynamic IP address</a> and you want to use advanced OpenDNS features (like content filters or statistics).</p>
<p>Create file <em>/etc/hotplug.d/iface/40-opendns</em> with command similar to this:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<br />
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${ACTION:-ifup}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">ifup</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; logger <span style="color: #660033;">-t</span> opendns <span style="color: #000000; font-weight: bold;">`</span>curl <span style="color: #660033;">-k</span> <span style="color: #660033;">-u</span> username:password https:<span style="color: #000000; font-weight: bold;">//</span>updates.opendns.com<span style="color: #000000; font-weight: bold;">/</span>nic<span style="color: #000000; font-weight: bold;">/</span>update?<span style="color: #007800;">hotsname</span>=NetworkName<span style="color: #000000; font-weight: bold;">`</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">;;</span><br />
<span style="color: #000000; font-weight: bold;">esac</span></div></div>
<p>Note that you need curl built with (libopen)ssl.</p>
<p>Test hotplug script with:</p>
<pre>
# ifdown wan
# ifup wan
</pre>
<p>Then check log with:</p>
<pre>
# logread | tail
</pre>
<p>If script work you will see a message like:</p>
<pre>
Jan  4 01:13:27 hurricane user.notice opendns: good 83.10.94.104
</pre>
<p>Finally go to <a href="http://www.opendns.com">OpenDNS</a>. If everything is fine you should find green &#8220;You&#8217;re using OpenDNS!&#8221; in the right corner. In &#8220;Dashboard > Networks&#8221; you should find entry for NetworkName with your current IP and message &#8220;(your current IP)&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/01/openwrt-meets-opendns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

