Re: [mpls-linux-general] (off topic?) ip route...
Status: Beta
Brought to you by:
jleu
|
From: James R. L. <jl...@mi...> - 2003-06-03 15:41:01
|
You should check to make sure you have the iproute package installed
on your system:
rpm -qa | grep iproute
If not, you will need to compile a version. In the following e-mail
I explain how to compile iproute from source.
>From jl...@mi... Thu May 29 13:00:31 2003
> >If at all possible the "path of least resistence" would be having you
> >install RedHat 8.0 on your machine. Is this possible?
> >
> >> The tasks you need to do are:
> >>
> >> Create an LSP (using mplsadm2, it looks like you have figured the p=
art
> >> out, horray!)
> >> Map traffic to the LSP (using MPLS enabled versions of 'ip' or 'ipt=
ables',
> >> read the appropriate README in mpls-linux/patches)
> >> Send traffic on the LSP (by pinging a destination that has been map=
ped
> >> to the LSP)
You're very close. The problem is that even though you have compiled a
MPLS enabled version of 'ip' and 'iptables' these new versions are not
in your shells path. Type 'set' at your shell prompt and look for 'path'=
,
this are the directories that your shell looks when searching for program=
s
to execute. Lets look at an example:
[root@uml1 root]# set
<snip>
PATH=3D/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<snip>
[root@uml1 root]# which ls
/bin/ls
Whenever you type the command 'ls' your shell looks through its PATH
and tries to find the binary for the 'ls' command. In this case the
'ls' binary is found in '/bin'. Since '/bin' is in my shells PATH
it will execute the command. If I try to execute a command that is not
in my PATH it will say:
[root@uml1 root]# foo
-bash: foo: command not found
In fact typing 'which foo' explains it.
[root@uml1 root]# which foo
/usr/bin/which: no foo in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr=
/sbin:/usr/bin:/root/bin)
Now lets get to your case. There is a version of 'ip' that was installed
with RedHat 7.2. You can verify this by typing:
[root@uml1 root]# rpm -ql `rpm -qa | grep iproute`
<snip>
/sbin/ip
<snip>
[NOTE those are back ticks (`) not apostrophes (')]
[root@uml1 root]# which ip
/sbin/ip
So when I type any command that begins with 'ip' the shell will find
'ip' in /sbin/ip and use that binary.
But there is also a version you have compiled. I'll go through how I
compiled it for completness:
[jleu jleu-laptop 2:54pm] ~/personal/export/test-> ls
iproute2-2.4.7-now-ss010824.tar.gz mpls-linux-1.172.tar.gz
[jleu jleu-laptop 2:54pm] ~/personal/export/test-> tar -zxvf iproute2-2.4=
.7-now-ss010824.tar.gz
<snip>
[jleu jleu-laptop 2:54pm] ~/personal/export/test-> tar -zxvf mpls-linux-1=
.172.tar.gz
<snip>
[jleu jleu-laptop 2:55pm] ~/personal/export/test-> ls
iproute2/ mpls-linux-1.1/
iproute2-2.4.7-now-ss010824.tar.gz mpls-linux-1.172.tar.gz
[jleu jleu-laptop 2:55pm] ~/personal/export/test-> cd iproute2
[jleu jleu-laptop 2:55pm] ~/personal/export/test/iproute2-> patch -p1 < .=
./mpls-linux-1.1/patches/iproute2-mpls.diff
patching file ip/iproute.c
Hunk #1 succeeded at 53 (offset 1 line).
Hunk #3 succeeded at 278 with fuzz 2 (offset 25 lines).
Hunk #4 succeeded at 317 (offset -17 lines).
Hunk #5 succeeded at 604 (offset 26 lines).
Hunk #6 succeeded at 822 (offset -16 lines).
Hunk #7 succeeded at 1249 (offset 26 lines).
Hunk #8 succeeded at 1252 (offset -16 lines).
Hunk #9 succeeded at 1386 (offset 26 lines).
[jleu jleu-laptop 2:55pm] ~/personal/export/test/iproute2-> make
<snip>
[jleu jleu-laptop 2:56pm] ~/personal/export/test/iproute2-> ls
Config examples/ ip/ Patches/ README.iproute2+tc
doc/ include/ lib/ README RELNOTES
etc/ include-glibc/ Makefile README.decnet tc/
[jleu jleu-laptop 2:57pm] ~/personal/export/test/iproute2->
So I have a MPLS version of 'ip' right? So I can just type:
[jleu jleu-laptop 3:03pm] ~/personal/export/test/iproute2-> ip route add =
10.0.0.0/24 via 63.96.16.129 lsp 0x2
Error: either "to" is duplicate, or "lsp" is a garbage.
WRONG! (as you can see) Because by just typing 'ip' the shell is searchin=
g
the PATH. The first match it find is /sbin/ip which is NOT the version
I just compiled.
So where is the 'ip' binary I just compiled?
[jleu jleu-laptop 2:58pm] ~/personal/export/test/iproute2-> find . -type =
f -name 'ip'
./ip/ip
[jleu jleu-laptop 2:58pm] ~/personal/export/test/iproute2-> cd ip
[jleu jleu-laptop 3:01pm] ~/personal/export/test/iproute2/ip-> ls
ifcfg* iplink.c ipmroute.c iproute.c.orig Makefile rtm_map.c
ip* iplink.o ipmroute.o iproute.o routef* rtm_map.o
ipaddress.c ipmaddr.c ipneigh.c iprule.c routel* rtmon*
ipaddress.o ipmaddr.o ipneigh.o iprule.o rtacct* rtmon.c
ip.c ipmonitor.c ip.o iptunnel.c rtacct.c rtmon.o
ip_common.h ipmonitor.o iproute.c iptunnel.o rtacct.o rtpr*
[jleu jleu-laptop 3:01pm] ~/personal/export/test/iproute2/ip-> pwd
/home/jleu/personal/export/test/iproute2/ip
[jleu jleu-laptop 3:01pm] ~/personal/export/test/iproute2/ip->
Ahh. So I just complied an MPLS enabled version of 'ip'. The new binary=
is
located at '/home/jleu/personal/export/test/iproute2/ip/ip' which is _not=
_ in
my PATH. So how do I execute THAT specify version?
I can do it one of two ways:
[jleu jleu-laptop 3:04pm] ~/personal/export/test/iproute2-> /home/jleu/pe=
rsonal/export/test/iproute2/ip/ip route add 10.0.0.0/24 via 63.96.16.129 =
lsp 0x2
-or-
[jleu jleu-laptop 4:08pm] ~/personal/export/test/iproute2-> cd ip
[jleu jleu-laptop 4:09pm] ~/personal/export/test/iproute2/ip-> ./ip route=
add 10.0.0.0/24 via 63.96.16.129 lsp 0x2
I hope this helps. You can apply much of this same knowledge to 'iptable=
s'
--=20
James R. Leu
On Tue, Jun 03, 2003 at 04:19:06PM +0200, a a wrote:
> This question might be of-topic, but I'll give it a try here.
>=20
> I'm a linux newbie and have been given the task to get a mpls router up=
and=20
> running... I have followed the instructions that where in the mpls-linu=
x-1.1=20
> - pkt, but when I try the routing stuff it cant execute the command
> ip route ...
>=20
> What have I forgotten when compiling my kernel?
> Btw, I'm using rh 7.1 with a 2.4.20 kernel...
>=20
> Would be grateful for any help!
>=20
> //Drew
>=20
> _________________________________________________________________
> L=E4ttare att hitta dr=F6mresan med MSN Resor http://www.msn.se/resor/
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.net email is sponsored by: eBay
> Get office equipment for less on eBay!
> http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
> _______________________________________________
> mpls-linux-general mailing list
> mpl...@li...
> https://lists.sourceforge.net/lists/listinfo/mpls-linux-general
--=20
James R. Leu
|