Diff for /wikisrc/users/kefren.mdwn between versions 1.3 and 1.5

version 1.3, 2010/07/04 20:11:59 version 1.5, 2011/01/06 13:01:36
Line 1 Line 1
 #Some quick info about MPLS:  # My playground
 You need to compile your kernel with options MPLS and psuedo-device ifmpls  [[MPLS]] quickstart<BR>
 For pure LSR - that only switch labels without encap/decap from other protocols (e.g. INET) you need only to work on routing table. For example:  [[LDP]] quickstart<BR>
 <pre># route add -mpls 41 -tag 25 -inet  [[Code bounties]]<BR>
 add host 41: gateway  
 # route add -mpls 42 -tag 30 -inet  
 add host 42: gateway  
 # route add -mpls 51 -tag 25 -inet  
 add host 51: gateway</pre>  
 Translation of first line: if it receives an MPLS frame with label 41 forward it to INET next-hop, tagged with label 25  
 You also need to tweak sysctl to accept and forward MPLS:  
 <pre># sysctl -w net.mpls.accept=1  
 net.mpls.accept: 0 -> 1  
 # sysctl -w net.mpls.forwarding=1  
 net.mpls.forwarding: 0 -> 1</pre>  
 Verify routes with route get or better with netstat -nrT:  
 Destination        Gateway            Flags    Refs      Use    Mtu     Tag Interface  
 41             UGHS        0    37241      -      25 sk0  
 42             UGHS        0        0      -      30 sk0  
 51             UGHS        0        0      -      25 sk0  
 #Interacting with other protocols  
 If you want to also decapsulate/encapsulate from MPLS to some other protocol (like INET or INET6), you have to create an mpls interface and put in up: ifconfig mpls0 create up. YOU NEED TO ADD AN ADDRESS OF THAT PROTOCOL ON THIS INTERFACE - whenever that address is private or not.  
 E.g. for INET - setting a fictitious address:  
 # ifconfig mpls0 create up  
 # ifconfig mpls0  
 After that create routes like this - use -ifa flag in order to avoid self-generated packets having source address, but route them thru mpls0 interface.  
 # route add -ifa -ifp mpls0 -tag 25 -inet  
 add net gateway  
 Verify the route:  
 # route -n get  
    route to:  
         Tag: 25  
  local addr:  
   interface: mpls0  
       flags: <UP,GATEWAY,DONE,STATIC>  
  recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire  
        0         0         0       813       344         0         0         0   
 or with netstat -rT:  
 204.152.190/24      UGS         0    95362      -      25 mpls0  
 I'm working on [[ LDP ]] daemon, it should be available in a couple of weeks.  

Removed from v.1.3  
changed lines
  Added in v.1.5

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb