Building custom packages for pfSense
-
Hi,
I've have been looking for something about building my own packages for pfSense. More specifically I wan't to install softflowd, and as there is no packages out there for pfSense, I have to build one myself. I'm just not sure where to start. I've been looking at the wiki about making my own dev environment, but I can't find anything that can push me in the right direction. It's properly because of lack of skills from my side, so I was hoping someone here, could be kind enough to tell mere where to look for information about this.
Best regards,
Daniel -
I'm interested too. Have been looking thrue the forum too, but I'm lost like you.
-
First. softflowd seems related to pfflowd which already is available as a package.
IMO the way to get started is to copy the work of others.
Get to know the FreeBSD part of a pfSense package
1. Start with a small package, darkstat, vnstat etc. not squid or freeswitch
2. SSH to your dev pfsense pc. press 8 for shell and pkg_add -r the freebsd package (I use http://portsmon.freebsd.org/portoverview.py for freebsd package info)
3. Configure it and run itGet to know how the structure behind the package system works
1. Read http://doc.pfsense.org/index.php/Developing_Packages ( I have a free website at http://www.000webhost.com/ that I use as remote server )
2. Download the already created package, you'll find it at http://redmine.pfsense.org/repositories/browse/pfsense-packages/config and edit it so it fits your setup.
3. Download the latest pkg_config http://redmine.pfsense.org/repositories/entry/pfsense-packages/pkg_config.7.xml?format=raw copy the part of the already created package to your own pkg_config.xml and edit it so it fits your setup. -
Thanks for your reply on this. I've been trying to get pfflowd to work, but it seems that it's only counting incomming traffic.
I diffently can't get an accurate output from pfflowd so far. I have softflowd running on anohter standard FreeBSD 7.1 with pf, wihtout any counting problems.
Anyway, that is a totaly different issue.The dev pfsense pc you are referring to, is that just a normal pfSense ver. 1.2.2 for example ? And where does the compile process take place ?
I can't quite figure how the build process is. From what I can read from this link: http://doc.pfsense.org/index.php/Developing_Packages, I need my own pakcage repo which I have to place on a webserver. Download the softflowd package source from FreeBSD and place it in my local package repo. Then I need to set up my test pfSense to my local package repo, and I will be able to see the new package I want to build. Am I close or far away from my goal ? -
The dev pfsense pc you are referring to, is that just a normal pfSense ver. 1.2.2 for example ?
Correct. I would use the latest 1.2.3 rc3 snapshot.
And where does the compile process take place ? I can't quite figure how the build process is.
It might just be a playing with words thingy but compile and build is so FreeBSD.
The basic idea behind pfSense packaging system is to install the normal FreeBSD packages, but keep the configuration inside the pfSense xml.
From what I can read from this link: http://doc.pfsense.org/index.php/Developing_Packages, I need my own pakcage repo which I have to place on a webserver. Download the softflowd package source from FreeBSD and place it in my local package repo. Then I need to set up my test pfSense to my local package repo, and I will be able to see the new package I want to build. Am I close or far away from my goal ?
Your more ahead, than what you should be :) no point in working with the pfSense package system if you can't make it work under shell.
So start with pkg_add -r softflowd -
Okay, I'am with what you think. So compiling my own package from source it out of the question.
Well, after I messed around with different versions of FreeBSD softflowd packages, I managed to get this ( ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.2-release/net-mgmt/softflowd-0.9.8.tbz ) version to work under pfSense ver. 1.2.2 and 1.2.3 RC1 without any modifications.Thanks for all the help.
Best Regards,
Daniel -
Well, after I messed around with different versions of FreeBSD softflowd packages, I managed to get this ( ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.2-release/net-mgmt/softflowd-0.9.8.tbz ) version to work under pfSense ver. 1.2.2 and 1.2.3 RC1 without any modifications.
Hey Daniel, I have been trying to get pfflowd to work as well with 1.2.3-RC3 lately, but I am having issues (can't even get the service to start). Anyway, just curious if you could talk me through getting softflowd to work as you did?
Thanks in advance. Any help is appreciated.Aaron
-
Hi Aaron,
The softflow package is not a part of pfSense, and because of that you can't install it through the package manager in pfSense.
You will have to install softflowd as a package using the freebsd package system "pkg_add" Are you familiar with that ?What kind of netflow collector are you planing to use ?
Best Regards,
Daniel -
Unfortunately I am not very experienced with Linux/BSD, learning slowly as I go. So, I need to download pkg_add to the pfsense itself, assume in shell mode? Just reading the page now…
I am using Solarwinds Orion to collect NetFlow and sFlow data from other devices right now, would like to use it with pfSense as well.
Edit - nevermind, I see pkg_add is already included in FreeBSD? That's the problem with replying when I'm only half way through reading... :-\
-
Hey Daniel, I'm having a little problem. I have the package installed, and I can list the files it installed:
/usr/local/sbin/softflowd
/usr/local/sbin/softflowctl
/usr/local/man/man8/softflowd.8.gz
/usr/local/man/man8/softflowctl.8.gz
/usr/local/share/doc/softflowd/READMEI have read the readme, and it references files that don't exist (/usr/bin/nroff). And I can't open the listed manual pages - maybe I'm going about this the wrong way, trying to extract with 7-zip? I get an error that the .8 files are broken. But at this point I'm not sure how to configure the package.
If I reference the readme and run the command: _/usr/local/man/man8 -c -mandoc softflowd.8 | les_s I get a permission denied error.
Thanks again for your help.
Aaron
-
OKay, I've done a lot of Googling and reading today (in between meetings). I finally found this - http://tfm.cz/man/8/softflowd which has been a huge help. For some silly reason I also did not think of just entering the package name (softflowd) and hitting enter - which, of course, brings up the correct syntax dialog. ::)
I am now exporting flow data as I should be…. I think. My Solarwinds collector doesn't seem to be recognizing or doing anything with the packets it is getting. But that is for another forum...
Thanks again for the help.
Aaron