WANem hard disc install & bridge setup

WANem

WANen is a Knoppix based livecd Linux system which you use to emulate wide area network links. You can enforce a certain bandwidth, delay, packet loss, jitter, and so on. Usually WANem is booted from a livecd and operates in routing mode. This short article describes howto install WANem on a hard disc and operate it in switch mode.

Hard disc install

  1. Download the WANem iso file (I used v2.2)
  2. After booting WANem, it asks you whether to configure all interface via DHCP - just say no
  3. Press ESC to quit the Network Configuration wizard without configuring anything
  4. When prompted, enter a password for the user perc
  5. You are now in the WANem shell as denoted by the WANemControl@PERC prompt. Enter exit2shell to start a normal shell
  6. Start the knx2hd program
  7. Just press OK to acknowledge both dialogs named Initialisation of Knoppix-Installation
  8. Now partition the hard disk. Select the desired hard disk by pressing the space bar and press Next
  9. WANem does not need any swap space, so partition the hard disk manually
  10. In cfdisk, select New to create a primary partition that covers the whole hard disk. Be sure to Write the new partition layout before you Quit cfdisk
  11. Now select Configure Installation and press OK
  12. For system type, choose debian which is selected by default
  13. Select your newly created partition and press Next
  14. As filesystem type, I recommend ext3
  15. The installer creates an ordinary user so that there is no need for you to login as root. This is an useless step. So just enter your whole name
  16. Enter your desired login name and press Next
  17. Enter a password for that user and enter it again
  18. Step 5 is important as you have to enter a password for the root user
  19. Now enter the full qualified hostname for your WANem machine, eg. wanem.mydomain.intra
  20. When asked where to install the bootloader, leave the default selection untouched to install it to the Master Boot Record
  21. Select Start installation and press OK
  22. Review the installation options and select and press Next
  23. The installation process may last several minutes and ignore any warnings and errors
  24. Just choose No when prompted for a floppy disk
  25. Ok, WANem is installed to your hard disk now.
  26. At the shell prompt, reboot the machine
  27. When prompted, remove the WANem cd rom and press return
  28. Now WANem boots from the hard drive
  29. Login as root
  30. Type exit2shell to launch a normal shell
  31. To no longer use the WANem shell as your login shell, edit /root/.bash_profile and remove the line ./wanem.sh
  32. Edit /etc/hosts. 127.0.0.1 should only be referenced by localhost. Add a new line that assigns the full qualified hostname and the short hostname of your WANem to its IP address, eg.:
    192.168.0.20	wanem.mydomain.intra wanem
  33. Edit /etc/resolv.conf and insert your nameservers, eg.:
    nameserver 192.168.0.5
  34. Edit /etc/network/interfaces and remove all lines below iface lo inet loopback
  35. To start the WANem web frontend during boot, do a update-rc.d apache2 defaults
  36. Start visudo and add the following line to /etc/sudoers:
    www-data        ALL=(ALL) NOPASSWD: ALL
    
    Note that this allows the user www-data to run any command as root user. As the Apache webserver runs as www-data, this might be a security risk.

Bridge setup

Edit /etc/network/interfaces and add the following lines:

auto br0
iface br0 inet static
        address 192.168.0.20
        netmask 255.255.255.0
        gateway 192.168.0.1
        bridge_ports all
        bridge_fd 0
        bridge_stp off

Routing setup

If for some reasons you have to run WANem as a router, do not add the above config regarding br0 to /etc/network/interfaces. Instead insert the following lines:

auto eth0
iface eth0 inet static
	address 192.168.0.20
	netmask 255.255.255.0
	gateway 192.168.0.1

auto eth1
iface eth1 inet static
	address 192.168.1.20
	netmask 255.255.255.0