Obtaining and Compiling IPROUTE2

   

Obtaining and Compiling IPROUTE2

The ip utility is just one of the utilities in the IPROUTE2 utility package from Alexey Kuznetsov. The primary FTP site is located in Russia at ftp://ftp.inr.ac.ru/ip-routing/ , and mirrors exist all over the world. You will need to obtain the latest package, usually called iproute2-current.tar.gz , symlinked to the latest dated version. The version covered here is the 2000-10-07 version of IPROUTE2. Note that unless you have a custom compiled kernel with all of the advanced routing elements selected, most of the here examples here and in the rest of the book will not work. See Appendix B, "Source Code Listings and Locations," for the options you will need in your kernel.

Once you have the utility, you need to unpack it into whatever directory you use for compiling source code. The default is to use /usr/src . When you have the package untarred, you can enter the directory iproute2 and just type make . You must have the kernel source code that was used to compile your current running kernel located in /usr/src/linux .

After you have typed make , the utility suite will compile. There is no install target for make so you will have to manually install the ip utility. The ip utility, as with all of the utilities in this package, should be installed into the /sbin directory. This is so that they are available even before your /usr directory is mounted. There is also a /etc/iproute2 directory in the package that contains sample definition files. If you do not have a /etc/iproute2/ directory on your system, create one and copy the contents of the package directory to the new directory. If an /etc/iproute2/ directory exists and you do not know what it is being used for, you will want to find out if the files in that directory have some meaning to the system you are running. If not, replacing them with the files in the package directory will not hurt. Of course if you are ever unsure, back up the old files.

In a nutshell , you want to perform the following steps:

  1. Compile the utilities by typing make .

  2. Check /etc/iproute2/ with ls -l /etc/iproute2 .

  3. If needed, create /etc/iproute2/ with mkdir/etc/iproute2/ .

  4. Populate it with cp ./etc/iproute2/* /etc/iproute2/ .

  5. Change into the ip directory with cd ip .

  6. cp ifcfg ip routef routel rtacct rtmon rtpr /sbin .

  7. Change into tc directory with cd ../tc .

  8. Copy it with cp tc /sbin .

This will compile the utility and copy the configuration files and the executables into the appropriate directories. You should now be able to execute the ip utility from anywhere on the system by typing ip . To test and see if this worked, type ip addr and you should get a list of the interfaces and addresses on your system.


   
Top


Policy Routing Using Linux
Policy Routing Using Linux
ISBN: B000C4SRVI
EAN: N/A
Year: 2000
Pages: 105

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net