We will install the Netkit open-source network simulator on an Ubuntu Linux 12.04 system that is installed on a virtual machine on my iMac. As I’ve mentioned before, running Linux in a virtual machine on a Windows or a Mac is a convenient way to experiment with different Linux systems and software. Netkit, because it uses user-mode linux as a virtualization tool, will run in a virtual machine.
This post will list the steps I followed to install Netkit. I am recording these steps for my personal reference. The Netkit web site provides detailed installation instructions.
In my case, I followed these steps to install Netkit.
- Download the Netkit files. The latest versions of these files are available on the Netkit Official Releases web page:
- Copy these files to your home directory. Then, extract all these archives inside that directory. All these archives must be extracted in the same directory. Use the Archive Manager application or the commands listed below.
List the directory in which you uncompressed the Netkit files. You will see a new directory created called netkit. This is the directory in which all Netkit files have been installed. You can now delete the archive files, if you wish.
Configure the Netkit environment variables. Information about the directory in which Netkit is installed needs to be added to the MANPATH and PATH variables. You can do this with the following commands, which should also be added to the ~/.bashrc file so you do not need to enter these commands every time you open a new shell. In my case, the Netkit files are installed in the directory, ~/netkit.
$ export NETKIT_HOME=~/netkit $ export MANPATH=:$NETKIT_HOME/man $ export PATH=$NETKIT_HOME/bin:$PATH
Also, to enable command completion of Netkit commands at the shell user prompt, add the following line to the end of the ~/.bashrc file:
$ tar -xjSf netkit-2.8.tar.bz2 $ tar -xjSf netkit-filesystem-i386-F5.2.tar.bz2 $ tar -xjSf netkit-kernel-i386-K2.8.tar.bz2
Verify the installation
Verify the Netkit installation by opening a Terminal window, going to the directory where the Netkit scripts are installed and running the verification script
$ cd $NETKIT_HOME $ ./check_configuration.sh
In my case, I saw some error messages in the script output. I am running the 64-bit version of Ubuntu Linux. So, I needed to add some 32-bit libraries for Netkit to work. If I had used the 32-bit version of Ubuntu Linux, this likely would not have been an issue.
Install 32-bit libraries
The check_configuration.sh script listed the packages I needed to install in the error message. I installed the recommended packages, ia32-libs and libc6-i386, using the Ubuntu Software Center application. Alternatively, I could have used the commands:
$ sudo apt-get update $ sudo apt-get install ia32-libs $ sudo apt-get install libc6-i386
Then I verified the installation again and the check_configuration.sh script passed with no errors.
Netkit is successfully installed on a system running Ubuntu Linux 12.04. I look forward to trying out some of the pre-configured Netkit labs in a future post.
An alternative: the Netkit DVD
Instead of installing Netkit on a system, one can just use the Netkit DVD to run a Knoppix system that the Netkit developers created with Netkit already installed. This DVD was recently updated so it has the latest version of Netkit already installed.
Burn the ISO file to a DVD or install it on a USB flash drive and boot your computer from the DVD or USB drive. You will now be running a Knoppix system with Netkit installed. Enable networking and navigate to the Netkit web site to download labs when you need them.
The Netkit DVD allows one to run a portable installation of Netkit on any computer to which one has access, without installing anything on that computer.