.. _clicmd_src_vnet_mpls:

===============================================================
Mpls cli reference
===============================================================

mpls local-label
-------------------------------------------------------------------------

.. code-block:: console

    mpls local-label [add|del] <label-value> [eos|non-eos] via [next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight <value>] [preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-attached] [rx-ip4|rx-ip6 <interface>] [out-labels <value value value>]


Declaration: ``mpls_local_label_command`` `src/vnet/mpls/mpls.c line 370 <https://github.com/FDio/vpp/blob/master//src/vnet/mpls/mpls.c#L370>`_

Implementation: ``vnet_mpls_local_label``


mpls table
-------------------------------------------------------------------------

.. code-block:: console

    mpls table [add|del] <table-id>



This command is used to add or delete MPLS Tables. All
Tables must be explicitly added before that can be used,
Including the default table.

Declaration: ``mpls_table_command`` `src/vnet/mpls/mpls.c line 444 <https://github.com/FDio/vpp/blob/master//src/vnet/mpls/mpls.c#L444>`_

Implementation: ``vnet_mpls_table_cmd``


mpls tunnel
-------------------------------------------------------------------------

.. code-block:: console

    mpls tunnel [multicast] [l2-only] via [next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight <value>] [preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-connected] [rx-ip4|rx-ip6 <interface>] [out-labels <value value value>]



This command create a uni-directional MPLS tunnel



.. code-block:: console

    create mpls tunnel
    
     create mpls tunnel via 10.0.0.1 GigEthernet0/8/0 out-label 33 out-label 34
    



Declaration: ``create_mpls_tunnel_command`` `src/vnet/mpls/mpls_tunnel.c line 932 <https://github.com/FDio/vpp/blob/master//src/vnet/mpls/mpls_tunnel.c#L932>`_

Implementation: ``vnet_create_mpls_tunnel_command_fn``


set interface mpls
-------------------------------------------------------------------------

.. code-block:: console

    Enable/Disable an interface for MPLS forwarding



This command enables an interface to accept MPLS packets



.. code-block:: console

    set interface mpls
    
     set interface mpls GigEthernet0/8/0 enable
    



Declaration: ``set_interface_ip_table_command`` `src/vnet/mpls/interface.c line 159 <https://github.com/FDio/vpp/blob/master//src/vnet/mpls/interface.c#L159>`_

Implementation: ``mpls_interface_enable_disable``


show mpls interface
-------------------------------------------------------------------------

.. code-block:: console

    Show MPLS interface forwarding



This command displays the MPLS forwarding state of an interface



.. code-block:: console

    show mpls interface
    
     set mpls interface GigEthernet0/8/0
    



Declaration: ``show_mpls_interface_command`` `src/vnet/mpls/interface.c line 228 <https://github.com/FDio/vpp/blob/master//src/vnet/mpls/interface.c#L228>`_

Implementation: ``show_mpls_interface``



This command to show MPLS tunnels



.. code-block:: console

    sh mpls tunnel 2
    
    [@2] mpls_tunnel2: sw_if_index:5 hw_if_index:5
     label-stack:
       3,
     via:
      index:26 locks:1 proto:ipv4 uPRF-list:26 len:1 itfs:[2, ]
        index:26 pl-index:26 ipv4 weight=1 attached-nexthop:  oper-flags:resolved,
         10.0.0.2 loop0
            [@0]: ipv4 via 10.0.0.2 loop0: IP4: de:ad:00:00:00:00 -> 00:00:11:aa:bb:cc
    



Declaration: ``show_mpls_tunnel_command`` `src/vnet/mpls/mpls_tunnel.c line 1036 <https://github.com/FDio/vpp/blob/master//src/vnet/mpls/mpls_tunnel.c#L1036>`_

Implementation: ``show_mpls_tunnel_command_fn``