#5, First Floor, 4th Street , Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to install ns2 in ubuntu?
Installation of NS2 (ns-allinone-2.35) on Ubuntu 12.04
Following steps are the guide to install ns2 in windows after the ubuntu (linux) installation.
Step 1
  • Install the follwing software before installing NS2

sudo apt-get install tcl8.5-dev tk8.5-dev

sudo apt-get install build-essential autoconf automake

sudo apt-get install perl xgraph libxt-dev libx11-dev libxmu-dev


Step 2
  • Download ns2 from the following link

https://www.isi.edu/nsnam/ns/ns-build.html


Step 3
  • Extract ns-allinone-2.35.tar.gz into the home dirctory (/home/admin admin is username given in system) using the follwing command.

tar -zxvf ns-allinone-2.35.tar.gz -C /home/admin


Step 4
  • Install NS2 using the follwing command

cd /home/anupamj/ns-allinone-2.35
sudo ./install>


Step 5
  • Set PATH environment as follows

1. You MUST put /home/admin /ns-allinone-2.35/otcl-1.14, /home/admin/ns-allinone-2.35/lib, into your LD_LIBRARY_PATH environment variable.


If it complains about X libraries, add path to your X libraries into LD_LIBRARY_PATH.
If you are using csh, you can set it like: setenv LD_LIBRARY_PATH If you are using sh, you can set it like: export LD_LIBRARY_PATH=


2. You MUST put /home/admin/ns-allinone-2.35/tcl8.5.10/library into your TCL_LIBRARY environmental variable. Otherwise ns/nam will complain during startup.


Step 6
  • Modify .bahrc

vi /home/admin/.bashrc
Go to the last line and add the scripts below:
export PATH=$PATH:/home/stan/ns-allinone-2.35/bin:/home/admin/ns-allinone-2.35/tcl8.5.10/unix:/home/admin/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/admin/ns-allinone-2.35/otcl-1.14:/home/admin/ns-allinone-2.35/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/admin/ns-allinone-2.35/tcl8.5.10/library
Enable the path setting:


Step 7
  • Successful Installation of ns2 can be verified using the following command

cd ns-2.35; ./validate


Step 8