Add tunnel type bareudp
The Bareudp tunnel module provides a generic L3 encapsulation support for tunneling different L3 protocols inside a UDP tunnel, like MPLS, IP, NSH, etc.
Device creation & deletion
ip link add dev bareudp0 type bareudp dstport 6635 ethertype 0x8847
This creates a bareudp tunnel device which tunnels L3 traffic with ethertype
0x8847 (MPLS traffic). The destination port of the UDP header will be set to 6635
The device will listen on UDP port 6635 to receive traffic.
ip link delete bareudp0
Device creation with extended mode enabled
There are two ways to create a bareudp device for MPLS & IP with extended mode
enabled.
a)
ip link add dev bareudp0 type bareudp dstport 6635 ethertype 0x8847 extmode 1
b)
ip link add dev bareudp0 type bareudp dstport 6635 ethertype mpls
https://man7.org/linux/man-pages/man8/ip-link.8.html
https://www.rfc-editor.org/rfc/rfc7510
https://docs.kernel.org/networking/bareudp.html
https://lwn.net/Articles/804780/