Usage¶
In this section, it is assumed that Virtual Accelerator has been properly installed and configured. See Getting Started for more details.
With Linux - Fast Path Synchronization you can manage MPLS via standard Linux commands.
Synchronizing Linux and the fast path¶
Load required modules:
# modprobe mpls_router # modprobe mpls_iptunnel
Managing MPLS routes from Linux¶
The Linux commands below allow you to manage MPLS routing.
Enabling MPLS forwarding on the system¶
# sysctl -w net.mpls.platform_labels=LABEL
- LABEL
Higher label value allowed in the routing table. More details here: https://www.kernel.org/doc/Documentation/networking/mpls-sysctl.txt
Enabling MPLS input on an interface¶
# sysctl -w net.mpls.conf.IFNAME.input=1
- IFNAME
Interface’s name. More details here: https://www.kernel.org/doc/Documentation/networking/mpls-sysctl.txt
Adding an MPLS ‘pop’ route entry¶
# ip -f mpls route add IN_LABEL via INET ADDR dev IFNAME
- IN_LABEL
Input label to pop.
- INET
Family of the nexthop: inet for IPv4 or inet6 for IPv6.
- ADDR
IP nexthop address.
- IFNAME
Interface name of the output interface.
Example
Add a route to forward and pop packet with label 123 via 1.2.3.4@eth0.
# ip -f mpls route add 123 via inet 1.2.3.4 dev eth0
Adding an MPLS ‘swap’ route entry¶
# ip -f mpls route add IN_LABEL as OUT_LABELS via INET ADDR dev IFNAME
- IN_LABEL
Input label to swap.
- OUT_LABELS
One or more output labels. In case of multiple output labels, they are separated by a ‘/’.
- INET
Family of the nexthop: inet for IPv4 or inet6 for IPv6.
- ADDR
IP nexthop address.
- IFNAME
Interface name of the output interface.
Example
Add a route to forward packet with label 123 via 1.2.3.4@eth0 and swap the label 123 by the label 456.
# ip -f mpls route add 123 as 456 via inet 1.2.3.4 dev eth0
Adding an MPLS ‘push’ route entry¶
# ip route add SUBNET nexthop encap mpls OUT_LABELS via INET ADDR dev IFNAME
- SUBNET
Subnet target of the route.
- OUT_LABELS
One or more output labels. In case of multiple output labels, they are separated by a ‘/’.
- INET
Family of the nexthop: inet for IPv4 or inet6 for IPv6.
- ADDR
IP nexthop address.
- IFNAME
Interface name of the output interface.
Example
Add a route to forward packets destinated to 10.0.0.0/8 through mpls with the label 789 via 1.2.3.4@eth0.
# ip route add 10.0.0.0/8 nexthop encap mpls 789 via inet 1.2.3.4 dev eth0
Note that an iproute2 v4.4.0 (iproute2-ss160111) is needed.
Displaying information about the MPLS routing table¶
# ip -f mpls route
Deleting an MPLS route entry¶
# ip -f mpls route del IN_LABEL
- IN_LABEL
Input label of the route to delete.
Managing MPLS routes from the fast path¶
The fp-cli
command below allows you to manage MPLS routes from the fast path.
Displaying MPLS routes¶
mpls
Example
<fp-0> mpls
R[000001] vrfid 0 label [200] via inet 10.200.0.1 dev ntfp2-vr0
R[000002] vrfid 0 label [300] as [400] via inet 10.200.0.1 dev ntfp2-vr0
Providing options¶
Some capabilities can be tuned for this module.
Example
FP_OPTIONS="--mod-opt=mpls:--mpls-max-rt=512"
- --mpls-max-rt¶
Maximum number of mpls routes.
- --mpls-rt-hash-order¶
Order of the mpls route hash table. The value must be a power of 2.
- --mpls-max-labels¶
Maximum number of stacked mpls labels.
- --mpls-max-lwt¶
Maximum number of lwtunnel mpls routes.