<?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; FreeBSD</title>
	<atom:link href="http://blog.burghardt.pl/category/freebsd/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.burghardt.pl</link>
	<description>Create. Break. Fix. Repeat.</description>
	<lastBuildDate>Mon, 05 Jul 2010 07:35:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>FreeBSD with X.Org on QEMU</title>
		<link>http://blog.burghardt.pl/2009/03/freebsd-with-xorg-on-qemu/</link>
		<comments>http://blog.burghardt.pl/2009/03/freebsd-with-xorg-on-qemu/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 19:03:03 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[DBus]]></category>
		<category><![CDATA[HAL]]></category>
		<category><![CDATA[QEMU]]></category>
		<category><![CDATA[X.Org]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=296</guid>
		<description><![CDATA[<p>X.Org form ports works fine with cirrus driver, but starts in 800&#215;600 only. Small tweak to configuration file is needed to run X in higher resolutions.</p>
<p></p>
Install X.Org and drivers
<p>First install xorg, xf86-video-cirrus and xf86-input-keyboard ports.</p>
DBus and HAL
<p>Installing DBus and HAL allow X Server to guess hardware configuration and work without any configuration file.</p>
<p>If your console get [...]]]></description>
			<content:encoded><![CDATA[<p>X.Org form ports works fine with <strong>cirrus</strong> driver, but starts in 800&#215;600 only. Small tweak to configuration file is needed to run X in higher resolutions.</p>
<p><span id="more-296"></span></p>
<h2>Install X.Org and drivers</h2>
<p>First install <strong>xorg</strong>, <strong>xf86-video-cirrus</strong> and <strong>xf86-input-keyboard</strong> ports.</p>
<h2>DBus and HAL</h2>
<p>Installing DBus and HAL allow X Server to guess hardware configuration and <a href="http://www.kirya.net/weblog/2009/02/07/my-new-xorgconf/">work without any configuration file</a>.</p>
<p>If your console get flooded by messages like this after enabling HAL:</p>
<pre>
acd0: FAILURE - unknown CMD (0x03) ILLEGAL REQUEST asc=0x20 ascq=0x00
</pre>
<p>disable CD-ROM polling in HAL with command:</p>
<pre>
# hal-disable-polling --device /dev/acd0
</pre>
<p>Automatically configured X-Window starts in resolution as small as 800&#215;600.</p>
<h2>Configuring X</h2>
<p>Create <em>xorg.conf.new</em> skeleton with:</p>
<pre>
# X -configure
</pre>
<h3>Tweak <em>xorg.conf.new</em></h2>
<p>Add those settings to get more then 800&#215;600:</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">Section &quot;Monitor&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp;HorizSync &nbsp; &nbsp; &nbsp; 31.5 - 48.5<br />
&nbsp; &nbsp; &nbsp; &nbsp;VertRefresh &nbsp; &nbsp; 50.0 - 90.0<br />
&nbsp; &nbsp; &nbsp; &nbsp;Option &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;DPMS&quot;<br />
EndSection<br />
<br />
Section &quot;Device&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp;Driver &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;cirrus&quot;<br />
EndSection</div></div>
<p>If you want to set specific resolution (1024&#215;768 in this example) use:</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">Section &quot;Screen&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp;DefaultDepth 16<br />
&nbsp; &nbsp; &nbsp; &nbsp;SubSection &quot;Display&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Depth &nbsp; &nbsp; 16<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Modes &nbsp; &nbsp; &quot;1024x768&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp;EndSubSection<br />
EndSection</div></div>
<h3>Testing X.Org setup</h3>
<p>To test your setup run:</p>
<pre>
# X -config xorg.conf.new
</pre>
<p>Finally move <em>xorg.conf.new</em> to <em>xorg.conf</em>:</p>
<pre>
# mv xorg.conf.new /etc/X11/xorg.conf
</pre>
<p>Now X.Org is configured. Login as plain user and run <strong>startx</strong> to start X-Window session.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/03/freebsd-with-xorg-on-qemu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple FreeBSD jails sharing one IP address</title>
		<link>http://blog.burghardt.pl/2009/01/multiple-freebsd-jails-sharing-one-ip-address/</link>
		<comments>http://blog.burghardt.pl/2009/01/multiple-freebsd-jails-sharing-one-ip-address/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 22:19:35 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[ezjail]]></category>
		<category><![CDATA[jail]]></category>
		<category><![CDATA[PF]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=203</guid>
		<description><![CDATA[<p>If you want to use multiple jails on FreeBSD with only one external IP addresses you may set up all jails on private addressed with little help of loopback interface, NAT and PF.</p>
<p></p>
Networking
<p>Each jail requires one IP address. First create lo1 loopback interface and assign IPs to it:</p>

# ifconfig lo1 create
# ifconfig lo1 inet 10.0.0.1 netmask [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to use multiple jails on FreeBSD with only one external IP addresses you may set up all jails on private addressed with little help of <a href="http://en.wikipedia.org/wiki/Loopback">loopback</a> interface, <a href="http://en.wikipedia.org/wiki/Network_Address_Translation">NAT</a> and <a href="http://en.wikipedia.org/wiki/PF_(firewall)">PF</a>.</p>
<p><span id="more-203"></span></p>
<h2>Networking</h2>
<p>Each jail requires one IP address. First create lo1 loopback interface and assign IPs to it:</p>
<pre>
# ifconfig lo1 create
# ifconfig lo1 inet 10.0.0.1 netmask 255.255.255.0 alias
# ifconfig lo1 inet 10.0.0.2 netmask 255.255.255.0 alias
...
</pre>
<p>To make this permanent add following lines to <em>/etc/rc.conf</em>:</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: #007800;">cloned_interfaces</span>=<span style="color: #ff0000;">&quot;lo1&quot;</span><br />
<span style="color: #007800;">ifconfig_lo1</span>=<span style="color: #ff0000;">&quot;inet 10.0.0.254 netmask 255.255.255.0&quot;</span><br />
<span style="color: #007800;">ifconfig_lo1_alias0</span>=<span style="color: #ff0000;">&quot;inet 10.0.0.1 netmask 255.255.255.0&quot;</span><br />
...</div></div>
<p>Now configure port redirection (forwarding) from your IP to your jails&#8217;s IPs. Here is my <a href="http://www.openbsd.org/faq/pf/index.html">PF</a> line (add it to <em>/etc/pf.conf</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">rdr on re0 proto tcp from any to ext._ip port http -&gt; 10.0.0.1 port http<br />
rdr on re0 proto tcp from any to ext._ip port ircd -&gt; 10.0.0.2 port ircd<br />
...</div></div>
<p>If jails need network access (e.g. to download ports) create <a href="http://en.wikipedia.org/wiki/Network_address_translation">NAT</a> on your external network interface:</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">nat on re0 from lo1:network to any -&gt; (re0)</div></div>
<p>Finally reload PF rules:</p>
<pre>
# pfctl -d
# pfctl -e -f /etc/pf.conf
</pre>
<h2>Ezjail</h2>
<p>Install <strong>ezjail</strong> from <em>/usr/ports/sysutils/ezjail</em>:</p>
<pre>
# cd /usr/ports/sysutils/ezjail
# make install clean
</pre>
<p>After ezjail installation create base jail. This jail is used as skeleton of all jails. Before creating base jail you need to have current FreeBSD sources in <em>/usr/src</em>. If you have built them add <strong>-i</strong> option to update command to prevent (re)building them:</p>
<pre>
# ezjail-admin update
</pre>
<h2>Creating jails</h2>
<p>When basejail is installed we are ready to create jails:</p>
<pre>
# ezjail-admin create -f default apachejail 10.0.0.1
# ezjail-admin create -f default ircjail 10.0.0.2
</pre>
<h2>See also</h2>
<ul>
<li><a href="http://erdgeist.org/arts/software/ezjail/">ezjail &#8211; jail administration framework</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/01/multiple-freebsd-jails-sharing-one-ip-address/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Deploying IPsec in small LAN in 3 easy steps</title>
		<link>http://blog.burghardt.pl/2008/03/deploying-ipsec-in-small-lan-in-3-easy-steps/</link>
		<comments>http://blog.burghardt.pl/2008/03/deploying-ipsec-in-small-lan-in-3-easy-steps/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 22:04:48 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[IPsec]]></category>
		<category><![CDATA[racoon]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/2008/03/deploying-ipsec-in-small-lan-in-3-easy-steps/</guid>
		<description><![CDATA[<p>I think about installing IPsec on computers in my home LAN for some time. There are many configurations possible: tunnel mode, transport mode, peer-to-peer solution or star topology with single VPN hub. Also there are different IPsec implementations. KAME for *BSD, Openswan, strongSwan and Linux 2.6 PF_KEY implementation (which can be used with setkey and racoon [...]]]></description>
			<content:encoded><![CDATA[<p>I think about installing <a href="http://en.wikipedia.org/wiki/IPsec">IPsec</a> on computers in my home <a href="http://en.wikipedia.org/wiki/LAN">LAN</a> for some time. There are many configurations possible: tunnel mode, transport mode, peer-to-peer solution or star topology with single VPN hub. Also there are different IPsec implementations. <a href="http://www.kame.net/">KAME</a> for *BSD, <a href="http://www.openswan.org/">Openswan</a>, <a href="http://www.strongswan.org/">strongSwan</a> and Linux 2.6 PF_KEY implementation (which can be used with setkey and racoon or with OpenBSD&#8217;s isakmpd). Choosing one is not easy, but for me the simplest method was best. I choose Linux 2.6 PF_KEY with <a href="http://ipsec-tools.sourceforge.net/">ipsec-tools</a> and <a href="http://www.kame.net/racoon/">racoon</a> for dynamic key exchange (now part of ipsec-tools). Its simple, easy to implement and&#8230; configuration files without any modification (except file paths) can be used also in FreeBSD (tested with 6.3-RELEASE).</p>
<p><span id="more-46"></span></p>
<p><strong>Step 1.</strong> Use <a href="http://openvpn.net/howto.html#pki">OpenVPN easyRSA</a> to set up your own <a href="http://en.wikipedia.org/wiki/Certificate_authority">Certificate Authority</a>, generate certificates and keys and sign them. You will need to create links to certificates and keys in form hash.(r)0. Use this command to compute hash:</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;"># openssl x509 -hash -in keys/ca.crt</span></div></div>
<p>And then create links replacing question marks by hashes.</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;"># ln -s ca.crt keys/????????.0</span><br />
<span style="color: #666666; font-style: italic;"># ln -s crl.pem keys/????????.r0</span></div></div>
<p><strong>Step 2.</strong> When you have all your certificates created you need only to do two more things. First create <em>/etc/ipsec-tools.conf</em> to set Security Policy Database (SPD):</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;">#!/usr/sbin/setkey -f</span><br />
<br />
<span style="color: #666666; font-style: italic;">## Flush the SAD and SPD</span><br />
<br />
flush;<br />
spdflush;<br />
<br />
<span style="color: #666666; font-style: italic;">## SPDs for racoon</span><br />
<br />
spdadd 192.168.1.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> 192.168.1.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> any <span style="color: #660033;">-P</span> out ipsec esp<span style="color: #000000; font-weight: bold;">/</span>transport<span style="color: #000000; font-weight: bold;">//</span>use;<br />
spdadd 192.168.1.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> 192.168.1.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> any <span style="color: #660033;">-P</span> <span style="color: #000000; font-weight: bold;">in</span> &nbsp;ipsec esp<span style="color: #000000; font-weight: bold;">/</span>transport<span style="color: #000000; font-weight: bold;">//</span>use;</div></div>
<p><strong>Step 3.</strong> And then configure racoon to negotiate and maintain Security Association Database  (SAD). Racoon read configuration from <em>/etc/racoon/racoon.conf</em>:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">path certificate <span style="color: #ff0000;">&quot;/etc/racoon/certs&quot;</span>;<br />
<br />
sainfo anonymous <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; encryption_algorithm aes256,aes128,blowfish128,3des;<br />
&nbsp; &nbsp; authentication_algorithm hmac_sha256,hmac_sha1,hmac_md5;<br />
&nbsp; &nbsp; compression_algorithm deflate;<br />
&nbsp; &nbsp; lifetime <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #000000;">30</span> min;<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
remote anonymous <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; exchange_mode main,aggressive;<br />
&nbsp; &nbsp; lifetime <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #000000;">60</span> min;<br />
&nbsp; &nbsp; certificate_type x509 <span style="color: #ff0000;">&quot;host.crt&quot;</span> <span style="color: #ff0000;">&quot;host.key&quot;</span>;<br />
&nbsp; &nbsp; verify_cert on;<br />
&nbsp; &nbsp; my_identifier asn1dn;<br />
&nbsp; &nbsp; proposal <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; encryption_algorithm 3des;<br />
&nbsp; &nbsp; &nbsp; &nbsp; hash_algorithm sha1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; authentication_method rsasig;<br />
&nbsp; &nbsp; &nbsp; &nbsp; dh_group modp1024;<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>Now (re)start setkey and racoon on all hosts in LAN. If everything is fine IPsec should be in use for all local connections.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2008/03/deploying-ipsec-in-small-lan-in-3-easy-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
