Here is a tutorial about building a FreeBSD router with traffic shaping using OpenBSD’s PF and ALTQ HFSC discipline.

Step 1. Compile Kernel with support for PF and ALTQ
————————————————————————-

cd /usr/src/sys/i386/conf/
cp GENERIC ROUTER

edit ROUTER file and add the following lines at the end of file:

# —————— add the following lines to ROUTER file ——————
# pf support
device mem
device pf
device pflog
device pfsync

# altq support
options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_HFSC
options ALTQ_PRIQ

# other optimizations
options HZ=1000
options DEVICE_POLLING
# ———————————- eof ———————————————-

Next, compile kernel with configurations from ROUTER file

cd /usr/src
make -j4 buildkernel KERNCONF=ROUTER
make installkernel KERNCONF=ROUTER

Reboot the machine and you have support in kernel for PF and ALTQ

Step 2 Create pf.conf file for your firewall and traffic shaper Read the rest of this entry »

Installing squid30 with pf on freebsd   February 19th, 2010

Download source can be on this link http://www.squid-cache.org/Versions/v3/3.0/

after the jump, unzip the package and collect:

mkdir-p / opt / src
cp squid-3.0.STABLE12 / opt / src

cd / opt/src/squid-3.0.STABLE12

chmod + x. / configure

. / configure – prefix = / opt / squid – disable-http-violations – disable-ident-lookups – enable-pf-transparent
make & & make install Read the rest of this entry »