Differences between current version and predecessor to the previous major change of KnowledgeBase/FreeBSD/Pulsed.

Other diffs: Previous Revision, Previous Author

Newer page: version 4 Last edited on Sunday, 10 January 2010 13:13:59 by CyberLeo
Older page: version 3 Last edited on Thursday, 8 February 2007 14:30:27 by CyberLeo Revert
@@ -7,30 +7,30 @@
 ** GNU Make 
 ** Python 
  
 * Fetch the sources and build them. The ./configure line is identical to that from linuxConfig.sh, except without the custom CFLAGS. 
-<verbatim
+<code brush=bash
 tar zxvf pulse-gateway-1.0-src.tgz 
 cd pulse-gateway 
 ./configure --disable-lzo --without-tun --disable-ssl --prefix=/usr 
 gmake 
-</verbatim
+</code
  
 * The most important files to worry about are: 
-<verbatim
+<code
 pulse-gateway/resources/createPulseConf.py 
 pulse-gateway/resources/pulse.header 
 pulse-gateway/pulsed 
-</verbatim
+</code
  
 * Install and configure packetfilter to NAT from 10.0.0.0/8 to your uplink. 
  
 * Enable gateway in rc.conf 
  
 * Install pulsed into /usr/sbin and secure to root:wheel (750) because it will not work under a mortal UID (no perms to modify routing table). 
  
 * Patch createPulseConf.py to fix a stale route issue: 
-<verbatim
+<code brush=diff
 --- /etc/pulsed/createPulseConf.py.orig Thu Feb 8 04:56:17 2007 
 +++ /etc/pulsed/createPulseConf.py Thu Feb 8 03:50:06 2007 
 @@ -1,4 +1,4 @@ 
 -#!/usr/bin/python 
@@ -45,12 +45,12 @@
 + print " route \"delete -net 10.%s.%s.0 -netmask 255.255.255.0\";" % (bsubnet, addr) 
  print " };" 
  print "}" 
  print "" 
-</verbatim
+</code
  
 * Patch options.pulse to remove options FreeBSD pppd doesn't recognize: 
-<verbatim
+<code brush=diff
 --- /etc/ppp/options.pulse.orig Thu Feb 8 04:56:17 2007 
 +++ /etc/ppp/options.pulse Thu Feb 8 03:37:23 2007 
 @@ -1,5 +1,5 @@ 
  debug 
@@ -67,9 +67,9 @@
 +#logfile /var/log/system.log 
  bsdcomp 15,15 
  idle 60 
  name boba 
-</verbatim
+</code
 (It would also be a good thing at this point to change the ms-dns IP addresses to DNS servers that aren't part of the public Pulse network) 
  
 * Install patched createPulseConf.py into /etc/pulsed (700) 
  
@@ -77,17 +77,17 @@
  
 * Install patched options.pulse into /etc/ppp (600) 
  
 * Create /etc/pulsed/pulse-users.csv (600) and populate with users, one per line: 
-<verbatim
+<code
 user,pass 
-</verbatim
+</code
 _Caveat: Due to how the username is used, it can only consist of letters and numbers. No periods, underscores, dashes, or other punctuation or special characters._ 
  
 * cd /etc/pulsed && ./createPulseConf.py - This will rebuild /etc/pulsed/pulsed.conf and /etc/ppp/chap-secrets .. Do this every time you modify pulse.header or pulse-users.csv 
  
 * Create a simple startup script 
-<verbatim
+<code brush=diff
 --- /dev/null Thu Feb 8 05:00:00 2007 
 +++ /usr/local/etc/rc.d/pulsed Thu Feb 8 04:42:39 2007 
 @@ -0,0 +1,48 @@ 
 +#!/bin/sh 
@@ -132,10 +132,10 @@
 + killall -HUP pulsed 
 +} 
 
 +run_rc_command "$1" 
-</verbatim
+</code
  
 * Enable execution at startup by inserting 'pulsed_enable="YES"' into rc.conf. 
  
 I think that's everything... 
 -CyberLeo 

current version

http://brainmurmurs.com/products/pulse/download.php

