Re: [mpls-linux-general] A smaller network for label stack example
Status: Beta
Brought to you by:
jleu
|
From: James R. L. <jl...@mi...> - 2004-11-16 17:54:32
|
Lets look at the case where you want traffic from different hosts using
different LSPs:
You use iptables to differentiate the traffic from the two different hosts.
iptable -A OUTPUT -s 2.2.2.2/32 -j MARK --set-mark=2
iptable -A OUTPUT -s 3.3.3.3/32 -j MARK --set-mark=3
You then need to make sure you have a route installed for the
destination which points to a NHLFE:
ip route add 4.4.4.4/32 via 192.168.2.1 spec_nh 0x8847 0x4
Where 0x4 is the key for a NHLFE which was created like this:
mplsadm2 -A -O 0
(key 0x2)
mplsadm2 -A -O 0
(key 0x3)
mplsadm2 -A -O 0
(key 0x4)
mplsadm2 -O 0x2 -o push:gen:200:set:eth0:ipv4:192.168.2.1
mplsadm2 -O 0x3 -o push:gen:300:set:eth0:ipv4:192.168.2.1
mplsadm2 -O 0x4 -o nffwd:0xf:0x2:0x2:0x3:0x3
NOTE: the format of the nffwd command is '<mask>:<mark:nhlfe>:<mark:nhlfe>...'
Explaination:
Traffic arrives at the LER with source 2.2.2.2 and destination 4.4.4.4.
Iptables looks at the source and 'marks' the packet with 0x2.
(the mark is internal to the kernel, it is called a nfmark). The packet
continues through the IP stack. At the point of exiting the IP stack
it is redirected to MPLS via the special nexthop 0x4. In the MPLS stack
the NHLFE 0x4 looks to the nfmark on the packet and uses it to forward
it to another NHLFE, if the nfmark is 0x2 the packet is further handled
by NHLFE 0x2. NHLFE 0x2 pushes and label and send that packet.
If you would like to add another level of stacking you could do it two
different ways. Either have NHFLE 0x2 and 0x3 do multiple pushes or you
could have the fwd to another NHLFE which does a push and the final set.
The details of this are left as an excersise for the reader.
On Tue, Nov 16, 2004 at 06:26:56PM +0100, ed...@ti... wrote:
> Hi
> i'd like to set a label stack between PCLENTO1 and TOSHIBA (see the attachment)
> After my test should be this: i receive on WINDOWS traffic from 2 host (that
> represent 2 network) that is destinated to network
> linked with TOSHIBA and i would that, through my network packets are labelled
> basing on host it come from (packets from host A with a label, packets
> from
> be with an other one). How can i do this?
> I've seen label stack example on mailing list and my answer is: instruction
> for r3 in the example is for PCLENTO1, those for R4 is for TOSHIBA and
> noone
> for R2 in the example, aren't they?
> Thanks a lots for all help you give me
>
> __________________________________________________________________
> Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno!
> Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free.
> Sei libero da costi fissi e, se ti abboni entro il 25 novembre,
> navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione.
> http://abbonati.tiscali.it/adsl/
>
>
>
--
James R. Leu
jl...@mi...
|