Precautions for installing NS2.

Source: Internet
Author: User
1. The installation environment of this experiment: The RedHat9.0 operating system is fully installed, and the installation package is ns-allinone-2.29. Login. 3. log on to RH9 as root, create an ns2folder under/home, and put ns-allinone-2.29.tar.gz in this folder. Run cd/home/NS2. run the decompress command tarxvfz on the terminal.

1. The installation environment of this experiment: The RedHat 9.0 operating system is fully installed, and the installation package is ns-allinone-2.29.

2. Download The ns2installation Software Package ns-allinone-2.29.tar.gz from the official website.

3. log on to RH9 as root, create an ns2folder under/home, put ns-allinone-2.29.tar.gz in this folder, run cd/home/NS2. run the unzip command tar xvfz ns-allinone-2.29.tar.gz to generate/home/NS2.

4. Modify row 73rd in/home/ns2-ns-allinone-2.9/nam-1.11/agent. h and change NULL to 0.

5. Run in/home/ns2-ns-allinone-2.9. /Install

6. copy some paths according to the prompts at the end of the installation, or directly follow the instructions below (you can understand them as prompted ):

7. Modify/root/. bashrc (note that the file is a hidden file) and add the following three sentences at the end of the file:

Export

PATH = $ PATH:/home/collecting/ns-allinone-2.29/bin:/home/collecting/ns-allinone-2.29/tcl8.4.11/unix:/home/collecting/ns-allinone-2.29/tk8.4.11/unix

Export

LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/home/NS2./ns-allinone-2.29/otcl-1.11:/home/NS2./ns-allinone-2.29/lib

Export

TCL_LIBRARY = $ TCL_LIBRARY:/home/int32/ns-allinone-2.29/tcl8.4.11/library

Enter the command "source. bash_profile" in the root path to update the environment variables.

8. in this case, if the preceding settings are correct, % will appear when running ns directly, or you can run the built-in software example, run ns example2.tcl in/home/ns2-ns-allinone-2.29/ns-2.29/ns-tutorial/examples

9. You can select to execute./validate to verify whether the installation is successful (time-consuming !)

Note:

1. After modifying/root/. bashrc, you can enter echo $ PATH on the newly opened terminal to check whether the paths have been added. If yes, it will be displayed. Note that the 'expires' command can only change the variables in the current terminal and the terminal that will run later. Www.linuxidc.com does not work for running terminals.

2. In this example, the ns simulation software is installed under/home/NS2. this path can be changed to the path where you want to install ns.

3. If the PATH is not added, run source. bashrc under/root/to obtain the environment variable settings again. Under normal circumstances, if you follow the above modification in/root. The bashrc file is successful. Some other methods are to create a new one in the ns installation path. Add the three export statements to the bashrc file. Run source. bashrc to run the ns command on the terminal. However, this command is only valid on the terminal and will not work on the terminal that will run later.

The following is a very important issue that I personally experienced. After a long time, I found that it was actually very easy to solve:

When adding the preceding three sentences to. bashrc, note that there cannot be any blank lines between the three sentences and the original content. Otherwise, not only will the path be added, but the command not found will also appear when the terminal is opened.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.