Setting Path for NS and NAM in Fedora

Setting Path for NS and NAM in Fedora

In this tutorial, we will look at how to set the path for NS and NAM in fedora.

I assume that you have already installed NS-2.34. We will create a shell script on the desktop and save it with the name ns.sh

To create a shell script, right-click on the desktop, select create documents and click the empty file.

let’s give the name of the file as ns.sh, sh is a shell script. We will open this file and edit it. The first and foremost thing is you need to provide the path to NS. The NS in my case is installed under my home directory with the NS folder. NS all in one and bin, the next we need to give the append the path for TCL and the last we need to append by path for TK, then on the next line you just try to type export path, so that this path will be added to the existing path of your system, the next part is, we need to add XGraph, again after appending XGraphs, we need to export the path, the library path also needs to be set which needs to point to for TCL directory as well as Lib directory in NS all in one.

The video below describes the entire process of Setting path for NS and NAM in Fedora.


Setting Path for NS and NAM in Fedora

The TCL library path contains the directory or the path to TCL library files, once we have created this file, let’s save this file and close it, then open a terminal, on the terminal we will use a copy command to copy ns.sh file from the desktop to the profiles folder, to do this we need to log in as a superuser using “su” and then provide the password for the root account.

If you are not logged in as a superuser you will encounter permission denied problem. Let’s type cp ns.sh space and the destination folder, which is /etc/profile.d/ns.sh

In my case the ns.sh file is on the desktop, therefore I need to go to the desktop and then execute the same copy command. if ns.sh file is already present, it will ask you to override, otherwise, it will simply copy. Now we are done, close all the terminals, if they are open and then open a new terminal and type “ns”, if you see percentage sign that means NS is installed properly as well as it can be used from any directory. Kill this process and then type “nam” you should get a network animator which will be useful for providing the simulation in graphical form.