Please download and test the 41 version and use it with HEAD (currently 5.99.22)
Apply mpls41.diff and tar xf mpls41-dirs.tar
Add 'options MPLS' to your kernel config file and rebuild your system.

Changes since 3x:

 * make it indeed MultiProtocol ready, by avoiding the mess in
   ip_output and ip6_output and moving all the code in if_*
   (only ethernet tested until now)
 * with this ocassion got rid on Ayame code
 * now every rtentry has associated an MPLS descriptor. This
   can be NULL or it may contain MPLS information about that
   route
 * AF_MPLS gateways are only used for pure MPLS routes. The
   sockaddr in this case are formed by sockaddr_mpls, sockaddr,
   the second one being the gateway.
 * no more tagging

TODO:
 * route and netstat output should be adapted to show MPLS routes'
   gateways in cisco style: Gateway:Label
 * LDP harsh testing (feed the routing table with 300k routes from
   Internet Global Routing Table)
 * Multiple labels prepending - maybe in future. Useful for MPLS-VPNs

HOW TO TEST:

Easiest way is to join a MPLS network, next words are considering you've
done that.

Go on your gateway and check MPLS bindings. For example on cisco you should
type: show mpls forwarding-table. Check the local tag for a route and type it
in a route on NetBSD using -tag. For example if your cisco reports in show
mpls forwarding-table:

20    24    1.2.3.0/24   ...

you should use something like this on NetBSD:

route add 1.2.3.0/24 -tag 20 <cisco_gateway>

after that you can test the setup using traceroute -M 1.2.3.1 . Route can be
verified with route get 1.2.3.0/24 - check the MPLS tag field.


Also you can use ldpd (echo ldpd=YES >> rc.conf). ldpd will establish LDP
sessions with your router and will monitor routing socket for routes that
are being added/changed etc. by other processes and automatically stick
MPLS tags into them. For the above example it will be enough to type:

route add 1.2.3.0/24 <cisco_gateway>

and ldpd should automatically change the tag to 20. This is very effective
if you use routing daemons like zebra etc.


Other route(8) commands:

 * add an MPLS route: route add -ifa 193.0.0.5 -mpls 416 -mpls 193.0.0.1:124
 * to pop a label: route add -ifa 193.0.0.5 -mpls 62 -mpls 193.0.0.1:3

Enjoy, please report bugs.

		kefren - 2009-Dec-16