guarddog is still missing in Ubuntu… This article will outline required steps to install guarddog in Ubuntu Oneiric 11.10/Precise 12.04 and get it working.
To get guarddog installed in Ubuntu Oneiric 11.10 you need the following packages:
x64
- http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-qt3-1_0.6.30-0ubuntu2_amd64.deb
- http://archive.ubuntu.com/ubuntu/pool/universe/k/kdelibs/kdelibs-data_3.5.10.dfsg.1-5ubuntu2_all.deb
- http://archive.ubuntu.com/ubuntu/pool/universe/k/kdelibs/kdelibs4c2a_3.5.10.dfsg.1-5ubuntu2_amd64.deb
- http://archive.ubuntu.com/ubuntu/pool/universe/g/guarddog/guarddog_2.6.0-2.1ubuntu3_amd64.deb
x32
- http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-qt3-1_0.6.30-0ubuntu2_i386.deb
- http://archive.ubuntu.com/ubuntu/pool/universe/k/kdelibs/kdelibs-data_3.5.10.dfsg.1-5ubuntu2_all.deb
- http://archive.ubuntu.com/ubuntu/pool/universe/k/kdelibs/kdelibs4c2a_3.5.10.dfsg.1-5ubuntu2_i386.deb
- http://archive.ubuntu.com/ubuntu/pool/universe/g/guarddog/guarddog_2.6.0-2.1ubuntu3_i386.deb
Note, these packages are you not required if you followed my previous article and have restored guarddog in Ubuntu Natty 11.04.
Next, if you try to use guarddog in Ubuntu Oneiric 11.10, it will say «ERROR Can’t determine the firewall command! (Is ipchains or iptables installed?)» on trying to apply your firewall configuration.
Relaunch guarddog from terminal using “sudo guarddog” command — you will notice the following dump in the console:
# Check for iptables support.
if [ -e /proc/sys/kernel/osrelease ]; then
KERNEL_VERSION=`sed "s/^\([0-9][0-9]*\.[0-9][0-9]*\).*\$/\1/" < /proc/sys/kernel/osrelease`
if [ $KERNEL_VERSION == "2.6" ]; then
KERNEL_VERSION="2.4"
fi;
if [ $KERNEL_VERSION == "2.5" ]; then
KERNEL_VERSION="2.4"
fi;
if [ $KERNEL_VERSION == "2.4" ]; then
if [ -e /sbin/iptables ]; then
FILTERSYS=2
fi;
if [ -e /usr/sbin/iptables ]; then
FILTERSYS=2
fi;
if [ -e /usr/local/sbin/iptables ]; then
FILTERSYS=2
fi;
fi;
fi;
if [ $FILTERSYS -eq 0 ]; then
echo "ERROR Can't determine the firewall command! (Is ipchains or iptables installed?)"
fi;
Quite obviously this code is: a) not handling new kernel versioning scheme b) is essentially not needed (does nothing).
To fix this you will need to recompile guarddog:
- install virtual machine software, either VMware or VirtualBox
- install appropriate x32/x64 VM of Ubuntu Lucid 10.04 LTS
- inside virtual machine issue the following commands:
- apt-get source guarddog
this will download guarddog source code - patch -p0<guarddog-oneiric.patch
this will apply the necessary code changes - sudo apt-get build-dep guarddog
this will install required packages to build guarddog from source code - apt-get -b source guarddog
this will build new guarddog .DEB file that will handle kernel v3.* ok - once done, copy new .DEB to host machine
- apt-get source guarddog
- uninstall old guarddog .DEB, install new guarddog .DEB
Once done, you will have fully functional guarddog in Ubuntu Oneiric 11.10.





Leave a Reply