HowTo Setting up redWall as a SQUID Caching Proxy

From RedWall

Jump to: navigation, search

Contents

A few considerations

  • This How to was written for the 0.5.4d release of the redWall Firewall, allthough it should still work for future releases.
  • It makes relatively little sense to store all your cache in RAM because you will loose it at every boot. It would be smarter to set up a hardisk.
  • It is not a good idea to have a totally open proxy. Some sort of user-control should be executed.
  • You need any computer with 168+ MB RAM

Getting started

  • Download redWall ISO image, burn to CD, insert into designated router and boot
  • During boot, system cannot find config info. Press Ctrl-C to enter setup mode
  • Go into setup mode, select keyboard
  • Set a secure root password
  • Yes, we would like to set up networking.
  • In my case, DHCP is fine. A static IP-address is highly recommended, however!
  • set an FQDN (hostname) for the machine.
  • After another OK, the system tries to identify a link on eth0. If it does not find one, press Ctrl-C and don't worry.
  • Quite a few services are selected from the start. Leave them as they are. Just add squid.
  • Boot continues, then log in with root and your password.
  • Go to /etc/squid/ and edit squid.conf (ViM is installed)
  • Add "http_access allow all" before whe first http_access line. As we said, we don't want proxy user control.
  • To restart squid, type "/etc/init.d/squid restart"
  • Squid is now set up to listen on port 3128. Configure your browser and test. "/var/log/squid/access.log" will reflect your activity.

Store the Cache on a HDD

As mentioned before, cache should be stored on HDD. To do that, add the following steps after step 14

  • First, check to see if there are any partitions by entering "fdisk -l"
  • Make sure there is no valuable data on you HDD. Delete any existing partition through "fdisk /dev/hda" -> d -> number as listed in above step.
  • To partition the harddisk run "fdisk /dev/hda"
  • Press n to add a new partition, it can be primary (press p) and should be number 1. The first partition is our swap partition. It should start at cylinder 1 and have adquate size. (enter 1 and then +256M)
  • The second partition can use what is left of your HDD. Press n to add another partition which will be primary as well and number 2. Accept the defaults for first and last cylinders.
  • press w to save the partition table
  • enter "mkswap /dev/hda1"
  • enter "mkfs -t ext3 /dev/hda2"
  • edit /etc/fstab by uncommenting the lines "/dev/hda1 swap..." and /dev/hda2 /var..." and commenting "tempfs /var"
  • edit /etc/squid/squid.conf "
    • cache_dir ufs /var/spool/squid MB 16 256" where MB reflects the size of the cache.
    • Default is 100 Mbytes but that seems small. Max is the size of the partition -20%!

Creating the configuration Floppy and saving the configuration

(Boot Config Media + Configuration Media)

  • Insert a floppy
  • Type "fdformat /dev/floppy/0" to format it and "mkfs /dev/floppy/0" to create the filesystem
  • Type "save-config mkboot" to create a boot config media
  • Type "save-config" to save the configuration to the just-created boot config media
  • Type "shutdown now -r" or "reboot" and test again to see if everything is fine.

Move the configuration-info to the HDD

  • Edit /etc/redwall/save-config.conf
    • change "boot_config_device=..." to "boot_config_device=/dev/discs/disc0/part2"
    • change "floppy_save=1" to "floppy_save=0"
    • change "harddisk_save=0" to "harddisk_save=1"
  • Type "save-config mkboot" to update the boot config media with the new settings in save-config.conf
  • Type "save-config" to save the configuration
Personal tools