<?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>ClearChain &#187; FreeBSD</title>
	<atom:link href="http://www.clearchain.com/blog/categories/computers/freebsd/feed" rel="self" type="application/rss+xml" />
	<link>http://www.clearchain.com/blog</link>
	<description>-= Daily Happenings =-</description>
	<lastBuildDate>Wed, 05 Oct 2011 23:02:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>FreeBSD Sudo Upgrade Gone Wrong, Password No longer working with Sudo 1.7.2p2 / 1.7.2p3, Sudo Broken</title>
		<link>http://www.clearchain.com/blog/posts/freebsd-sudo-upgrade-gone-wrong-password-no-longer-working-with-sudo-1-7-2p2-1-7-2p3-sudo-broken</link>
		<comments>http://www.clearchain.com/blog/posts/freebsd-sudo-upgrade-gone-wrong-password-no-longer-working-with-sudo-1-7-2p2-1-7-2p3-sudo-broken#comments</comments>
		<pubDate>Wed, 14 Apr 2010 04:09:02 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=681</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/freebsd-sudo-upgrade-gone-wrong-password-no-longer-working-with-sudo-1-7-2p2-1-7-2p3-sudo-broken"><img align="left" hspace="5" width="150" height="150" src="http://www.clearchain.com/blog/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Recently a port audit security advisor was released that indicated an exploit with sudoedit of the security/sudo FreeBSD port. At the time I was running sudo 1.6.9 and being a responsible system administrator, I decided to upgrade sudo to the latest revision of the port (1.7.2p2 at the time). The upgrade went very smoothly, with<a href="http://www.clearchain.com/blog/posts/freebsd-sudo-upgrade-gone-wrong-password-no-longer-working-with-sudo-1-7-2p2-1-7-2p3-sudo-broken"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<p>Recently a port audit security advisor was released that indicated an <a href="http://www.freebsd.org/ports/portaudit/018a84d0-2548-11df-b4a3-00e0815b8da8.html">exploit</a> with sudoedit of the <a href="http://www.freebsd.org/cgi/cvsweb.cgi/ports/security/sudo/">security/sudo</a> <a href="http://www.freebsd.org">FreeBSD</a> port. At the time I was running sudo 1.6.9 and being a responsible system administrator, I decided to upgrade sudo to the latest revision of the port (1.7.2p2 at the time). The upgrade went very smoothly, with portupgrade doing it&#8217;s job quickly and reliably. It wasn&#8217;t until I tried to use sudo for the first time after the upgrade that the problems started.</p>
