NS2 on Ubnutu

Written by

I had a lot of trouble installing Network Simulator 2 (NS2) onto my Virtual Ubnutu 9.04 Linux install. After much work, I have created a short set of terminal scripts that will allow NS to be compiled and installed.

apt-get install -y build-essential autoconf automake libx11-dev libxmu-dev libxmu-headers libxt-dev libtool g++-4.3
cd /
wget http://downloads.sourceforge.net/project/nsnam/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fnsnam%2F&ts=1295461023&use_mirror=sunet
tar -zxvf ns-allinone-2.34.tar.gz
wget http://www.aboutcher.co.uk/files/configure
cp configure ns-allinone-2.34/otcl-1.13/
mv ns-allinone-2.34/ ns/
cd ns
export LD_LIBRARY_PATH=/ns/otcl-1.13/
export LD_LIBRARY_PATH=/ns/lib/
export TCL_LIBRARY=/ns/tcl8.4.18/library/
cd /usr/bin
ln /ns/ns-2.34/ns ns
ln /ns/nam-1.14/nam nam
cd ~
ln /ns/ns-2.34/tcl/ex/ NS\ TCL\ Examples
apt-get install -y xgraph

Just copy and paste the above code into a root terminal.
to get a root terminal type

sudo su

Hope this works for you too. This should work for newer versions of Ubuntu too.