<?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>Robert Penz Blog</title>
	<atom:link href="http://robert.penz.name/feed/" rel="self" type="application/rss+xml" />
	<link>http://robert.penz.name</link>
	<description>About Linux, IT security,tips and tricks and otherstuff that comes into my mind</description>
	<lastBuildDate>Fri, 20 Jan 2012 15:34:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Howto fix W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures were invalid: BADSIG C2518248EEA14886 Launchpad?</title>
		<link>http://robert.penz.name/376/howto-fix-w-gpg-error-httpppa-launchpad-net-oneiric-release-the-following-signatures-were-invalid-badsig-c2518248eea14886-launchpad/</link>
		<comments>http://robert.penz.name/376/howto-fix-w-gpg-error-httpppa-launchpad-net-oneiric-release-the-following-signatures-were-invalid-badsig-c2518248eea14886-launchpad/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 15:34:52 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=376</guid>
		<description><![CDATA[Today I ran into the problem that my Ubuntu 11.10 (Oneiric) show following error message while trying apt-get update: Fetched 16.3 MB in 34s (473 kB/s) Reading package lists... Done W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures were invalid: BADSIG C2518248EEA14886 Launchpad VLC W: A error occurred during the signature verification. The repository [...]]]></description>
			<content:encoded><![CDATA[<p>Today I ran into the problem that my Ubuntu 11.10 (Oneiric) show following error message while trying <code>apt-get update</code>:</p>
<p><code><br />
Fetched 16.3 MB in 34s (473 kB/s)</code><br />
<code><br />
Reading package lists... Done<br />
W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures were invalid: BADSIG C2518248EEA14886 Launchpad VLC<br />
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://extras.ubuntu.com oneiric Release: The following signatures were invalid: BADSIG 16126D3A3E5C1192 Ubuntu Extras Archive Automatic Signing Key <ftpmaster @ubuntu.com><br />
</ftpmaster></code><code><br />
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/oneiric/Release<br />
</code><code><br />
W: Some index files failed to download. They have been ignored, or old ones used instead.<br />
</code></p>
<p>I did following to fix it. Maybe it helps you too.<br />
<code><br />
apt-get clean<br />
cd /var/lib/apt<br />
mv lists lists.old<br />
mkdir -p lists/partial<br />
apt-get clean<br />
apt-get update<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/376/howto-fix-w-gpg-error-httpppa-launchpad-net-oneiric-release-the-following-signatures-were-invalid-badsig-c2518248eea14886-launchpad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A1 Telekom Austria Internet via UMTS seems to have a forced disconnet every 8h</title>
		<link>http://robert.penz.name/373/a1-telekom-austria-internet-via-umts-seems-to-have-a-forced-disconnet-every-8h/</link>
		<comments>http://robert.penz.name/373/a1-telekom-austria-internet-via-umts-seems-to-have-a-forced-disconnet-every-8h/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 14:10:31 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Austria]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=373</guid>
		<description><![CDATA[I think it is well known that the DSL Internet plans from A1 Telekom Austria for private user (= not the more expensive business plans) have a forced 8h disconnect. I searched the Internet to check if it is the same for there UMTS USB sticks, and couldn&#8217;t find anything &#8211; seems that nobody cares [...]]]></description>
			<content:encoded><![CDATA[<p>I think it is well known that the DSL Internet plans from A1 Telekom Austria for private user (= not the more expensive business plans) have a forced 8h disconnect. I searched the Internet to check if it is the same for there UMTS USB sticks, and couldn&#8217;t find anything &#8211; seems that nobody cares or tried it. So I put the USB Stick into my server and let it run for a week now, and I can say now: Yes, there is a forced disconnect normally every 8h &#8230; but sometimes they seem to miss it. Take a look at the last few days &#8211; I did a grep on the connect time and the pid of the umts pppd:</p>
<p><code><br />
# cat /var/log/messages | grep "Connect time" | grep "9069"</p>
<p>Dec 27 20:56:17 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 28 04:56:53 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 28 12:57:00 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 28 20:57:05 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 29 04:57:42 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 29 12:57:49 xxx pppd[9069]: Connect time 480.1 minutes.<br />
Dec 29 22:20:09 xxx pppd[9069]: Connect time 561.8 minutes.<br />
Dec 30 06:20:44 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 30 14:23:20 xxx pppd[9069]: Connect time 482.5 minutes.<br />
Dec 30 22:05:07 xxx pppd[9069]: Connect time 461.7 minutes.<br />
Dec 31 06:05:44 xxx pppd[9069]: Connect time 480.0 minutes.<br />
Dec 31 14:06:21 xxx pppd[9069]: Connect time 480.1 minutes.<br />
</code></p>
<p>ps: 480min = 8h</p>
<p>Somebody knows why they are missing some disconnect times? Maybe it is traffic related &#8211; I try to make some traffic every few seconds on the link to verify that. </p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/373/a1-telekom-austria-internet-via-umts-seems-to-have-a-forced-disconnet-every-8h/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Idle SL/Centos machine in KVM leads to 5 Watt more power usage</title>
		<link>http://robert.penz.name/367/idle-slcentos-machine-in-kvm-leads-to-5-watt-more-power-usage/</link>
		<comments>http://robert.penz.name/367/idle-slcentos-machine-in-kvm-leads-to-5-watt-more-power-usage/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 10:52:31 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=367</guid>
		<description><![CDATA[My home server needs in idle state less than 25 Watt (Intel Core i3-2100, SSD for the system, 2TB HD) but as soon as a KVM machine runs I need 30 Watt. It does not matter if the virtual machine is idle. As guest I&#8217;ve a RHEL6 Clone (Scientific Linux) running with the virtualization modules [...]]]></description>
			<content:encoded><![CDATA[<p>My home server needs in idle state less than 25 Watt (Intel Core i3-2100, SSD for the system, 2TB HD) but as soon as a KVM machine runs I need 30 Watt. It does not matter if the virtual machine is idle. As guest I&#8217;ve a RHEL6 Clone (Scientific Linux) running with the virtualization modules loaded:</p>
<p><code><br />
# lsmod | grep virt<br />
virtio_balloon 4281 0<br />
virtio_net 15741 0<br />
virtio_blk 5692 3<br />
virtio_pci 6653 0<br />
virtio_ring 7169 4 virtio_balloon,virtio_net,virtio_blk,virtio_pci<br />
virtio 4824 4 virtio_balloon,virtio_net,virtio_blk,virtio_pci<br />
</code></p>
<p>But take a look at the screenshots &#8211; the first without running KVM virtual machine &#8230;</p>
<p><img class="aligncenter size-full wp-image-368" title="powertop1" src="http://robert.penz.name/wp-content/uploads/2011/12/powertop1.png" alt="" width="649" height="497" /></p>
<p>&#8230; and as you see the CPU is 98% of the time in C3 (lowest power consumption). And flowing screenshot shows the same computer after starting a KVM virtual maschine and waiting some minutes to settle &#8230;.</p>
<p><img class="aligncenter size-full wp-image-369" title="powertop2" src="http://robert.penz.name/wp-content/uploads/2011/12/powertop2.png" alt="" width="631" height="497" /></p>
<p>&#8230; and now we&#8217;re 20% in C1 and only 75% in C3, and the reason with the highest percentage is qemu-kvm.</p>
<p>Now you ask how I know the power usage increase by 5 Watt? I have have a Watt-meter connected between the power outlet and the computer to measure the power usage.</p>
<p>Anyway, I currently don&#8217;t have a solution for this, maybe a reader has.</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/367/idle-slcentos-machine-in-kvm-leads-to-5-watt-more-power-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A1 Telekom Austria uses internal IPs (10.x.x.x) for traffic between UMTS and DSL</title>
		<link>http://robert.penz.name/360/a1-telekom-austria-uses-internal-ips-10-x-x-x-for-traffic-between-umts-and-dsl/</link>
		<comments>http://robert.penz.name/360/a1-telekom-austria-uses-internal-ips-10-x-x-x-for-traffic-between-umts-and-dsl/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 10:13:59 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Austria]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=360</guid>
		<description><![CDATA[When I tried to connect from my mobile phone to my DSL router at home and had tcpdump running on the router at the same time I though there is something wrong. I saw connection requests from an 10.62.35.x IP address from the Internet. My router was of course dropping these packets, as this IP [...]]]></description>
			<content:encoded><![CDATA[<p>When I tried to connect from my mobile phone to my DSL router at home and had tcpdump running on the router at the same time I though there is something wrong. I saw connection requests from an 10.62.35.x IP address from the Internet. My router was of course dropping these packets, as this IP address cannot arrive on the Internet uplink interface.</p>
<p>After some checking I realized that my mobile phone is the 10.62.35.x source address, and I needed to accept packets from on the Internet with the source address within the range of 10.62.0.0/16. It is good that I don&#8217;t use 10.62.0.0/16 subnets at home &#8230;. but if someone does, he has a problem. <img src='http://robert.penz.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Anyway has anyone more information which 10.x.x.x IP addresses the A1 Telekom Austria (and Bob for my mobile) does use?</p>
<p>ps: The DSL router has a worldwide IP address but the mobile IP is local, surely to force businesses into more expensive plans to have a worldwide IP address. <img src='http://robert.penz.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/360/a1-telekom-austria-uses-internal-ips-10-x-x-x-for-traffic-between-umts-and-dsl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix the font for virt-manager via X forwarding</title>
		<link>http://robert.penz.name/354/how-to-fix-the-font-for-virt-manager-via-x-forwarding/</link>
		<comments>http://robert.penz.name/354/how-to-fix-the-font-for-virt-manager-via-x-forwarding/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 13:29:22 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=354</guid>
		<description><![CDATA[I&#8217;ve installed the virt-manager on one of my servers (RHEL/Centos/SL) and tried to access the virt-manager via X forwarding but I just got following: Other programs like xclock or xterm worked without problem .. after some searching and debugging I solved the problem with following command: yum install dejavu-lgc-sans-fonts Hope this solution spares someone-other some [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve installed the virt-manager on one of my servers (RHEL/Centos/SL) and tried to access the virt-manager via X forwarding but I just got following:</p>
<p><img class="size-full wp-image-355 aligncenter" title="virt-manager" src="http://robert.penz.name/wp-content/uploads/2011/12/virt-manager.png" alt="" width="698" height="583" /></p>
<p>Other programs like xclock or xterm worked without problem .. after some searching and debugging I solved the problem with following command:<br />
<code><br />
yum install dejavu-lgc-sans-fonts<br />
</code></p>
<p>Hope this solution spares someone-other some minutes. <img src='http://robert.penz.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/354/how-to-fix-the-font-for-virt-manager-via-x-forwarding/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Teamspeak 3 Client on Kubuntu 11.10 (oneiric)</title>
		<link>http://robert.penz.name/348/teamspeak-3-client-on-kubuntu-11-10/</link>
		<comments>http://robert.penz.name/348/teamspeak-3-client-on-kubuntu-11-10/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 11:44:20 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=348</guid>
		<description><![CDATA[When you download the TeamSpeak3-Client-linux_*.run (tested with TeamSpeak3-Client-linux_amd64-3.0.2.run) file, extract everything and try to start the TS3 client with ./ts3client_runscript.sh on Kubuntu 11.10 you&#8217;ll get following error message: $ ./ts3client_runscript.sh Cannot mix incompatible Qt library (version 0x40704) with this library (version 0x40702) ./ts3client_runscript.sh: line 18: 2638 Aborted ./ts3client_linux_amd64 $@ To fix this you need to [...]]]></description>
			<content:encoded><![CDATA[<p>When you download the TeamSpeak3-Client-linux_*.run (tested with <code>TeamSpeak3-Client-linux_amd64-3.0.2.run</code>) file, extract everything and try to start the TS3 client with <code>./ts3client_runscript.sh</code> on Kubuntu 11.10 you&#8217;ll get following error message:</p>
<p><code><br />
$ ./ts3client_runscript.sh<br />
Cannot mix incompatible Qt library (version 0x40704) with this library (version 0x40702)<br />
./ts3client_runscript.sh: line 18: 2638 Aborted ./ts3client_linux_amd64 $@<br />
</code></p>
<p>To fix this you need to do following (found the hint <a href="http://forum.teamspeak.com/showthread.php/53169-latest-TS3-update-caused-it-to-FAIL/page2" target="_blank">here</a>):</p>
<ul>
<li>Add following<code><br />
export QTDIR="."<br />
export KDEDIRS=""<br />
export KDEDIR=""<br />
</code><br />
at line 5 in <code>ts3client_runscript.sh</code></li>
<li>create a file <code>qt.conf</code> with following content<code><br />
[Paths]<br />
Plugins = plugins<br />
</code></li>
</ul>
<p>Hope this works for you too.</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/348/teamspeak-3-client-on-kubuntu-11-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Howto copy files from a damaged hard disk with Linux</title>
		<link>http://robert.penz.name/338/howto-copy-files-from-a-damaged-hard-disk-with-linux/</link>
		<comments>http://robert.penz.name/338/howto-copy-files-from-a-damaged-hard-disk-with-linux/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 17:36:47 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=338</guid>
		<description><![CDATA[I just got a hard disk which had bad blocks to try to rescue files, but which was too big to use dd_rescue to copy the whole partition on any other hard disk I had, before extracting the files. But in this case the file system directory structure was still readable, so I was able [...]]]></description>
			<content:encoded><![CDATA[<p>I just got a hard disk which had bad blocks to try to rescue files, but which was too big to use dd_rescue to copy the whole partition on any other hard disk I had, before extracting the files. But in this case the file system directory structure was still readable, so I was able to use following method, which maybe helps someone else.</p>
<p>I mounted the file system read only with following <code>mount -r /dev/sdb1 /mnt</code> and than I created 2 shell scripts.</p>
<p>First File:<br />
<code><br />
#!/bin/bash<br />
cd /mnt/damagedHD/<br />
mkdir /mnt/dirForExtractedFiles/<br />
find . -type d -exec mkdir /mnt/dirForExtractedFiles/{} \;<br />
find . -type f -exec /path2secondscript/rescue_copy.sh {} \;<br />
</code></p>
<p>Second File:<br />
<code><br />
#!/bin/bash<br />
if [ ! -f "/mnt/dirForExtractedFiles/$1" ]<br />
then<br />
  dd_rescue "$1" "/mnt/dirForExtractedFiles/$1"<br />
fi<br />
</code></p>
<p>I use 2 scripts as sometimes the hard disk runs into a problem and than stops working until it is powered down and up again. In this case I use CRTL-C to break the loop followed by commenting the first 3 commands in the first file out, and than start it again after the harddisk is mounted again. The &#8220;if&#8221;-query in the second file makes sure we won&#8217;t try files which we already have or the one which lead to the error in the first place.</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/338/howto-copy-files-from-a-damaged-hard-disk-with-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eAccelerator and the &#8220;open_basedir restriction in effect. File() is not within the allowed path(s)&#8221; problem</title>
		<link>http://robert.penz.name/334/eaccelerator-and-the-open_basedir-restriction-in-effect-file-is-not-within-the-allowed-paths-problem/</link>
		<comments>http://robert.penz.name/334/eaccelerator-and-the-open_basedir-restriction-in-effect-file-is-not-within-the-allowed-paths-problem/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 19:20:04 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=334</guid>
		<description><![CDATA[This blog post should guard other admins from searching for hours about following error message: require(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/domains/xxxxxxxx/html/:/var/www/xxxxxxxx/include/:/var/www/domains/xxxxxxxx/tmp/) in '/var/www/domains/xxxxxxxx/html/core/Translate.php' at the line 81 #0 Piwik_ErrorHandler(2, require(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/domains/xxxxxxxx/html/:/var/www/xxxxxxxx/include/:/var/www/domains/xxxxxxxx/tmp/), /var/www/domains/xxxxxxxx/html/core/Translate.php, 81, Array ([language] =&#62; en,[path] [...]]]></description>
			<content:encoded><![CDATA[<p>This blog post should guard other admins from searching for hours about following error message:</p>
<p><code><br />
require(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/domains/xxxxxxxx/html/:/var/www/xxxxxxxx/include/:/var/www/domains/xxxxxxxx/tmp/)<br />
in '/var/www/domains/xxxxxxxx/html/core/Translate.php' at the line 81</code></p>
<p><code><br />
#0  Piwik_ErrorHandler(2, require(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/domains/xxxxxxxx/html/:/var/www/xxxxxxxx/include/:/var/www/domains/xxxxxxxx/tmp/), /var/www/domains/xxxxxxxx/html/core/Translate.php, 81, Array ([language] =&gt; en,[path] =&gt; /var/www/domains/xxxxxxxx/html/lang/en.php)) called at [/var/www/domains/xxxxxxxx/html/core/Translate.php:81]<br />
#1  Piwik_Translate::loadTranslation() called at [/var/www/domains/xxxxxxxx/html/core/Translate.php:81]<br />
#2  Piwik_Translate-&gt;loadTranslation(en) called at [/var/www/domains/xxxxxxxx/html/core/Translate.php:35]<br />
#3  Piwik_Translate-&gt;loadEnglishTranslation() called at [/var/www/domains/xxxxxxxx/html/core/FrontController.php:197]<br />
#4  Piwik_FrontController-&gt;init() called at [/var/www/domains/xxxxxxxx/html/index.php:56]<br />
</code></p>
<p>I got it when I tried to install <a href="http://piwik.org/">Piwik</a>. I tried everything including setting setting open_basedir to /. It stopped working if I activated the basedir protection and started working if I removed it. After hours searching I found it. I looked into the wrong direction &#8211; the problem was not php but eAccelerator. After I found that out it was easy to get to the solution, you need to compile it with the option <code>--without-eaccelerator-use-inode</code>, e.g.this way:</p>
<p><code><br />
VERSION=0.9.6.1<br />
URL=http://bart.eaccelerator.net/source/$VERSION/eaccelerator-$VERSION.tar.bz2<br />
</code><br />
<code><br />
cd /tmp/<br />
rm -rf eaccelerator-$VERSION<br />
wget $URL<br />
tar xvjf eaccelerator-$VERSION.tar.bz2<br />
cd eaccelerator-$VERSION<br />
phpize<br />
./configure --enable-eaccelerator=shared --without-eaccelerator-use-inode<br />
make<br />
make install<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/334/eaccelerator-and-the-open_basedir-restriction-in-effect-file-is-not-within-the-allowed-paths-problem/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Howto connect multiple networks over the Internet the cheap way</title>
		<link>http://robert.penz.name/312/howto-connect-multiple-networks-over-the-internet-the-cheap-way/</link>
		<comments>http://robert.penz.name/312/howto-connect-multiple-networks-over-the-internet-the-cheap-way/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 18:56:57 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=312</guid>
		<description><![CDATA[I&#8217;m quit often asked by 2 types of people how to connect cheaply multiple networks securely over the Internet. The first type are owners of small companies which have more than one office and want to connect them to their central office. And the other type are people who are the de facto IT guy [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m quit often asked by 2 types of people how to connect cheaply multiple networks securely over the Internet. The first type are owners of small companies which have more than one office and want to connect them to their central office. And the other type are people who are the de facto IT guy for their family and friends and need an easy way to get into the the other networks.</p>
<p>In the beginning most of them start with with remote connection software like Teamview, VNC, but at some point thats not enough anymore, when the responsibilities grow. The solution that I implement for them is based on the <a href="http://openvpn.net/" target="_blank">OpenVPN</a> which is a well know, free and secure Open Source VPN solution, which is able to run on cheap hardware. Why do I say it needs hardware when you see on their homepage that it runs on Windows too?</p>
<ol>
<li>You want a system with which nobody messes around and so it works for years without ever touching it again. And yes that is possible with the proposed solution. If you can&#8217;t reach the router it normally a ISP problem or power outage.</li>
<li>You don&#8217;t have only one Computer in each network and one VPN for each computer is not a good idea if you don&#8217;t need it.</li>
<li>There are also devices in the network where you can&#8217;t or won&#8217;t install a VPN software. e.g. printer, TV, receiver, acess point, &#8230;.</li>
</ol>
<p>Anyway you can also use this setup to let road warriors into your network over the Internet. I&#8217;ll also show how to do that, but it is not the main focus of this blog post.</p>
<p>So about what hardware I&#8217;m talking?</p>
<ol>
<li>An Accesspoint/DSL/Cable Router which is able to run OpenWRT, or any other system for which OpenVPN is available. I basically stick with systems that can run OpenWRT as I want similar systems to minimize my efforts. To be precise I&#8217;m almost always use a Linksys WRT54GL which you get under 40 Euros. But you&#8217;re free to use anything else. e.g. a friend of mine has a setup working with a <a title="SheevaPlug" href="http://en.wikipedia.org/wiki/SheevaPlug" target="_blank">SheevaPlug</a> and Debian on it, an other has a setup running with <a href="http://www.dd-wrt.com/" target="_blank">DD-WRT</a>.</li>
<li>If you have a local server in the network, be it Linux or Windows based, you can use that do. But don&#8217;t use clients if its not for road warriors.</li>
</ol>
<p><strong>The Setup</strong></p>
<p>You need one OpenVPN node per network/location. In the following example we have</p>
<ul>
<li>one central office network with a server and the router is from Internet service provider and we cannot install software on it, the server is also used as DHCP server. (I&#8217;ve specially selected that as it shows what additionally needs to be done if the OpenVPN server is not the default gateway for the devices in the network. If for your setup thats in a remote location its the same setup there.)</li>
<li>one remote office which is connected via cable the Internet. An OpenWRT based router is connected to the cable modem and <a href="http://en.wikipedia.org/wiki/IP_masquerading" target="_blank">masquerades</a> the devices behind it.</li>
<li>one remote office which is connected via DSL to the Internet. An OpenWRT based router inserted after the provider router, both masquerades and to make the life interesting you cannot change anything on the provider router, e.g. add a port forwarding</li>
</ul>
<p>In this howto we&#8217;re working with following subnets:</p>
<ul>
<li>10.23.0.0/24 &#8211; central office</li>
<li>10.23.1.0/24 &#8211; remote office 1</li>
<li>10.23.2.0/24 &#8211; remote office 2</li>
<li>10.23.255.0/24 &#8211; transport network remote offices</li>
<li>10.23.254.0/24 &#8211; transport network road warriors (not in the figure)</li>
</ul>
<p style="text-align: center;"><img class="size-full wp-image-317  aligncenter" title="network diagram" src="http://robert.penz.name/wp-content/uploads/2010/10/openvpn_network_blogpost-01.png" alt="network diagram" width="500" height="998" /></p>
<p>In the figure above you see that each Network has a different subnet &#8211; this is important as we need to route packets! <strong>Advise: </strong>Always use different subnets for different locations you set up. Even if you don&#8217;t connect them together at the beginning, make a list which subnets you&#8217;ve already used. There are plenty subnets in the <code>10.0.0.0 - 10.255.255.255</code> range for a single guy or a small company. Use a separate C class networks for each location (e.g. <code>10.42.0.0/24</code> for the first, <code>10.42.1.0/24</code> for the second and so on).</p>
<p>One subnet is needed as transit network within the VPN to connect the all remote offices to the central one. One subnet is only needed if you also want road warriors to connect to your network.</p>
<p><strong>Preconditions</strong></p>
<p>Common to all locations:</p>
<p>Get OpenVPN installed on all 3 systems. The version can differ a little between the servers which makes it easy if your OpenWRT router has an older version as you use for your main server.</p>
<p>Central office:</p>
<ul>
<li>You need to forward 2 UDP ports on the ISP router from the Internet to your server. The example ports I use in this howto are <code>10000</code> for the VPN connection of the remote offices and <code>10001</code> for the road warriors.</li>
<li>Create an DNS entry for the external IP address of your router. If you&#8217;ve a dynamic IP address or no own DNS server/domain you can use for example the <a href="http://www.dyndns.com/" target="_blank">dyndns.com service</a>; during this howto I assume centraloffice.dyndns.org as the host name.</li>
<li>You need to add a routing rule in your DHCP config which tells the clients that <code>10.23.0.0/16</code> is reachable behind the IP of your sever. And yes the <code>10.23.0.0/16</code> also includes the <code>10.23.0.0/24</code> of the central office, but it is important to remember that the more specific rule counts. The usage of one <code>10.23.0.0/16</code> and not a rule for ech C Class subnet allows you to add remote offices later without changing the DHCP. If your DHCP server is not able to add routing rules,  a workaround is possible if your default gateway used by the clients (in this case the ISP router) is able to add the <code>10.23.0.0/16</code> rule to its routing table. In this case every traffic goes first to the default gateway and then back to the server. Thats not nice but for a small network with only a low bandwidth connection to the other networks it is ok. In a big network the security / network guy will cry&#8230;..</li>
<li>Make sure that routing is enable on the server. On Linux systems you can check that easily with <code>cat /proc/sys/net/ipv4/ip_forward</code>. If the result is 1 it is enabled otherwise not.</li>
<li>Make sure that if you&#8217;ve a local firewall enabled that UDP ports <code>10000</code> and <code>10001</code> are open.</li>
</ul>
<p>Remote offices:</p>
<p>All requirements are meet if you&#8217;ve installed a modern version of OpenVPN and if the systems have the correct time. This maybe harder than it sounds as most DSL routers don&#8217;t have an internal clock that survives reboot. But it is important that the time of the router is bigger than the time the certificates where created, as otherwise the systems will not accept the certificate of the node in the central office. An easy way to make sure that at least this requirement is fulfilled is to set the date at boot to something fixed. I&#8217;ll show a simple way to do this later.</p>
<p><strong>Firewall considerations</strong></p>
<p>OpenVPN uses <code>tun*</code> device names for the VPN tunnels. On the central  office server you&#8217;ve have <code>tun0</code> for the remote offices and <code>tun1</code> for the  road warrios. For testing purposes you should let any traffice from and  to <code>tun0,tun1</code> and <code>eth0</code> (LAN interface) through. After you made sure that  everything works you should limit that to traffic which is really  needed. On the remote offices nodes I recommend to open the traffic  permanently in both directions (<code>eth0</code> to <code>tun0</code> and <code>tun0</code> to <code>eth0</code>) as  otherwise you need to administer the firewall rules on on multiple  systems.</p>
<p><strong>Import: </strong>You need also firewalls rules (on the central office server) that allow the traffic from one  remote office to the other if you wish that kind of traffic. OpenVPN will be  configured in a way that lets that kind of traffic through but without  firewall rules that also allow the traffic it will not work.</p>
<p><strong>Setting up a Certicate Authority (CA)</strong></p>
<p>So what is  a CA? I copied the first paragraph and linked the<a href="http://en.wikipedia.org/wiki/Certificate_authority" target="_blank"> explanation of wikipedia</a> as a starting point.</p>
<p><em>In cryptography, a certificate authority or certification authority (CA) is an entity that issues digital certificates. The digital certificate certifies the ownership of a public key by the named subject of the certificate. This allows others (relying parties) to rely upon signatures or assertions made by the private key that corresponds to the public key that is certified. In this model of trust relationships, a CA is a trusted third party  that is trusted by both the subject (owner) of the certificate and the party relying upon the certificate. CAs are characteristic of many public key infrastructure (PKI) schemes.</em></p>
<p>In more common words each VPN nodes needs to have a one certificate (*.crt &#8211; containing the public key and the signature of the CA) and one private key. Each node needs to trust the CA and for this they have the certificate of the CA stored. For each node you need therefore at least 3 cryptography files. The certificate file also contains a flag describing a node as server or client. We&#8217;ll configure the OpenVPN clients in a way that will make sure that they connect only to nodes with the server flag.</p>
<p>The CA should be not on one of the VPN nodes but on separate computer. The easiest way to reach a working and secure enough solution for a small company is to put the CA onto a USB stick and only insert it on a secure PC if you&#8217;ll need it for generating new certificates.</p>
<p>Now lets get to the doing part, I&#8217;ll will assume that you&#8217;ve a Linux or Linux like system as your CA system but it will also work on others. In your OpenVPN package you&#8217;ll find a directory or .gz file named something like easy-rsa-2.0. On an Ubuntu/Debian system you&#8217;ll find it under <code>/usr/share/doc/openvpn/examples/easy-rsa/2.0/</code> after installing the package openvpn.</p>
<ol>
<li>Copy or extract easy-rsa to a directory of your liking.</li>
<li>Open the <code>vars</code> file in a text editor and scroll down to the end of the file. There you can change the key length to something higher than 1024 but keep in mind that you&#8217;ve not the fastest systems if you&#8217;re using OpenWRT on a DSL Router. You should also change the default country, city, &#8230; entries. The default lifetime of the certificates with 10 years should be enouch <img src='http://robert.penz.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
<li>Type <code>. vars</code> which will load the variable in the environment of your current shell. You need to this step every time you start with an fresh shell and want todo any CA operation.</li>
<li>Call <code>./clean-all</code> &#8211; <strong>Important:</strong> Only do that in the beginning as it will delete your complete CA and certificates if you&#8217;ll use it later.</li>
<li>Call <code>./build-ca mycompany-ca</code> to generate the CA, you can leave most questions to the default answers. The important part the common name is already specified a command line parameter.</li>
<li>Call <code>./build-dh</code> to get a special file for the OpenVPN node in the central office</li>
<li>Call <code>./build-key-server centralofficenode</code> to generate the certificate for your central office node. Change the name to something meaningfull.<strong> Important:</strong> The name (= common name) needs to be unique for all nodes and I recommend to use only <code>A-Z,a-z,0-9,-,_</code> as common name.</li>
<li>Call <code>./build-key remoteofficenode</code> for each remote location you want to connect. <strong>Important:</strong> Use a system to choose the names otherwise you&#8217;ll loose overview of it if you&#8217;ll get more nodes and subnets. e.g. the name of the location/network you typically use to refer to it.</li>
</ol>
<p>You&#8217;ll find all files in the keys subdirectory and you need to copy the .crt, .key of each node and the CA file to the node (and not the files for an other node!) For the node in the central office you need also the dh1024.pem.</p>
<p>road warriors:</p>
<p>If you also want to setup a VPN service for road warriors I recommend to use a separate CA &#8211; so make a second copy of the easy-rsa and start again. Import use other names otherwise you will loose the overview.</p>
<p><strong>OpenVPN configuration</strong></p>
<p>Central office:</p>
<p>I assume in this howto that it is a Linux server (Ubuntu/Debian based to be exact) in your central office, but the configuration on for example Windows is the basically the same &#8211; just the paths, starting methods and logging stuff are different.</p>
<ol>
<li>Create the directory <code>/etc/openvpn/certs/</code> and copy the <code>centraloffice.crt</code>, <code>centraloffice.key</code>, <code>ca.crt</code> and the <code>dh1024.pem</code> to this directory and change the permissions for the directory to <code>700</code> and for all files to <code>600</code> and the owner should be root for both.</li>
<li>Create a config file <code>/etc/openvpn/0_remote_offices.conf</code> with following content:<br />
<code><br />
port 10000<br />
proto udp<br />
dev tun<br />
ca /etc/openvpn/certs/ca.crt<br />
cert /etc/openvpn/certs/centraloffice.crt<br />
key /etc/openvpn/certs/centraloffice.key<br />
dh /etc/openvpn/certs/dh1024.pem<br />
server 10.23.255.0 255.255.255.0<br />
client-to-client<br />
client-config-dir /etc/openvpn/remoteoffice_networks<br />
verb 3<br />
# we can here operate with the same B class network as the more specify rules counts<br />
route 10.32.0.0 255.255.0.0<br />
push "route 10.32.0.0 255.255.0.0"<br />
keepalive 10 120<br />
cipher AES-128-CBC   # AES<br />
comp-lzo<br />
max-clients 100<br />
persist-key<br />
persist-tun<br />
</code></li>
<li>Create the directory <code>/etc/openvpn/remoteoffice_networks</code> and insert one file for each remote relocation with the name of the common name you choose for it. The files contain only one line with following content for the first remote location <code>iroute 10.23.1.0 255.255.255.0</code> and <code>iroute 10.23.2.0 255.255.255.0</code> for the second remote location. This tells OpenVPN which remote network is reachable behind which node.</li>
<li>Optional: Copy the road warrior CA stuff needed to the certs directory. <strong>Important:</strong> Make sure that you use an other name as ca.crt, as you&#8217;ve that one for the remote offices.<br />
5. Optional: Create a configuration file <code>/etc/openvpn/1_remote_offices.conf</code> with following content for the road warriors:<br />
<code><br />
port 10001<br />
proto udp<br />
dev tun<br />
ca </code><code>/etc/openvpn/</code><code>certs/ca_roadwarrior.crt<br />
cert </code><code>/etc/openvpn/</code><code>certs/centraloffice_roadwarrior.crt<br />
key </code><code>/etc/openvpn/</code><code>certs/centraloffice_roadwarrior.key<br />
dh </code><code>/etc/openvpn/</code><code>certs/centraloffice_dh1024.pem<br />
server 10.23.254.0 255.255.255.0<br />
verb 3<br />
push "route 10.23.0.0 255.255.0.0"<br />
keepalive 10 120<br />
# Maybe you need to comment this out, as your e.g. Windows client uses an slightly other encoding and so you can't transfer data. But if possible AES is the best.<br />
cipher AES-128-CBC   # AES<br />
comp-lzo<br />
max-clients 100<br />
persist-key<br />
persist-tun<br />
</code></li>
<li>Restart the OpenVPN server with <code>/etc/init.d/openvpn restart</code> and check if the configuration was at least that much correct to start up.</li>
<li>Run <code>tail -f /var/log/syslog</code> (or your distribution equivalent) to check on entries if the OpenVPN clients try to connect.</li>
</ol>
<p>Remote Offices:</p>
<p>You need to do following steps for each remote office and replace the filenames with the correct ones for the specify remote location.</p>
<ol>
<li>Create the directory <code>/etc/openvpn/certs/</code> and copy the <code>remoteoffice*.crt</code>, <code>remoteoffice*.key</code> and <code>ca.crt</code> to this directory and change the permissions for the directory to <code>700</code> and for all files to <code>600</code> and the owner should be root for both.</li>
<li>Create a config file <code>/etc/openvpn/0_to_the_central_office.conf</code> with following content:<br />
<code><br />
client<br />
dev tun<br />
proto udp<br />
remote centraloffice.dyndns.org 10000<br />
resolv-retry infinite<br />
ns-cert-type server<br />
cipher AES-128-CBC<br />
ping 15<br />
ping-restart 45<br />
ping-timer-rem<br />
persist-tun<br />
persist-key<br />
comp-lzo<br />
verb 3<br />
ca /etc/openvpn/certs/ca.crt<br />
cert /etc/openvpn/certs/remoteoffice*.crt<br />
key /etc/openvpn/certs/remoteoffice*.key<br />
</code></li>
<li>Create an init.d script <code>/etc/init.d/openvpn</code> with the permissions <code>755</code> and the content:<br />
<code><br />
# change the date to something bigger than the time you used to generate the certificates<br />
date -s "2010-03-01 10:00:00"<br />
cd /etc/openvpn<br />
openvpn --config /etc/openvpn/0_to_the_central_office.conf --daemon<br />
</code></li>
<li>Create an symlink to start the init.d script automatically.<br />
<code><br />
cd /etc/rc.d/<br />
ln -s ../init.d/openvpn S65openvpn<br />
</code></li>
<li>For the first test you should do the steps in the init.d script by hand to check if they work and to see potential errors. For this don&#8217;t copy the <code>--daemon</code> parameter for the OpenVPN as this way you&#8217;ve see all errors and can easily stop OpenVPN with <code>CRTL-C</code>. Look also at the OpenVPN log entries on the central office node as it may also contain important error message.</li>
</ol>
<p>Road Warriors:</p>
<p>The configuration file looks similar to the remote offices ones, just use the <code>10001</code> port and use the files from the road warrior CA. On Windows you should use the GUI version of OpenVPN which needs the configuration file normally in <code>c:\programs\openvpn\conf</code> with the extension <code>.ovpn</code>. Copy also the files into the same directory and use no absolute paths as it may varies on different clients and you don&#8217;t want to change it for every client.</p>
<p><strong>Conclusion</strong></p>
<p>I hope this howto has shown how easily you can connect various networks via the Internet with Open Source tools and cheap hardware. I&#8217;ve you&#8217;ve any questions please write them in the comments below that post, I&#8217;ll try to answer them. This setup is only the beginning, if there is interest I can show some stuff I use to extend this setup. I&#8217;ve also written a <a href="http://robert.penz.name/21/ovpncncheck-an-openvpn-tls-verify-script/" target="_blank">blog post</a> some time ago which is interesting for you if you use the same CA for different VPN Server and want to make sure that only a some clients are allowed to connect to a specific server.</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/312/howto-connect-multiple-networks-over-the-internet-the-cheap-way/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tether a HTC Desire with Ubuntu 10.04 (Lucid) via USB</title>
		<link>http://robert.penz.name/307/tether-a-htc-desire-with-ubuntu-10-04-lucid-via-usb/</link>
		<comments>http://robert.penz.name/307/tether-a-htc-desire-with-ubuntu-10-04-lucid-via-usb/#comments</comments>
		<pubDate>Fri, 21 May 2010 20:24:53 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.penz.name/?p=307</guid>
		<description><![CDATA[You&#8217;re as amazed as I&#8217;m how short this article is as I&#8217;m. I looked through the Internet before I tried it myself and did a look at articles like this.  Almost all wrote how complicated that is (e.g. a HTC Software for Windows that works or not) or that you need a software like PDAnet. [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;re as amazed as I&#8217;m how short this article is as I&#8217;m. I looked through the Internet before I tried it myself and did a look at articles like <a href="http://www.androidcentral.com/android-internet-tether" target="_blank">this</a>.  Almost all wrote how complicated that is (e.g. a HTC Software for Windows that works or not) or that you need a software like PDAnet. Thats absolutely not true for the HTC Desire with an Ubuntu 10.04 notebook/netbook. I just connected both via the shipped USB cable and selected on the Desire to share the Internet connection. And guess what happend the Network Manager told me that I&#8217;m connected to the network. I couldn&#8217;t believe it so I flipped to my shell windows and did a ping. And yes, I was connected.  I really don&#8217;t understand the problem now the people have. Wrong OS on the notebook? <img src='http://robert.penz.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Some guys in the Linux/Open Source world talked with each other and made it just works out of the box &#8211; no special applications or drivers &#8211; it just worked. Big THX guys!!! I really love my Ubuntu and Android!</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.penz.name/307/tether-a-htc-desire-with-ubuntu-10-04-lucid-via-usb/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

