Installing a firewall on Debian (Lenny)

OK, I do know that ‘ufw’ isn’t actually a firewall in itself but I do find it useful and as some of you may have spotted I’m still using Debian (Lenny) on my Alphaserver.

Having decided I needed to rebuild my Alphaserver I discovered (and probably not for the first time) that while ‘ufw’ isn’t included in the official Debian repositories it is still possible to install the ufw package from the Ubuntu (Gutsy Gibbon) as the package is not processor architecture specific.

Note – When you come to create the firewall rules you need to be aware that this version does not allow you to specify a range of ports, so if you want to open up all the ports in the range 6000-6005 you will need a separate rule for each one.

Before we start we need to be logged in as root.

su
Password:
#

Having found the package all we will need to do is download it using ‘wget’ and then install it using ‘dpkg’.

wget http://old-releases.ubuntu.com/ubuntu/pool/main/u/ufw/ufw_0.16.2_all.deb
Resolving old-releases.ubuntu.com... 91.189.88.41, 2001:67c:1360:8001::25
Connecting to old-releases.ubuntu.com|91.189.88.41|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22842 (22K) [application/x-debian-package]
Saving to: `ufw_0.16.2_all.deb'
 
100%[=======================================>] 22,842      --.-K/s   in 0.004s
`ufw_0.16.2_all.deb' saved [22842/22842]
 
dpkg -i ufw_0.16.2_all.deb
Selecting previously deselected package ufw.
(Reading database ... 42296 files and directories currently installed.)
Unpacking ufw (from ufw_0.16.2_all.deb) ...
Setting up ufw (0.16.2) ...
 
Creating config file /etc/ufw/before.rules with new version
 
Creating config file /etc/ufw/before6.rules with new version
 
Creating config file /etc/ufw/after.rules with new version
 
Creating config file /etc/ufw/after6.rules with new version
Processing triggers for man-db ...
#

That should be all there is to do, but since we are not using ‘apt’ the installation will fail if any of the dependencies are missing.

dpkg -i ufw_0.16.2_all.deb
Selecting previously deselected package ufw.
(Reading database ... 12267 files and directories currently installed.)
Unpacking ufw (from ufw_0.16.2_all.deb) ...
dpkg: dependency problems prevent configuration of ufw:
 ufw depends on python (>= 2.5); however:
  Package python is not installed.
 ufw depends on ucf; however:
  Package ucf is not installed.
dpkg: error processing ufw (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db ...
Errors were encountered while processing:
 ufw
#

If this happens we can use ‘apt’ to install the missing dependencies (and the package).

apt-get install -f --no-install-recommends
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies...Done
The following extra packages will be installed:
  libdb4.5 libsqlite3-0 mime-support python python-minimal python2.5 
  python2.5-minimal ucf
Suggested packages:
  python-doc python-tk python-profiler python2.5-doc binfmt-support
Recommended packages:
  file
The following NEW packages will be installed
  libdb4.5 libsqlite3-0 mime-support python python-minimal python2.5 
  python2.5-minimal ucf
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 5385kB of archives.
After this operation, 18.8MB of additional disk space will be used.
Do you want to continue [Y/n]?
  :
  :
  :
Setting up ufw (0.16.2) ...
 
Creating config file /etc/ufw/before.rules with new version
 
Creating config file /etc/ufw/before6.rules with new version
 
Creating config file /etc/ufw/after.rules with new version
 
Creating config file /etc/ufw/after6.rules with new version
Processing triggers for man-db ...

We can now continue and set up the firewall rules as normal.

Note – On my server I found that the system needed to be rebooted for any changes to take effect – not ideal but it does appear to work..!

Advertisements
This entry was posted in Debian, Security and tagged , . Bookmark the permalink.

2 Responses to Installing a firewall on Debian (Lenny)

  1. psychocod3r says:

    I used Lenny back in the day when I was first trying out Linux. It was the second Linux OS I tried after Knoppix. I wasn’t aware there were people still using it. There’s been at least four Toy Story characters since then.

    • mike632t says:

      Five if you include Buster! Unfortunatly suport for Alpha was dropped in subsiquent releases…

      (Think the first version of Debian I installed was Woody).

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.