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
- Download the
WANem iso file (I used v2.2)
-
- Burn that iso file to a cdrom in order to boot your WANem machine. At
least, you will need a 2 GB hdd and 256 MB ram. I recommend a good pair of
nics and a 1 GHz or so CPU
- Alternatively, you might boot WANem in a virtual machine. I use VMware's
ESXi with two virtual switches, each connected to its own physical nic and to
a nic inside my WANem virtual machine
- After booting WANem, it asks you whether to configure all interface via
DHCP - just say no
- Press ESC to quit the Network Configuration wizard without configuring
anything
- When prompted, enter a password for the user perc
- You are now in the WANem shell as denoted by the
WANemControl@PERC prompt. Enter exit2shell to start a normal
shell
- Start the knx2hd program
- Just press OK to acknowledge both dialogs named
Initialisation of Knoppix-Installation
- Now partition the hard disk. Select the desired hard disk by pressing the
space bar and press Next
- WANem does not need any swap space, so partition the hard disk
manually
- 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
- Now select Configure Installation and press OK
- For system type, choose debian which is selected by default
- Select your newly created partition and press Next
- As filesystem type, I recommend ext3
- 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
- Enter your desired login name and press Next
- Enter a password for that user and enter it again
- Step 5 is important as you have to enter a password for the root user
- Now enter the full qualified hostname for your WANem machine, eg.
wanem.mydomain.intra
- When asked where to install the bootloader, leave the default selection
untouched to install it to the Master Boot Record
- Select Start installation and press OK
- Review the installation options and select and press Next
- The installation process may last several minutes and ignore any warnings
and errors
- Just choose No when prompted for a floppy disk
- Ok, WANem is installed to your hard disk now.
- At the shell prompt, reboot the machine
- When prompted, remove the WANem cd rom and press return
- Now WANem boots from the hard drive
- Login as root
- Type exit2shell to launch a normal shell
- To no longer use the WANem shell as your login shell, edit
/root/.bash_profile and remove the line ./wanem.sh
- 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
- Edit /etc/resolv.conf and insert your nameservers, eg.:
nameserver 192.168.0.5
- Edit /etc/network/interfaces and remove all lines below iface
lo inet loopback
- To start the WANem web frontend during boot, do a update-rc.d apache2
defaults
- 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