<p>Initially I tried get a root shell using:</p>
<pre>sudo -s
</pre>
<p>sadly after repeated password prompts I had no luck. Initially I thought I was just getting my password wrong &#8211; something I occasionally do with the amount of passwords I have to remember. However, after repeated attempts I came to the conclusion that something else was wrong.</p>
<p>I looked at the logs to see if they would show anything useful:</p>
<p>﻿</p>
<pre>Apr 14 11:49:28 leo sudo:   benjsc : 1 incorrect password attempt ; TTY=pts/3 ; PWD=/owners/benjsc/home ; USER=root ; COMMAND=/bin/tcsh
Apr 14 11:51:09 leo sudo:   benjsc : 1 incorrect password attempt ; TTY=pts/4 ; PWD=/owners/benjsc/home ; USER=root ; COMMAND=/bin/tcsh
Apr 14 11:58:03 leo sudo:   benjsc : 1 incorrect password attempt ; TTY=pts/4 ; PWD=/owners/benjsc/home ; USER=root ; COMMAND=/bin/tcsh
Apr 14 11:58:16 leo sudo:   benjsc : 1 incorrect password attempt ; TTY=pts/4 ; PWD=/owners/benjsc/home ; USER=root ; COMMAND=/bin/tcsh</pre>
<p>Once again nothing obvious showed up. At this point I started <a href="http://www.google.com/">Googling</a> to try and find the answer. There was a lot of articles about people trying the root password rather than the user password, but I wasn&#8217;t doing that. There was articles about people stuffing up the syntax of the sudoers file (you should use visudo to edit this). However, nothing had changed but the version of sudo. Eventually I found a <a href="http://www.mail-archive.com/freebsd-questions@freebsd.org/msg228360.html">post that solved the issue.</a></p>
<p>It turns out that the latest versions of sudo break pam support. Whilst the article refers to OPIE (One Time Keys), I&#8217;ve since confirmed that this issue affects machines without OPIE setup. Hence for anyone who tries to upgrade sudo to a later version and has problems with their password not being accepted, and the password prompt just continuing to reappear. Then you&#8217;ll need to patch sudo to work.</p>
<p>How, copy and paste the following on the console:</p>
<pre>cd  /usr/ports/security/sudo
make extract
cd work/sudo*
patch &lt;&lt; END
--- auth/pam.c.orig     2010-02-04 10:43:28.635212518 -0600
+++ auth/pam.c  2010-02-04 10:43:34.194558424 -0600
@@ -107,13 +107,6 @@
     }

     /*
-     * Set PAM_RUSER to the invoking user (the "from" user).
-     * We set PAM_RHOST to avoid a bug in Solaris 7 and below.
-     */
-    (void) pam_set_item(pamh, PAM_RUSER, user_name);
-    (void) pam_set_item(pamh, PAM_RHOST, user_host);
-
-    /*
      * Some versions of pam_lastlog have a bug that
      * will cause a crash if PAM_TTY is not set so if
      * there is no tty, set PAM_TTY to the empty string.

END
cd ../..
make build
make deinstall
make install
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/freebsd-sudo-upgrade-gone-wrong-password-no-longer-working-with-sudo-1-7-2p2-1-7-2p3-sudo-broken/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Serial Devices in FreeBSD / How to set a terminal baud rate</title>
		<link>http://www.clearchain.com/blog/posts/using-serial-devices-in-freebsd-how-to-set-a-terminal-baud-rate</link>
		<comments>http://www.clearchain.com/blog/posts/using-serial-devices-in-freebsd-how-to-set-a-terminal-baud-rate#comments</comments>
		<pubDate>Fri, 08 Jan 2010 00:33:56 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[UniSA]]></category>
		<category><![CDATA[baud rate]]></category>
		<category><![CDATA[baudrate]]></category>
		<category><![CDATA[ftdi]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[stty]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=674</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/using-serial-devices-in-freebsd-how-to-set-a-terminal-baud-rate"><img align="left" hspace="5" width="150" height="150" src="http://www.clearchain.com/blog/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Recently I was working on a php command line program that required access to a serial port. Initially developed under Linux the program was then shifted to it&#8217;s permanent location on a FreeBSD server. This is where we first started having problems. Initially we discovered the server didn&#8217;t have a native serial port. We fixed<a href="http://www.clearchain.com/blog/posts/using-serial-devices-in-freebsd-how-to-set-a-terminal-baud-rate"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on a php command line program that required access to a serial port.</p>
<p>Initially developed under Linux the program was then shifted to it&#8217;s permanent location on a FreeBSD server. This is where we first started having problems. Initially we discovered the server didn&#8217;t have a native serial port. We fixed this using a USB to serial converter/dongle (FTDI Chipset). This was fine as FreeBSD has the ufdti kernel module. Upon loading the module new devices appears in /dev</p>
<pre>crw-rw----  1 uucp  dialer    0, 157 Oct  6 08:39 /dev/cuaU0
crw-rw----  1 uucp  dialer    0, 158 Oct  6 08:39 /dev/cuaU0.init
crw-rw----  1 uucp  dialer    0, 159 Oct  6 08:39 /dev/cuaU0.lock
crw-rw-rw-  1 root  wheel     0, 154 Jan  8 10:50 /dev/ttyU0
crw-------  1 root  wheel     0, 155 Oct  6 08:39 /dev/ttyU0.init
crw-------  1 root  wheel     0, 156 Oct  6 08:39 /dev/ttyU0.lock</pre>
<p>We attempted to connect to our device using screen (screen /dev/ttyU0 115200) and everything worked as expected. We could send AT commands to the device all ok.<br />
We then stopped screen and ran our php program. It ended up hanging on a fgets call to the serial port. This is really strange we though.<br />
Next we queried the port to find out what baud rate it was set at:</p>
<pre>&gt;stty -f /dev/ttyu0
speed 9600 baud;
lflags: echoe echoke echoctl
oflags: tab0
cflags: cs8 -parenb</pre>
<p>Strange we thought as we&#8217;d just connected with screen at 115200. Under linux we use screen to set the baud rate, all other programs accessing the port use the port at 115200. So what had set it back to 9600 baud?<br />
We tried to use stty to set the speed:</p>
<pre>&gt;stty -f /dev/ttyU0 speed 115200</pre>
<pre>&gt;stty -f /dev/ttyu0
speed 9600 baud;
lflags: echoe echoke echoctl
oflags: tab0
cflags: cs8 -parenb</pre>
<p>What on earth was happening? We set the speed to 115200 but directly quering the port again indicated it was still at 9600 baud? At this point we were perplexed.<br />
Eventually we found the solution. The newer FreeBSD terminal drivers provide the *.init devices, in this case /dev/ttyU0.init . These devices indicate the terminal settings to be applied to the terminal when the device is closed. Whilst Linux leaves the device in the same state the last program put the port into, FreeBSD restores the terminals state to what ever is specified in the init file. So a quick command:</p>
<pre>&gt; stty -f /dev/ttyU0.init -icanon -isig -echo echoe echok echoke echoctl -icrnl -ixany -imaxbel ignpar -opost -onlcr -oxtabs cs8 -parenb -hupcl clocal</pre>
<p>And then to check:</p>
<pre>&gt; stty -f /dev/ttyU0
speed 115200 baud;
lflags: -icanon -isig -echo echoe echok echoke echoctl
iflags: -icrnl -ixany -imaxbel ignpar
oflags: -opost -onlcr -oxtabs
cflags: cs8 -parenb -hupcl clocal</pre>
<p>Excellent. The terminal was now configured exactly how we wanted. We ran the program and it worked like a charm!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/using-serial-devices-in-freebsd-how-to-set-a-terminal-baud-rate/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Caldav calendar &amp; icalserver</title>
		<link>http://www.clearchain.com/blog/posts/caldav-calendar-icalserver</link>
		<comments>http://www.clearchain.com/blog/posts/caldav-calendar-icalserver#comments</comments>
		<pubDate>Wed, 24 Jun 2009 07:00:47 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[caldav]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[ical]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web gui]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=445</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/caldav-calendar-icalserver"><img align="left" hspace="5" width="150" src="http://www.local-guru.net/img/guru/calendar_sc.png" class="alignleft wp-post-image tfe" alt="" title="Web Calendar" /></a>For quite a while now I&#8217;ve been using Apple&#8217;s ICal server on FreeBSD and Sunbird/Lightning as a front end to the calendar. However, one thing that has always annoyed me was the lack of a web frontend to my calendars. Well today after searching on a completely different topic I found a javascript front end<a href="http://www.clearchain.com/blog/posts/caldav-calendar-icalserver"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Web Calendar" src="http://www.local-guru.net/img/guru/calendar_sc.png" alt="" width="307" height="211" /></p>
<p>For quite a while now I&#8217;ve been using <a href="http://trac.calendarserver.org/">Apple&#8217;s ICal server</a> on <a href="http://www.freebsd.org">FreeBSD</a> and <a href="http://www.mozilla.org/projects/calendar">Sunbird/Lightning</a> as a front end to the calendar. However, one thing that has always annoyed me was the lack of a web frontend to my calendars.</p>
<p>Well today after searching on a completely different topic I found a <a href="http://www.local-guru.net/blog/2009/03/29/javascript-caldav-frontend">javascript front end to caldav</a>. After only a few minutes setup I had the frontend up and running. Sadly however, It didn&#8217;t play happy with ICalServer. A little debugging of the caldav REPORT request and I had it querying correctly.</p>
<p>Now there was valid data populating the table&#8230; or was it. Looking a little closer there were bugs with the reoccurring events and also with the lastMonday function. <a href="http://clearchain.com/~benjsc/downloads/patches/20090329-javascript-caldav-Frontend.patch">A quick fix</a> (after 20mins finding them) and now the calendar works great!</p>
<p>Best thing about it is I can now have a public caldav calendar which everyone can view whilst being able to update thing directly on my own writable version of the caldav calendar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/caldav-calendar-icalserver/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Booting FreeBSD from a root zfs pool using a standard MBR and partition table</title>
		<link>http://www.clearchain.com/blog/posts/booting-freebsd-from-a-root-zfs-pool-using-a-standard-mbr-and-partition-table</link>
		<comments>http://www.clearchain.com/blog/posts/booting-freebsd-from-a-root-zfs-pool-using-a-standard-mbr-and-partition-table#comments</comments>
		<pubDate>Fri, 08 May 2009 03:51:02 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[booting]]></category>
		<category><![CDATA[BTX]]></category>
		<category><![CDATA[dual boot]]></category>
		<category><![CDATA[mbr]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[zfs]]></category>
		<category><![CDATA[zfsboot]]></category>
		<category><![CDATA[zfsldr.S]]></category>
		<category><![CDATA[zfsonroot]]></category>
		<category><![CDATA[zpool]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=366</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/booting-freebsd-from-a-root-zfs-pool-using-a-standard-mbr-and-partition-table"><img align="left" hspace="5" width="150" height="150" src="http://www.clearchain.com/blog/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>This page documents the current state of play for booting the root filesystem (/) off a zfs zpool under FreeBSD, using a standard master boot record (MBR) and a standard partition table. The aim was to be able to have a dual boot system for my laptop using the standard FreeBSD quick selection boot loader.<a href="http://www.clearchain.com/blog/posts/booting-freebsd-from-a-root-zfs-pool-using-a-standard-mbr-and-partition-table"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<p>This page documents the current state of play for booting the root filesystem (/) off a zfs zpool under FreeBSD, using a standard master boot record (MBR) and a standard partition table. The aim was to be able to have a dual boot system for my laptop using the standard FreeBSD quick selection boot loader.</p>
<p><span style="color: #0000ff;">Note, this does not cover using the gpt based partition tables. If you want to use these, please refer to the following page: </span><span style="color: #0000ff;"><a href="http://blogs.freebsdish.org/lulf/2008/12/16/setting-up-a-zfs-only-system/">http://lulf.geeknest.org/blog/freebsd/Setting_up_a_zfs-only_system/</a> or booting zfs as root using a small ufs boot partition as provided by the instructions at: <a href="http://wiki.freebsd.org/ZFSOnRoot">http://wiki.freebsd.org/ZFSOnRoot.<br />
</a></span></p>
<p>Below is the steps required to be able to setup the root zpool</p>
<ol>
<li>Download a FreeBSD -current fixit cdrom snapshot later than 200901, as these have loader ZFS support</li>
<li>Burn the CD</li>
<li>Boot the CD</li>
<li>Setup any partitions you want &#8211; <span style="color: #ff0000;">note you must setup the &#8216;a&#8217; partition to cover the entire device as the loader will use this.</span></li>
<li>Select Fixit from the menu, and use the CDrom as a source</li>
<li>Create the pool and install the loader (see below)</li>
<li>Copy the required files to boot (see below)</li>
</ol>
<h2>Creating the root zpool and installing the Loader</h2>
<p>The fixit cd has everything required to create a zpool, however by default none of the required modules are loaded. Hence they need to be loaded first:</p>
<pre style="padding-left: 30px;"><span style="font-family: Georgia; line-height: 19px; white-space: normal;"><span style="font-family: times new roman,times;"><span style="line-height: 18px; white-space: pre;">cd /mnt2/boot/kernel
<span style="white-space: normal;">kldload ./opensolaris.ko
<span style="white-space: pre;">
kldload ./zfs.ko</span></span></span></span></span></pre>
<p>Once the modules have been loaded all the zfs tools (zpool,zfs,zdb) should now work. Let assume you want to install FreeBSD to /dev/ad4s2 (second partition on a sata disk). You can do this using:</p>
<pre>    zpool create <strong><em>somename</em></strong> /dev/ad4s2</pre>
<p>Where <span style="text-decoration: underline;">somename</span> is the name of the pool you want to create. This creates a single zfs filesystem and a zfs pool of storage. To install the boot loader you need to do:</p>
<pre>    # dd if=/mnt2/boot/zfsboot of=/dev/da0s1 count=1
    # dd if=/mnt2/boot/zfsboot of=/dev/da0s1 skip=1 seek=1024</pre>
<p>The first line installs boot1, the second line installs boot2.  However, boot2 is responsible for loading boot3 (aka the loader &#8211; found in /boot/loader). Hence that must be put in place.</p>
<h2>Copying the required files to boot</h2>
<p>The easiest way to get things to the point where things are ready to boot is to copy all the files from /dist  - the live distribution. Before you do this, you might like to take advantage of zfs and create some subfilesystems so you can snapshot, monitor space, etc.</p>
<p>For instance creating a /usr and /var filesystem is often very handy:</p>
<pre>    #zfs create somename/usr
    #zfs create somename/var</pre>
<p>Now you can copy the base system:</p>
<pre>    cp -a /dist/* /somename</pre>
<p>This will install among other things:</p>
<ul>
<li>/somename/boot/kernel/kernel  - FreeBSD kernel</li>
<li>/somename/boot/kernel/opensolaris.ko &#8211; zfs dependency</li>
<li>/somename/boot/kernel/zfs.ko &#8211; module understanding zpools/zfs</li>
<li>/somename/boot/loader  - the FreeBSD loader<span style="color: #ff0000;"><br />
</span></li>
</ul>
<p>At this point you need to replace the loader with one that understands zfs. You can download the loader from: (To be advise &#8211; see cavet below)<br />
And if you have a usb stick copy it in place using:</p>
<pre>   mount_msdos /dev/da0s1 /mnt
   cp /mnt/loader /somename/boot</pre>
<p>Finally you have to tell FreeBSD where to mount filesystems on a standard boot:</p>
<pre>   zfs set mountpoint=/var somename/var
   zfs set mountpoint=/usr somename/usr</pre>
<p>At this point any command you type will now probably fail indicating it&#8217;s missing some shared library. This is because /usr has now changed. You can get around this by telling the loader where to find valid libraries:</p>
<pre>   export LD_LIBRARY_PATH=/mnt2/lib</pre>
<p>Next we need to build the zfs cache. This is used by zfs mount to automatically mount zfs filesystems by /etc/rc.d/zfs at boot time. It&#8217;s also used to determine if a filesystem is local to the system or belongs to an exported pool.</p>
<pre>   mkdir /boot/zfs
   mkdir /somename/boot/zfs
   cd /
   zfs export somename
   zfs import -f somename
   cp /boot/zfs/zfs.cache /somename/boot/zfs/</pre>
<p>Finally we tell the loader where we want to boot from and set the init scripts to automatically start all zfs filesystems:</p>
<pre>    echo 'zfs_enable="YES"' &gt; /somename/etc/rc.conf
    echo 'zfs_load="YES"' &gt; /somename/boot/loader.conf
    echo 'vfs.root.mountfrom="zfs:somename"' &gt;&gt; /somename/boot/loader.conf</pre>
<p>And set the root filesystem to a legacy mountpoint (so zfs mount -a won&#8217;t try and mount an already mounted filesystem)</p>
<pre>     zfs set mountpoint=legacy somename</pre>
<p>At this point you can reboot and things should now boot!<br />
<span style="text-decoration: underline;"><em><strong>Update: 20090809</strong></em></span></p>
<p>There has been a lot of updates to instructions along the way. There are now official ZFS on Root instructions available using GPT/MBR/other available at: <a href="http://wiki.freebsd.org/RootOnZFS">http://wiki.freebsd.org/RootOnZFS</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/booting-freebsd-from-a-root-zfs-pool-using-a-standard-mbr-and-partition-table/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>mythtv on FreeBSD: The beginning</title>
		<link>http://www.clearchain.com/blog/posts/mythtv-on-freebsd-the-beginning</link>
		<comments>http://www.clearchain.com/blog/posts/mythtv-on-freebsd-the-beginning#comments</comments>
		<pubDate>Wed, 01 Apr 2009 11:50:26 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[Mythtv]]></category>
		<category><![CDATA[cx88]]></category>
		<category><![CDATA[dvb]]></category>
		<category><![CDATA[dvb-t]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[television]]></category>
		<category><![CDATA[tv]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=311</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/mythtv-on-freebsd-the-beginning"><img align="left" hspace="5" width="150" height="150" src="http://www.clearchain.com/blog/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>This documents my progress settting up mythtv on FreeBSD.]]></description>
			<content:encoded><![CDATA[<p>This article is the first in a series of blog entries which documents my progress getting FreeBSD 7.1-Stable working a both a MythTV backend and frontend. There&#8217;s very little information out there talking about this process, probably as FreeBSD&#8217;s multimedia drivers are not as mature or as abundant as Linux&#8217;s . However there is some information out there alluding to clues that is it possible.  Below is the specs of the computer I&#8217;m using for this setup.</p>
<h2>Hardware</h2>
<ul>
<li><strong>CPU: </strong>Core2Duo  E8200  @ 2.66GHz</li>
<li><strong>HDD:</strong><br />
ad0: 114472MB &lt;WDC WD1200JB-00FUA0 15.05R15&gt; at ata0-master UDMA33<br />
ad4: 305245MB &lt;WDC WD3200AAKS-00B3A0 01.03A01&gt; at ata2-master SATA150<br />
ad6: 190782MB &lt;Seagate ST3200822AS 3.01&gt; at ata3-master SATA150<br />
ad7: 190782MB &lt;Seagate ST3200822AS 3.01&gt; at ata3-slave SATA150</li>
<li><strong>Video Card:</strong><br />
NVideo GeForce 7300 LE</li>
<li><strong>Audio:</strong><br />
Intel 82801G (ICH7 Family) High Definition Audio</li>
<li><strong>Capture Cards:</strong></li>
<li>
<ul>
<li>CX2388x TV Capture Chip (DVB-T)</li>
<li>Conexant (Was: Brooktree Corp)<br />
&#8217;7610144D&amp;REV_02\4&amp;1F7DBC9F&amp;0&amp;09F0 TV Video Capture</li>
</ul>
</li>
</ul>
<p>With the hardware set and not likely to change (I refuse to buy hardware due to an O/S not working with what I&#8217;ve got), it was time to try and get things working. Whilst there is a mythtv port, it&#8217;s the old stable release of 0.18. There has been a lot of changes since then. Including the new libmythui library where groovy graphics features are available. I must admit I&#8217;m not coming in to this blind. I&#8217;ve been running mythtv under Linux for quite some time.  Hence I&#8217;m quite aware what needs to be done under Linux to get a working Mythtv setup. Hence I&#8217;ll break this article up into a number of different steps as below. Each one being a different blog entry.. some of these steps are going to take a while to get working!</p>
<ol>
<li>Setting up required ports</li>
<li>Setting up capture cards</li>
<li>Setting up audio</li>
<li>Setting up Xorg</li>
<li>Installing Mythtv</li>
<li>Configuring Mythtv</li>
<li>Tweaking Mythtv</li>
</ol>
<p>For anyone who wishes to follow this drama of getting things working below I provide some links I&#8217;ve found which useful in determining what might be possible. I also provide a little justification as to why I want Mythtv working under FreeBSD.</p>
<h2>Why the Switch?</h2>
<p>After having mythtv successfully running under various versions of ubuntu, I finally reached a point where Linux annoyed me enough to try and get rid of it in favour of FreeBSD. It&#8217;s not that Linux didn&#8217;t work, it&#8217;s just the amount of stuffing around I had to do to get things working was CRAZY! Sure installing mythtv was relatively easy but it&#8217;s all the little things that FreeBSD does so well that Linux doesn&#8217;t that made me want to change. Thinks like power management, cpu throttling, wireless that actually works!</p>
<p>These things are just easier under FreeBSD, there&#8217;s no config, overiding some config, linked to some default, using some crazy symlink farm. There&#8217;s not &#8216;volatile&#8217; kernel modules which must go through crazy loading scripts because they are not GPL compliant. FreeBSD also is much easier to upgrade in place and has the ZFS filesystem. This is the main reason I wanted to switch. I use the same machine as a backup server with 2 disks in raid 1. The ability to daily snapshot at the filesystem level is just soooo nice!</p>
<h2>FreeBSD Mythtv Links</h2>
<p>Below are some links that I found useful when getting mythtv working under FreeBSD.</p>
<ul>
<li>http://mythtv.son.org/tiki-index.php</li>
<li>http://wiki.freebsd.org/MythTV</li>
<li>http://www.lemis.com/grog/HOWTO/mythtv-on-FreeBSD-setup.html</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/mythtv-on-freebsd-the-beginning/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solving the qt4 FreeBSD install problem</title>
		<link>http://www.clearchain.com/blog/posts/solving-the-qt4-freebsd-install-problem</link>
		<comments>http://www.clearchain.com/blog/posts/solving-the-qt4-freebsd-install-problem#comments</comments>
		<pubDate>Wed, 04 Mar 2009 03:00:14 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[freebsd-g++]]></category>
		<category><![CDATA[moc]]></category>
		<category><![CDATA[qmake]]></category>
		<category><![CDATA[qt4]]></category>
		<category><![CDATA[qt4-gui]]></category>
		<category><![CDATA[qt4-moc]]></category>
		<category><![CDATA[qt4-rcc]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=291</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/solving-the-qt4-freebsd-install-problem"><img align="left" hspace="5" width="150" height="150" src="http://www.clearchain.com/blog/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Recently I&#8217;ve been trying to instal Trolltech&#8217;s Qt 4 toolkit on my FreeBSD 7.0 server.  FreeBSD supports qt4 via ports (qt4-gui, qt4-moc, qmake4, etc), hence I&#8217;ve been using the ports system to try and install it. However it kept failing with the error: ===&#62; Configuring for qt4-rcc-4.4.3 /bin/cp /data/usr/ports/devel/qt4-rcc/../../devel/qt4/files/configure /data/usr/ports/devel/qt4-rcc/work/qt-x11-opensource-src-4.4.3/src/tools/rcc/../../../ /usr/bin/sed -i.bak -e 's&#124;target.path.*&#124;target.path=/usr/local/bin&#124;g' /data/usr/ports/devel/qt4-rcc/work/qt-x11-opensource-src-4.4.3/src/tools/rcc/rcc.pro<a href="http://www.clearchain.com/blog/posts/solving-the-qt4-freebsd-install-problem"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been trying to instal Trolltech&#8217;s Qt 4 toolkit on my FreeBSD 7.0 server.  FreeBSD supports qt4 via ports (qt4-gui, qt4-moc, qmake4, etc), hence I&#8217;ve been using the ports system to try and install it. However it kept failing with the error:</p>
<pre>===&gt;  Configuring for qt4-rcc-4.4.3
/bin/cp /data/usr/ports/devel/qt4-rcc/../../devel/qt4/files/configure /data/usr/ports/devel/qt4-rcc/work/qt-x11-opensource-src-4.4.3/src/tools/rcc/../../../
/usr/bin/sed -i.bak -e 's|target.path.*|target.path=/usr/local/bin|g'  /data/usr/ports/devel/qt4-rcc/work/qt-x11-opensource-src-4.4.3/src/tools/rcc/rcc.pro
/bin/mkdir -p /data/usr/ports/devel/qt4-rcc/work/qt-x11-opensource-src-4.4.3/src/tools/rcc/../../../mkspecs
/bin/ln -sf /usr/local/bin/qmake-qt4 /data/usr/ports/devel/qt4-rcc/work/qt-x11-opensource-src-4.4.3/src/tools/rcc/../../../bin/qmake

This is the Qt/X11 Open Source Edition.

   The specified system/compiler is not supported:

      /data/usr/ports/devel/qt4-rcc/work/qt-x11-opensource-src-4.4.3/mkspecs/freebsd-g++

   Please see the README file for a complete list.

===&gt;  Script "configure" failed unexpectedly.
Please report the problem to kde@FreeBSD.org [maintainer] and attach the
"/data/usr/ports/devel/qt4-rcc/work/qt-x11-opensource-src-4.4.3/src/tools/rcc/../../..//config.log"
including the output of the failure of your make command. Also, it might be
a good idea to provide an overview of all packages installed on your system
(e.g. an `ls /var/db/pkg`).
*** Error code 1</pre>
<p>After some brief Google searching, I found the issue. It turns out that a long time ago I had been using qt4 with another project I had been working on. With this project I&#8217;d defined:</p>
<pre>setenv QMAKESPEC freebsd-g++
setenv QTDIR /usr/X11R6/</pre>
<p>This was causing the build system to break. The post at:  <a href="http://mail.kde.org/pipermail/kde-freebsd/2008-August/003360.html">http://mail.kde.org/pipermail/kde-freebsd/2008-August/003360.html</a> gave the hint about this.</p>
<p>Once I undefined QMAKESPEC everything worked as expected!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/solving-the-qt4-freebsd-install-problem/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FreeBSD VPN</title>
		<link>http://www.clearchain.com/blog/posts/freebsd-vpn-2</link>
		<comments>http://www.clearchain.com/blog/posts/freebsd-vpn-2#comments</comments>
		<pubDate>Thu, 13 Nov 2008 14:24:20 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=123</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/freebsd-vpn-2"><img align="left" hspace="5" width="150" height="150" src="http://www.clearchain.com/blog/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>FreeBSD VPN This document describes how to setup both the server side and client side for a PPTP connection with MPPE encryption that works for windows, MacOsX and other freebsd boxes. The basic process: - Install &#38; configure pptpserver on the freebsd server - Configure ppp on the freebsd server - Setup the clients 1.<a href="http://www.clearchain.com/blog/posts/freebsd-vpn-2"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<h6><span class="mw-headline">FreeBSD VPN </span></h6>
<p>This document describes how to setup both the server side and client side for a PPTP connection with MPPE encryption that works for windows, MacOsX and other freebsd boxes.</p>
<p>The basic process:</p>
<pre> - Install &amp; configure pptpserver on the freebsd server
 - Configure ppp on the freebsd server
 - Setup the clients</pre>
<h5><span class="editsection"> </span><span class="mw-headline">1. Installing pptpserver </span></h5>
<p>This part is handled really easily as it pptp server exists in the ports collections. Hence all you need to do  is:</p>
<pre> cd /usr/port/net/poptop
 make install</pre>
<p>To configure pptp modify /usr/local/etc/pptp.conf\\ Put the following lines in the file:</p>
<pre> localip 192.168.2.1
 remoteip 192.168.2.56-75

 # Listen on the outside interface only
 listen 130.220.37.202</pre>
<h5><span class="mw-headline">Configure  ppp on the freebsd server </span></h5>
<p>Edit /etc/ppp/ppp.conf and set the  following  target only:</p>
<pre>  pptp:
    set ifaddr 192.168.1.1 192.168.1.56-192.168.1.74 255.255.255.255
   set dns 192.168.0.1
    set nbns 192.168.0.1
   disable pap
   disable utmp
   disable passwdauth
   #enable chap     # MPPE Requirest chap81/MSChapV2
   enable MSChapV2
   enable mppe      # Enable Encrptions
   set log Phase Chat LCP IPCP CCP tun command  # Debugging
   set timeout 0   # Don't drop the connection</pre>
<pre>   #
   # Force 128 bit encryption with a key change every packet
   # MacOSX only works with stateless connections and the are more
   # secure anyway - just less efficient.
   set mppe 128 stateless</pre>
<pre>   # Disable compression - freebsd clients try to use it but it breaks mppe
   disable deflate pred1
   deny deflate pred1
   set server /var/run/pptp_ppp_%d "" 0700
   accept dns              # Enable clients to request dns details
   disable ipv6cp          # Disable ipv6
   enable proxy            # Enable proxying addresses on the local net for clients</pre>
<p>Now modify/create /etc/ppp/ppp.secret and put in it:</p>
<pre> someuser  userpassword  192.168.1.75</pre>
<p>Now &#8216;someuser&#8217; can log in with the password  &#8216;userpassword&#8217; and will get an IP address of 192.168.1.75. If you don&#8217;t  want to specify the ip, just leave the 3rd parameter off that line  of the file.</p>
<h5><span class="mw-headline">Setup Clients </span></h5>
<p>This section details how to setup various clients</p>
<h4><span class="mw-headline"> Windows XP </span></h4>
<pre> - Create a new VPN connection
 - Specify host
 - Specify Usename  / password
 - Hit connect</pre>
<h4><span class="mw-headline">FreeBSD </span></h4>
<p>Freebsd works  with MPPE out the box. Simply setup the following in  /etc/ppp.conf</p>
<pre> MYVPN:
   set authname someuser
   set authkey  userpassword
   disable pred1
   enable proxy
   disable ipv6cp
   set timeout 0
   add default HISADDR</pre>
<p>Install pptpclient</p>
<pre>   cd /usr/ports/net/pptpclient
   make install</pre>
<p>Now run it with:  pptp serverip MYVPN\\ ie:</p>
<pre>  pptp  130.220.37.2 MYVPN</pre>
<h4><span class="mw-headline">Mac OsX </span></h4>
<p>Simply configure the GUI tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/freebsd-vpn-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Sendmail with TLS &amp; Auth support under FreeBSD</title>
		<link>http://www.clearchain.com/blog/posts/setting-up-sendmail-with-tls-auth-support-under-freebsd</link>
		<comments>http://www.clearchain.com/blog/posts/setting-up-sendmail-with-tls-auth-support-under-freebsd#comments</comments>
		<pubDate>Thu, 13 Nov 2008 13:53:39 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[mta]]></category>
		<category><![CDATA[sasl]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[smtp auth]]></category>
		<category><![CDATA[smtps]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=110</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/setting-up-sendmail-with-tls-auth-support-under-freebsd"><img align="left" hspace="5" width="150" height="150" src="http://www.clearchain.com/blog/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>In order to setup a secure mail transport agent (MTA) that helps eliminate some spam and also allows roaming client support, some sort of authentication mechanisim must be added when setting up a MTA. In my case I&#8217;m using FreeBSD 4.9 with sendmail as my MTA. Setting Up Sendmail The first step in setting up<a href="http://www.clearchain.com/blog/posts/setting-up-sendmail-with-tls-auth-support-under-freebsd"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<p>In order to setup a secure mail transport agent (MTA) that helps eliminate some spam and also allows roaming client support, some sort of authentication mechanisim must be added when setting up a MTA. In my case I&#8217;m using FreeBSD 4.9 with sendmail as my MTA. Setting Up Sendmail</p>
<p><span id="more-110"></span></p>
<p>The first step in setting up TLS/Auth support is to install the required additional libraries. For SSL support (required by TLS) the following ports must be installed:</p>
<ul>
<li> security/cyrus-sasl</li>
<li> security/cyrus-sasl-saslauthd//</li>
</ul>
<p>These must be installed before sendmail is recompiled.</p>
<p>Sendmail in FreeBSD by default is not compiled with TLS/Auth support. In order to allow it to work with these features it must be recompiled. This is actually quite simple as long as the FreeBSD machine has the FreeBSD source collection (aka /usr/src). First you need to edit ///etc/make.conf// (//cp /etc/defaults/make.conf// if it doesn&#8217;t already exist. Edit the file so the following lines exist/are uncommented.</p>
<pre>  # with SASLv2:
  SENDMAIL_CFLAGS=-I/usr/local/include -DSASL=2
  SENDMAIL_LDFLAGS=-L/usr/local/lib
  SENDMAIL_LDADD=-lsasl2</pre>
<p>Next you need to recompile sendmail. Due to the way sendmail exists in the ports collections you must compile some of the libraries first. The following lines show the procedure for recompiling the libraries and sendmail.</p>
<ol>
<li> Compile the smutil library</li>
</ol>
<pre>  cd /usr/src/lib/libsmutil
  make clean
  make obj
  make</pre>
<ol>
<li> Compile the smlibrary</li>
</ol>
<pre>  cd /usr/src/lib/libsm
  make clean
  make obj
  make</pre>
<ol>
<li> Compile Sendmail</li>
</ol>
<pre>  cd /usr/src/usr.sbin/sendmail
  make clean
  make obj
  make
  make install</pre>
<p>At this point sendmail with TLS/Auth support is installed. Now sendmail must be configured to work with these features. Setting Up TLS Support</p>
<p>TLS stands for Transport Layer Security. It&#8217;s a bit like SSL (Socket Layer Security) in that it provides encryption between two points. The difference is that TLS provides it only in the data, SSL provides encryption of the headers as well.</p>
<p>Using TLS is a good idea. It provides encyrption for authentication purposes and also Trusted mail headers. Ie A Mail server can create a TLS connection between itself and another TLS server and this is reported in the mail headers and the mail headers are thus deemed &#8216;accurate&#8217;.</p>
<p>To setup TLS support you need to first generate a public/private key pair for use with the mail server. This is outside the scope of this document. Then you need to setup sendmail with the following options:</p>
<pre>  define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')
  define(`confCACERT_PATH', `CERT_DIR')
  define(`confCACERT', `CERT_DIR/CAcert.pem')
  define(`confSERVER_CERT', `CERT_DIR/MYcert.pem')
  define(`confSERVER_KEY', `CERT_DIR/MYkey.pem')
  define(`confCLIENT_CERT', `CERT_DIR/cert.pem')
  define(`confCLIENT_KEY', `CERT_DIR/MYkey.pem')</pre>
<p>You must set both the client and the server key so that incomming mail can be encrypted and so that outgoing mail can be encrypted.</p>
<p>Once you have set this up, restart sendmail and test it (See below) Setting Up Auth Support</p>
<p>In order to use authentication support you must first add a few options to the sendmail configuration file. Authentication is used to allow relaying from domains that are not listed as relay domains provided authentication exists. Ie: as long as the authentication is successful, then the mail server is affectivly an open relay on that connection. This is great for roaming laptop users who want to send mail but are often in a different domain or on dialup.</p>
<p>To set this up add the following to your //sendmail.mc// file:</p>
<pre>  define(`confAUTH_MECHANISMS',`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')
  TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN');</pre>
<p>This tells sendmail to support the listed authentication methods. There is also a &#8216;PLAIN&#8217; option but this should be avoided as the password is sent in plain text. Even of TLS/SSL this is not a good idea.</p>
<p>With that option in place you now have to tell sendmail what it is allowed to relay based on authentication. To allow relays to anywhere provided authentication works add the following to the access file.</p>
<pre>  From: * OK
  To: * RELAY</pre>
<p>Make sure that you rebuild the access database (run make) then restart sendmail and authentication should be enabled so test it! Extra Sendmail Configuration Options</p>
<p>It is possible and highly recommended that sendmail be setup to force TLS for authentication purposes. Otherwise sendmail will quite happily accept plain text passwords across an unencrypted data stream. This is just a big security problem. Hence adding the following line to sendmail forces the use to use TLS/SSL before authentication is possible:</p>
<pre>  define(`confAUTH_OPTIONS',`p,y')</pre>
<p><a name="Testing_it_all"></a></p>
<h5><span class="editsection"> </span> <span class="mw-headline">Testing it all </span></h5>
<p>After everything has been setup, it is extreemly important to test that the results are as expected. There are a number of tests you will want to run. These include the following: Test Test Implementation TLS Test</p>
<p>The following shows a telnet to the mail server, type the text in bold and look for the result in italics/bold</p>
<pre>  $ telnet localhost 25
  220 mail.example.net ESMTP Sendmail 8.11.1/8.11.1; Sat, 19 May 2001 08:04:04 -0400
  EHLO localhost
  250-mail.example.net Hello IDENT:jose@[127.0.0.1], pleased to meet you
  250-ENHANCEDSTATUSCODES
  250-EXPN
  250-VERB
  250-8BITMIME
  250-SIZE
  250-DSN
  250-ONEX
  250-ETRN
  250-XUSR
  250-STARTTLS
  250-DELIVERBY
  250 HELP
  Auth Test</pre>
<p>The following shows a telnet to the mail server, type the text in bold and look for the result in italics/bold</p>
<pre>  $ telnet localhost 25
  220 mail.example.net ESMTP Sendmail 8.11.1/8.11.1; Sat, 19 May 2001 08:04:04 -0400
  EHLO localhost
  250-mail.example.net Hello IDENT:jose@[127.0.0.1], pleased to meet you
  250-ENHANCEDSTATUSCODES
  250-EXPN
  250-VERB
  250-8BITMIME
  250-SIZE
  250-DSN
  250-ONEX
  250-ETRN
  250-AUTH DIGEST-MD5 CRAM-MD5
  250-XUSR
  250-STARTTLS
  250-DELIVERBY
  250 HELP</pre>
<p>You might find that the authentication methods supported don&#8217;t match what you selected. This is due to various libraries not supporting those methods of authentication.</p>
<p><a name="Open_Relay_Test"></a></p>
<h4><span class="editsection"> </span><span class="mw-headline"> Open Relay Test </span></h4>
<p><a class="external free" title="http://www.relaycheck.com" rel="nofollow" href="http://www.relaycheck.com/">http://www.relaycheck.com</a> telnet relay-test.mail-abuse.org Authentication Test On the system it should work Off the system it should require authentication</p>
<pre>  telnet server 25
  helo server
  mail from: user@server
  rcpt to: someotheruser@someotherserver</pre>
<p>This should complain about relaying being denied without authorisation if not on the local machine</p>
<p><a name="Authentication_Test"></a></p>
<h4><span class="editsection"> </span> <span class="mw-headline">Authentication Test </span></h4>
<p>With SSL &amp; Authentications Enabled You should be able to email anywhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/setting-up-sendmail-with-tls-auth-support-under-freebsd/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>iwn</title>
		<link>http://www.clearchain.com/blog/posts/iwn</link>
		<comments>http://www.clearchain.com/blog/posts/iwn#comments</comments>
		<pubDate>Sat, 08 Nov 2008 01:21:45 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[wireless]]></category>
		<category><![CDATA[802.11]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[WPA]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=85</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/iwn"><img align="left" hspace="5" width="150" height="150" src="http://www.clearchain.com/blog/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>Last Updated: 20080521054508 This page documents the current state of the IWN driver for FreeBSD, the driver supports the Intel 4965AGN Wireless Card, often found in Intel Centrino based laptops. If your looking for the driver for the 3945 chipset check out the wpi page. Note: A majorly updated version of the iwn driver has<a href="http://www.clearchain.com/blog/posts/iwn"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<div style="border: 1px solid #ffcc33; width: 50%; margin-left: 20%; margin-right: 20%; text-align: center; background-color: #ffff99;">
<p><strong>Last Updated:</strong> 20080521054508</div>
<p>This page documents the current state of the IWN driver for <a title="FreeBSD" href="http://www.clearchain.com/blog/categories/computer/freebsd">FreeBSD</a>, the driver supports the Intel 4965AGN Wireless Card, often found in Intel Centrino based laptops. <em>If your looking for the driver for the 3945 chipset check out the <a title="Wpi" href="http://www.clearchain.com/blog/posts/wpi">wpi</a> page.</em></p>
<p><span style="text-decoration: underline;"><span style="color: #ff0000;"><strong>Note: A majorly updated version of the iwn driver has been committed to FreeBSD -Current (aka 8.0). This version is greatly advanced over the perforce version. If you intend to try the perforce version under 7.0 please make sure you are running 7.0-STABLE not 7.0-RELEASE<br />
</strong></span></span></p>
<p>An up to date commentary on what I&#8217;m working on can often be found in my <a title="Blog" href="http://www.clearchain.com/blog/">blog</a> and this is a <a class="external text" title="http://www.mediawiki.org" rel="nofollow" href="http://www.mediawiki.org/">wiki</a> page so you can check the page history for what has changed</p>
<p>Details on how to help debug the driver are in README file that&#8217;s in the download package.</p>
<p>For those of you wanting to try the perforce version of the driver, the script <a title="P4fetch.rb" href="http://www.clearchain.com/~benjsc/downloads/FreeBSD/P4fetch.rb">P4fetch.rb</a> will help you easily obtain the files. The script was provided by Tom Evans.</p>
<h1><span class="mw-headline"> History </span></h1>
<ul>
<li> <strong>Iwn Committed to FreeBSD -Current (aka 8.0)</strong></li>
</ul>
<ul>
<li> Perforce Version (Not yet tarballed &#8211; available <a class="external text" title="http://perforce.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/user/benjsc/iwn" rel="nofollow" href="http://perforce.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/user/benjsc/iwn">here</a>)
<ul>
<li> Initial OpenBSD Import</li>
<li> Many locking additions</li>
<li> Lots of changes to get things working. At present, the card will talk with an unencrypted access point, pass packets but stops passing packets after a while.</li>
<li> Major overhaul by Sam Leffler</li>
</ul>
</li>
</ul>
<ul>
<li> Perforce (VAP Branch)
<ul>
<li> Major changes to support vap</li>
</ul>
</li>
</ul>
<h1><span class="mw-headline"> Installation/Testing Instructions </span></h1>
<p>At present installation of the driver is very much hands on.</p>
<p>To install the driver:</p>
<ul>
<li> Download from p4 using the scribe above</li>
<li> Read the README file</li>
</ul>
<h1><span class="mw-headline"> FAQ / Build Issues </span></h1>
<ul>
<li> No common FAQ&#8217;s as yet.</li>
</ul>
<h1><span class="mw-headline"> Outstanding issues </span></h1>
<ul>
<li> Background scanning doesn&#8217;t yet exist.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/iwn/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Frox &amp; PF</title>
		<link>http://www.clearchain.com/blog/posts/frox-pf</link>
		<comments>http://www.clearchain.com/blog/posts/frox-pf#comments</comments>
		<pubDate>Fri, 07 Nov 2008 04:17:30 +0000</pubDate>
		<dc:creator>Benjamin Close</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[pf]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://www.clearchain.com/blog/?p=62</guid>
		<description><![CDATA[<a href="http://www.clearchain.com/blog/posts/frox-pf"><img align="left" hspace="5" width="150" height="150" src="http://www.clearchain.com/blog/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>This article describes how to setup Frox to perform transparent proxying and caching via pf under FreeBSD. Contents  [hide] 1 Background 2 The Problem 3 The Setup 4 Frox PF Support 4.1 Normal Connection (No transparent proxying) 4.2 rdr connection (Transparent Proxying) 4.2.1 With Squid backend 4.2.2 Without Squid Backend 4.3 Correcting the problem 5 Installation 6 Frox PF Transparent Proxy Patch 7 Frox Config File Background Frox is a groovy<a href="http://www.clearchain.com/blog/posts/frox-pf"> <font size=-2>[..more..]</font></a>]]></description>
			<content:encoded><![CDATA[<p>This <a title="Article" href="http://www.clearchain.com/wiki/Article">article</a> describes how to setup Frox to perform transparent proxying and caching via pf under <a title="FreeBSD" href="http://www.clearchain.com/blog/categories/computers/freebsd">FreeBSD</a>.</p>
<p><span id="more-62"></span></p>
<table id="toc" class="toc" border="0" summary="Contents">
<tbody>
<tr>
<td>
<div id="toctitle">
<h2>Contents</h2>
<p> <span class="toctoggle">[<a id="togglelink" class="internal" href="javascript:toggleToc()">hide</a>]</span></div>
<ul>
<li class="toclevel-1"><span class="tocnumber">1</span> <span class="toctext">Background</span></li>
<li class="toclevel-1"><span class="tocnumber">2</span> <span class="toctext">The Problem</span></li>
<li class="toclevel-1"><span class="tocnumber">3</span> <span class="toctext">The Setup</span></li>
<li class="toclevel-1"><span class="tocnumber">4</span> <span class="toctext">Frox PF Support</span>
<ul>
<li class="toclevel-2"><span class="tocnumber">4.1</span> <span class="toctext">Normal Connection (No transparent proxying)</span></li>
<li class="toclevel-2"><span class="tocnumber">4.2</span> <span class="toctext">rdr connection (Transparent Proxying)</span>
<ul>
<li class="toclevel-3"><span class="tocnumber">4.2.1</span> <span class="toctext">With Squid backend</span></li>
<li class="toclevel-3"><span class="tocnumber">4.2.2</span> <span class="toctext">Without Squid Backend</span></li>
</ul>
</li>
<li class="toclevel-2"><span class="tocnumber">4.3</span> <span class="toctext">Correcting the problem</span></li>
</ul>
</li>
<li class="toclevel-1"><span class="tocnumber">5</span> <span class="toctext">Installation</span></li>
<li class="toclevel-1"><span class="tocnumber">6</span> <span class="toctext">Frox PF Transparent Proxy Patch</span></li>
<li class="toclevel-1"><span class="tocnumber">7</span> <span class="toctext">Frox Config File</span></li>
</ul>
</td>
</tr>
</tbody>
</table>
<p><a name="Background"></a></p>
<h1><span class="mw-headline">Background</span></h1>
<p><a class="external text" title="http://frox.sourceforge.net/" rel="nofollow" href="http://frox.sourceforge.net/">Frox</a> is a groovy little ftp-proxy which has the advantage of being able to cache the files that it proxies. Whilst there is lots of ftp proxies that help ftp through a firewall, frox is the only ftp-proxy I have found that supports caching of files.</p>
<p>Even better than that, Frox has the ability to use an external cache. Hence it&#8217;s possible to setup frox so it passes all ftp transfers to squid. This allows a dedicated cache (squid) to do the hard work with frox being merely a relay.</p>
<p>Frox also has the ability to transparently provide ftp proxying. Hence you can provide cached transparent ftp proxying without the users even knowing about it. This proves to be a great benefit in a lab where many people use ubuntu and often do <code>apt-get update</code>. The first user grabs the data, the second gets it from the cache.</p>
<p><a name="The_Problem"></a></p>
<h1><span class="mw-headline">The Problem</span></h1>
<p>Sadly whilst frox has all these features, no on has really worked on it for a number of years. Hence somethings don&#8217;t work as well as expected. Take for instance the fact I wanted transparent proxying using <em>pf</em> the [<a class="external text" title="http://www.openbsd.org" rel="nofollow" href="http://www.openbsd.org/">OpenBSD</a>] packet filter. Sadly frox doesn&#8217;t support pf.. till now</p>
<p><a name="The_Setup"></a></p>
<h1><span class="mw-headline">The Setup</span></h1>
<p>I wanted a transparent ftp proxy setup which would use my existing squid setup in order to provide caching ftp. I use pf for my firewall (FreeBSD supports: ipfw, ipfilter and pf) so it had to work with my existing firewall setup.</p>
<p>Initially I setup frox-0.7.18 and tried with both ipfw and ipfilter options enable to get transparent redirects working. I setup the following pf rule to redirect to frox:</p>
<pre># Redirect to frox on port 2121
rdr on xl0 proto tcp from $local_net to any port 21 \
        -&gt; $my_gatewaybox port 2121</pre>
<p>and the frox config file as given below. Sadly frox kept replying</p>
<pre>421 Proxy tried to loop. Closing connection</pre>
<p>I tried lots of things to no avail to fix this. Finally I sat down and looked at the code.</p>
<p><a name="Frox_PF_Support"></a></p>
<h1><span class="mw-headline">Frox PF Support</span></h1>
<p>It turns out that frox was complaining about the loop due to the destination address being the localhost/gateway box rather than actual ftp server we wanted to contact. This was due to the pf redirect. Basically the following happens:</p>
<p><a name="Normal_Connection_.28No_transparent_proxying.29"></a></p>
<h2><span class="mw-headline">Normal Connection (No transparent proxying)</span></h2>
<pre>internalhost -&gt; frox -&gt; &lt;tooltip&gt;XQXFTPXQX|XQXFile Transport ProtocolXQX&lt;/tooltip&gt; Server</pre>
<p>Frox gets a connection request:</p>
<p>Connect:</p>
<ul>
<li>From: My internal Address</li>
<li>To: This <span class="glossary" title="File Transport Protocol">FTP</span> Server</li>
</ul>
<p>All is good</p>
<p><a name="rdr_connection_.28Transparent_Proxying.29"></a></p>
<h2><span class="mw-headline">rdr connection (Transparent Proxying)</span></h2>
<p><a name="With_Squid_backend"></a></p>
<h3><span class="mw-headline">With Squid backend</span></h3>
<pre>internalhost -+ rdr
              |
              +- ftp-proxy (gateway box)
                      |
                      | External Cache (ie squid) -&gt; Ftp Server</pre>
<p>Frox gets a connection request:</p>
<p>Connect:</p>
<ul>
<li>From: internal host</li>
<li>To: gatewaybox host</li>
</ul>
<p><a name="Without_Squid_Backend"></a></p>
<h3><span class="mw-headline">Without Squid Backend</span></h3>
<pre>internalhost -+ rdr        +-&gt; &lt;tooltip&gt;XQXFTPXQX|XQXFile Transport ProtocolXQX&lt;/tooltip&gt; Server
              |            |
              +- ftp-proxy +
                      |
                      | Frox Internal cache</pre>
<p>Frox gets a connection request: Connect:</p>
<ul>
<li>From: internal host</li>
<li>To: gateway box</li>
</ul>
<p><a name="Correcting_the_problem"></a></p>
<h2><span class="mw-headline">Correcting the problem</span></h2>
<p>Now the problem is simple. Frox never sees the ftp server address that the client intended to visit if we use the pf redirect. For ipfw, this is not the issue you can use something like:</p>
<pre>ipfw fwd INTERNALGWADDRESS,2121 tcp from INTERNALNETWORK to any dst-port 21 out keep-state</pre>
<p>and ipfw only does the redirect on the &#8216;out&#8217; traffic. Hence frox sees valid information for the ftp server.</p>
<p>IPFilter works as in <code>bsd.c</code> frox has code that asks ipfilter for the external address. But frox has no code to do the same for pf.</p>
<p>Hence I worked on the code to provide the same functionality to frox for pf. The below patch is what I came up with and it works!</p>
<p><a name="Installation"></a></p>
<h1><span class="mw-headline">Installation</span></h1>
<p>To use this code:</p>
<ul>
<li>Download frox-0.7.18.tar.gz from <a class="external free" title="http://frox.sourceforge.net/" rel="nofollow" href="http://frox.sourceforge.net/">http://frox.sourceforge.net/</a></li>
<li>Extract the code <code>tar xvzf frox-0.7.18.tar.gz</code></li>
<li>Run configure <code>./configure</code></li>
<li><code>cd src</code></li>
<li>Download the patch below to the file <code>bsd.diff</code></li>
<li><code>patch &lt; bsd.diff</code></li>
<li>Compile: <code>make</code></li>
</ul>
<p>Now your done, you can use a rule like:</p>
<pre># Redirect to frox on port 2121
rdr on xl0 proto tcp from $local_net to any port 21 \
        -&gt; $my_gatewaybox port 2121</pre>
<p>in <code>pf.conf</code>, and load the rule with <code>pfctl -f pf.conf</code> to make it work.</p>
<p>How you set frox running is up to you!</p>
<p>Hope this helps someone. &#8211;<a title="User:Benjsc" href="http://www.clearchain.com/blog/people/benjamin-close">Benjsc</a> 10:25, 23 May 2007 (EIT)</p>
<p> </p>
<p><a name="Frox_PF_Transparent_Proxy_Patch"></a></p>
<h1><span class="mw-headline">Frox PF Transparent Proxy Patch</span></h1>
<p>The following patch allows frox to be used as a transparent ftp proxy with the <a class="external text" title="http://www.openbsd.org" rel="nofollow" href="http://www.openbsd.org/">OpenBSD</a> pf packet filter.</p>
<p>The full patch is available at <a class="external free" title="http://www.clearchain.com/~benjsc/download/frox/pf.patch" rel="nofollow" href="http://www.clearchain.com/~benjsc/download/frox/pf.patch">http://www.clearchain.com/~benjsc/download/frox/pf.patch</a></p>
<pre>--- bsd.c.orig  Fri Feb  4 20:54:55 2005
+++ bsd.c       Wed Jul 25 01:25:16 2007
@@ -30,6 +30,16 @@
 #error --enable-transparent-data not supported under BSD
 #endif

+#ifdef PF
+#include &lt;fcntl.h&gt;
+#include &lt;sys/ioctl.h&gt;
+#include &lt;net/if.h&gt;
+#include &lt;net/pfvar.h&gt;
+
+static int natfd;
+#endif
+
+
 #ifdef IPFILTER
 #include &lt;fcntl.h&gt;
 #include &lt;sys/ioctl.h&gt;
@@ -51,6 +61,11 @@
        if(natfd &lt; 0)
                write_log(ERROR, "Unable to initialise IPFilter");
 #endif
+#ifdef PF
+       natfd = open("/dev/pf", O_RDWR);
+       if (natfd == -1)
+               write_log(ERROR, "Unable to initialise PF");
+#endif
        return 0;
 }

@@ -61,6 +76,11 @@
 int get_orig_dest(int fd, struct sockaddr_in *addr)
 {
        socklen_t len;
+#ifdef PF
+    struct pfioc_natlook nl;
+    struct sockaddr_in from;
+    int r2;
+#endif
 #ifdef IPFILTER
        struct natlookup nat;
        struct sockaddr_in from;
@@ -99,6 +119,31 @@
                addr-&gt;sin_family = AF_INET;
                return r2;
        }
+#endif
+#ifdef PF
+       getpeername(fd, (struct sockaddr *) &amp;from, &amp;len);
+       memset(&amp;nl, 0, sizeof(struct pfioc_natlook));
+       memcpy( &amp;nl.daddr.v4, &amp;to.sin_addr.s_addr, sizeof( nl.saddr.v4 ));
+       memcpy( &amp;nl.saddr.v4, &amp;from.sin_addr.s_addr, sizeof( nl.daddr.v4 ));
+       nl.dport = to.sin_port;
+       nl.sport = from.sin_port;
+       nl.af = AF_INET;
+       nl.proto = IPPROTO_TCP;
+       nl.direction = PF_INOUT;
+
+       if ( natfd &gt; 0 ){
+           if (ioctl(natfd, DIOCNATLOOK, &amp;nl)==-1){
+               write_log(ERROR, "Failed to lookup address");
+           }
+           else {
+               memset(addr, sizeof(*addr), 0);
+               memcpy(&amp;addr-&gt;sin_addr.s_addr, &amp;nl.rdaddr.v4.s_addr, sizeof(struct sockaddr_in));
+               addr-&gt;sin_len = sizeof(struct sockaddr_in);
+               addr-&gt;sin_port = nl.rdport;
+               addr-&gt;sin_family = AF_INET;
+               return r2;
+                  }
+          }
 #endif
        memcpy(addr, &amp;to, len);
        return r1;</pre>
<p><a name="Frox_Config_File"></a></p>
<h1><span class="mw-headline">Frox Config File</span></h1>
<p>The config file to use Frox as a transparent ftp proxy with pf.</p>
<pre># $ClearChain: machines/aquila/usr/local/etc/frox.conf,v 1.2 2006/05/23 11:29:15 benjsc Exp $
# Configuration file for frox transparent ftp-proxy.

# Send SIGHUP after editing and it will be reread. This will fail
# completely if we are chrooted and the config file isn't within the
# dir we have chrooted to, or if we have dropped priveleges and no
# longer have permission to read the config file! Some options cannot
# be reread - namely those which require special privelidges (ie.
# BindToDevice, Listen, Port, TransparentData) and the caching stuff.

####################################################################
# Network Options                                                  #
####################################################################

# Address to listen on - default is 0.0.0.0 If you are using an OS other
# than Linux and are doing transparent proxying then you will need to set
# this to the IP of a local interface. If using linux you could leave it
# commented out to listen on all local IPs.
#
# Listen firewall.localnet
# Change it with your ip!
Listen 192.168.154.1

# Port to listen on. Must be supplied.
#
Port 2121

# Whether to run from inetd. You should still define Port above, but
# it isn't used for much.
#
# FromInetd yes

# Stop frox from putting itself into the background. Use this if you want
# to run frox from supervise from djb's daemontools
#
#NoDetach yes

# A hack that should allow you to get away without putting resolver libraries
# into the chroot jail. The default is fine unless for some reason you have
# this hostname in /etc/hosts. If this sort of thing offends you, you may
# comment this out and copy resolver libraries into the chroot jail instead.
# See FAQ section 3.2 for details.
#
#ResolvLoadHack wontresolve.doesntexist.abc

# Another ftp proxy to forward on to. Frox will contact this ftp
# proxy, and send it a login name of the form "user@host:port" where
# host and port are the server frox should contact. If you set
# FTPProxyNoPort then frox will send logins of the form user@host
#
# FTPProxy 192.168.2.9:2222
# FTPProxyNoPort yes

# Pick the IP frox should use for outgoing connections. You probably don't
# need this, and it is not well tested.
#
#TcpOutgoingAddr 192.168.154.1

# Pick the IP that frox should send in PASV replies to the client. Defaults
# to the address frox received the control connection on which you shouldn't
# need to change unless you are doing NAT between frox and your clients, or
# are trying to tunnel connections using frox. See FAQ.
#
#PASVAddress 192.168.0.2

####################################################################
# General Options                                                  #
####################################################################
# User and group to drop priveliges to. This must be specified - if
# you really want to run as root (not a good idea) you must say so
# specifically, and have compiled with --enable-run-as-root.
#
User nobody
Group nogroup

# This is frox's working directory - it must be specified. Temporary
# files and sockets will be created here. If you are using local
# caching then the cache will be stored in this directory too. It
# should be owned by frox with permissions 700. By default frox will
# also chroot to this dir on startup. To avoid this you must specifically
# set DontChroot to Yes.
#
WorkingDir /tmp
DontChroot Yes

# Logging level. 0=No logging. 5=Critical errors only. 10= All errors.
# 15=Errors, other important stuf. 20= Errors, connections, cache
# hits/misses 25=Debug info including text of control session. By
# default frox will log through syslog as facility daemon. If you want
# frox to log to a file instead specify this in LogFile below. You may
# set LogFile to "stderr" if you wish it to log there. XferLogging
# defaults to on, and results in a one line log entry for each file
# transferred irrespective of the log level. You can turn this off
# below.
#
# LogFile /tmp/frox.log
# XferLogging no
#LogLevel 15

# File to store PID in. Default is not to. If this file is not within
# the Chroot directory then it cannot be deleted on exit, but will
# otherwise work fine.
#
PidFile /var/run/frox.pid

####################################################################
# Ftp Protocol Options                                             #
####################################################################

# Active --&gt; Passive conversion. If set then all outgoing connections
# from the proxy will be passive &lt;tooltip&gt;XQXFTPXQX|XQXFile Transport ProtocolXQX&lt;/tooltip&gt;, regardless of the type of the
# connection coming in. This makes firewalling a lot easier. Defaults
# to no.
#
APConv yes

# Passive --&gt; Active conversion. If set then all outgoing connections
# from the proxy will be active &lt;tooltip&gt;XQXFTPXQX|XQXFile Transport ProtocolXQX&lt;/tooltip&gt;, regardless of the type of the
# connection coming in. Defaults to no.
# DO NOT USE WITH APConv!
#
#PAConv yes

# Block PORT commands asking data to be sent to ports&lt;1024 and
# prevent incoming control stream connections from port 20 to
# help depend against ftp bounce attacks. Defaults to on.
#
BounceDefend yes

# If true then only accept data connections from the hosts the control
# connections are to. Breaks the rfc, and defaults to off.
#
# SameAddress yes

# Normally frox strips out nonprintable characters from the control
# stream. This makes buffer overflow attacks on clients/servers much more
# difficult. If you download files that contain non english characters
# this may cause you problems (especially for big charsets like Chines).
# In that case turn on this option.
#
# AllowNonASCII yes

# Try to transparently proxy the data connections as well. Not
# necessary for most clients, and does increase security risks. N.V.
# You probably do _NOT_ need this option. It increases the complexity
# of what frox has to do, increases the difficulty of setting frox up
# correctly, and increases potential security risks. This has nothing
# to do with whether your clients will be transparently proxied. If
# you still want to use this option then read README.transdata for
# details.
#
# TransparentData yes

# Specify ranges for local ports to use for outgoing connections and
# for sending out in PORT commands. By default these are all between
# 40000 and 50000, but you might want to split them up if you have
# complicated firewalling rules.
#
# ControlPorts 40000-40999
# PassivePorts 41000-41999
# ActivePorts  42000-42999

# SSL/AUTH support. Frox must have been linked to the openssl libraries.
# This is currently experimental, and only tested against vsftpd
#
# UseSSL yes
# DataSSL no

####################################################################
# Caching Options                                                  #
####################################################################

# Caching options. There should be at most one CacheModule line, and
# Cache lines to give the options for that caching module. CacheModule
# is &lt;tooltip&gt;XQXHTTPXQX|XQXHyperText Transfer ProtocolXQX&lt;/tooltip&gt; (rewrites ftp requests as &lt;tooltip&gt;XQXHTTPXQX|XQXHyperText Transfer ProtocolXQX&lt;/tooltip&gt; and sends them to a &lt;tooltip&gt;XQXHTTPXQX|XQXHyperText Transfer ProtocolXQX&lt;/tooltip&gt;
# proxy like squid), or local (cache files locally). The relevant
# module needs to have been compiled in at compile time. See FAQ for
# details. If there are no CacheModule lines then no caching will be
# done. "CacheModule None" explicitly requests no caching, and is
# useful to turn off caching within a subsection (below).
#
# CacheModule local
# CacheSize 400
#
CacheModule http
HTTPProxy 127.0.0.1:3128

# MinCacheSize 65536
# ForceHTTP no  # Set to yes to force http file retreiving even if
#               # file is not cacheable
#
# StrictCaching no  # Read FAQ for details.
# CacheOnFQDN yes   # Read FAQ for details.
#
# CacheAll no   # Set to yes to cache non anonymous ftp downloads

# Virus scanning -- see FAQ
#
# VirusScanner '"/usr/bin/viruscan" "--option" "%s"'
# VSOK 0
# VSProgressMsgs 30

####################################################################
# Access control                                                   #
####################################################################

# Allow non-transparent proxying support. The user can connect
# directly to frox, and give his username as user@host:port or
# user@host. Defaults to no. NTPAddress gives the address to which
# incoming connections must be addressed if the client is to be offered
# non-transparent proxying. For most people using this it will be the same
# as the Listen address above. If not given then all connections will be
# offered non transparent proxying. If you are not using transparent
# proxying at all then you should leave NTPAddress commented out.
#
#DoNTP yes
#NTPAddress 192.168.155.1:2121

# Number of seconds of no activity before closing session
# Defaults to 300
#
# Timeout 300

#Maximum number of processes to fork.
#
# MaxForks 0 # For debugging -- only one connection may be served.
MaxForks 10

# Maximum number of connections from a single host (IP address).
MaxForksPerHost 4

# Maximum number of bytes/second to be transferred over the data
# connection for each client. MaxTransferRate limits downloads and
# MaxUploadRate uploads. CacheDlRate is the rate for downloads of files
# that are cached locally - if not set these files will be downloaded at
# full speed.
#
# MaxTransferRate 4096
# CacheDlRate 8192
# MaxUploadRate 4096

# Access control lists:
# The format is: "ACL Allow|Deny SRC - DST [PORTS]"
# a dns name, or * to match everything.
#
# PORTS is a list of ports. If specified then the rule will only match
# if the destination port of the connection is in this list. This is
# likely only relevant if you are allowing non-transparent proxying of
# ftp connections (ie. DoNTP is enabled above). Specifying * is equivalent
# to not specifying anything - all ports will be matched
#
# Any connection that matches no rules will be denied. Since there are
# no rules by default you'll need to add something to let any
# connections happen at all (look at the last example if you are
# feeling lazy/not bothered by security).
#
# # Examples:
# # Allow local network to ftp to port 21 only, and block host ftp.evil
# ACL Deny * - ftp.evil
# ACL Allow 192.168.0.0/255.255.0.0 - * 21
#
# # Allow local network to ftp anywhere except certain dodgy ports. Network
# # admin's machine can ftp anywhere.
# ACL Allow admin.localnet - *
# ACL Deny * - * 1-20,22-1024,6000-6007,7100
# ACL Allow 192.168.0.0/16 - * *
#
# # You don't really believe in this security stuff, and just want
# # everything to work.
ACL Allow * - *

# Command control program: A bit like the idea of a squid redirector.
# By default the old interface is used so as not to break existing
# installations. The new interface is much more powerful, and is
# reccommended for new scripts -- set UseOldCCP to false to use it.
# See the FAQ for details.
#
# CCProgram /usr/local/lib/frox/bin/ccp
# UseOldCCP no

####################################################################
# Subsections                                                      #
####################################################################
# Matching rules the same as ACLS. Only some options can be specified
# in a subsection (currently the yes/no options, timeout, and caching
# options).
#
# SubSection * - ftp.dodgy.server
#  StrictCaching yes
# EndSection
#
# SubSection * - 10.0.0.0/24 # A low latency high bandwidth connection
#  MinCacheSize 4096
# EndSection
#
# Subsection * - ftp.localnetwork
# # To disable caching if it has been turned on in a parent section
#  CacheModule None
# EndSection</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.clearchain.com/blog/posts/frox-pf/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