Pulsed's installer is hopelessly linux-centric, and makes icky (and mostly invalid) assumptions about the layout of the system. The sources do compile and run on FreeBSD 6.x, though. Just ignore all their 'convenience' scripts.

  • Prerequisites (all available through ports or packages)

    • Bison
    • GNU Make
    • Python
  • Fetch the sources and build them. The ./configure line is identical to that from linuxConfig.sh, except without the custom CFLAGS.
tar zxvf pulse-gateway-1.0-src.tgz
cd pulse-gateway
./configure --disable-lzo --without-tun --disable-ssl --prefix=/usr
gmake
  • The most important files to worry about are:
pulse-gateway/resources/createPulseConf.py
pulse-gateway/resources/pulse.header
pulse-gateway/pulsed
  • Install and configure packetfilter to NAT from 10.0.0.0/8 to your uplink.
  • Enable gateway in rc.conf
  • Install pulsed into /usr/sbin and secure to root:wheel (750) because it will not work under a mortal UID (no perms to modify routing table).
  • Patch createPulseConf.py to fix a stale route issue:
--- /etc/pulsed/createPulseConf.py.orig Thu Feb  8 04:56:17 2007
+++ /etc/pulsed/createPulseConf.py      Thu Feb  8 03:50:06 2007
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/local/bin/python
 #  Copyright (C) 2006 by Brain Murmurs, Incorporated
 #  This software is furnished under a license and may be used and copied only
 #  in accordance with the terms of such license and with the inclusion of the
@@ -61,6 +61,7 @@
        print "  };"
        print ""
        print "  down {"
+       print "    route \"delete -net 10.%s.%s.0 -netmask 255.255.255.0\";" % (bsubnet, addr)
        print "  };"
        print "}"
        print ""
  • Patch options.pulse to remove options FreeBSD pppd doesn't recognize:
--- /etc/ppp/options.pulse.orig        Thu Feb  8 04:56:17 2007
+++ /etc/ppp/options.pulse      Thu Feb  8 03:37:23 2007
@@ -1,5 +1,5 @@
 debug
-dump
+#dump
 lock
 #vj-max-slots 16
 ipparam 10.3.0.0
@@ -8,7 +8,7 @@
 mtu    8192
 mru    8192
 #kdebug 7
-logfile /var/log/system.log
+#logfile /var/log/system.log
 bsdcomp 15,15
 idle 60
 name boba

(It would also be a good thing at this point to change the ms-dns IP addresses to DNS servers that aren't part of the public Pulse network)

  • Install patched createPulseConf.py into /etc/pulsed (700)
  • Install pulse.header into /etc/pulsed (600)
  • Install patched options.pulse into /etc/ppp (600)
  • Create /etc/pulsed/pulse-users.csv (600) and populate with users, one per line:
user,pass

Caveat: Due to how the username is used, it can only consist of letters and numbers. No periods, underscores, dashes, or other punctuation or special characters.

  • cd /etc/pulsed && ./createPulseConf.py - This will rebuild /etc/pulsed/pulsed.conf and /etc/ppp/chap-secrets .. Do this every time you modify pulse.header or pulse-users.csv
  • Create a simple startup script
--- /dev/null   Thu Feb  8 05:00:00 2007
+++ /usr/local/etc/rc.d/pulsed  Thu Feb  8 04:42:39 2007
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# PROVIDE: pulsed
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable postfix:
+# pulsed_enable (bool):        Set it to "YES" to enable pulsed.
+#                              Default is "NO".
+# pulsed_pidfile (path):       Set full path to pulsed.pid.
+#                              Default is "/var/run/pulsed.pid".
+#
+
+. /etc/rc.subr
+
+name="pulsed"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${pulsed_enable="NO"}
+: ${pulsed_pidfile="/var/run/pulsed.pid"}
+
+start_cmd=${name}_start
+stop_cmd=${name}_stop
+reload_cmd=${name}_reload
+extra_commands="reload"
+
+pidfile=${pulsed_pidfile}
+
+pulsed_start() {
+       /usr/sbin/pulsed -s -f /etc/pulsed/pulsed.conf
+}
+
+pulsed_stop() {
+       killall -TERM pulsed
+}
+
+pulsed_reload() {
+       killall -HUP pulsed
+}
+
+run_rc_command "$1"
  • Enable execution at startup by inserting 'pulsed_enable="YES"' into rc.conf.

I think that's everything...