How to Make guarddog working in Ubuntu Oneiric 11.10

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

  1. http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-qt3-1_0.6.30-0ubuntu2_amd64.deb
  2. http://archive.ubuntu.com/ubuntu/pool/universe/k/kdelibs/kdelibs-data_3.5.10.dfsg.1-5ubuntu2_all.deb
  3. http://archive.ubuntu.com/ubuntu/pool/universe/k/kdelibs/kdelibs4c2a_3.5.10.dfsg.1-5ubuntu2_amd64.deb
  4. http://archive.ubuntu.com/ubuntu/pool/universe/g/guarddog/guarddog_2.6.0-2.1ubuntu3_amd64.deb

x32

  1. http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-qt3-1_0.6.30-0ubuntu2_i386.deb
  2. http://archive.ubuntu.com/ubuntu/pool/universe/k/kdelibs/kdelibs-data_3.5.10.dfsg.1-5ubuntu2_all.deb
  3. http://archive.ubuntu.com/ubuntu/pool/universe/k/kdelibs/kdelibs4c2a_3.5.10.dfsg.1-5ubuntu2_i386.deb
  4. 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:

  1. install virtual machine software, either VMware or VirtualBox
  2. install appropriate x32/x64 VM of Ubuntu Lucid 10.04 LTS
  3. inside virtual machine issue the following commands:
    1. apt-get source guarddog
      this will download guarddog source code
    2. patch -p0<guarddog-oneiric.patch
      this will apply the necessary code changes
    3. sudo apt-get build-dep guarddog
      this will install required packages to build guarddog from source code
    4. apt-get -b source guarddog
      this will build new guarddog .DEB file that will handle kernel v3.* ok
    5. once done, copy new .DEB to host machine
  4. uninstall old guarddog .DEB, install new guarddog .DEB

Once done, you will have fully functional guarddog in Ubuntu Oneiric 11.10.

P. S.
If you do not want to take all the steps from above, you can use the packages I have built:

  1. http://www.gerixsoft.com/sites/gerixsoft.com/files/guarddog_2.6.0-2.1ubuntu3_amd64.deb
  2. http://www.gerixsoft.com/sites/gerixsoft.com/files/guarddog_2.6.0-2.1ubuntu3_i386.deb

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.