Difference between revisions of "ONE/Command-line Interface CLI Guide"

From fd.io
< ONE
Jump to: navigation, search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
TBD
 
 
 
 
== Introduction ==
 
== Introduction ==
 
The vpp contain a set of commands to set and debug LISP.
 
The vpp contain a set of commands to set and debug LISP.
One way to access the CLI (with proper permissions) is to use the <tt>vpp_api_test</tt> command or use telnet CLI:
+
Access VPP's CLI over telnet, assuming <tt>cli-listen localhost:5002</tt> is configured under <tt>unix{}</tt> in the startup.conf, with:
 
+
 
<pre>
 
<pre>
sudo vpp_api_test
+
telnet 0 5002
 
</pre>
 
</pre>
  
 +
== Telnet LISP CLI a.k.a debug CLI ==
 +
Following is a list of CLI commands used by LISP.
  
== Telnet LISP CLI ==
+
=== Enabling LISP ===
 +
For turning on LISP functionality type:
 +
<pre>
 +
vpp# lisp enable
 +
</pre>
  
=== Lisp GPE enable ===
+
...and this will disable LISP
To enable lisp, use "lisp gpe":
+
 
<pre>
 
<pre>
vpp# lisp gpe enable
+
vpp# lisp disable
 
</pre>
 
</pre>
  
To disable lisp
+
To display LISP status use
 
<pre>
 
<pre>
vpp# lisp gpe disable
+
vat# show lisp status
 +
feature: enabled
 +
gpe: enabled
 +
</pre>
 +
where 'feature' field show status of LISP - both control plane and dataplane. 'gpe' is dataplane status indicator which can be enabled/disabled with its own set of commands:
 +
<pre>
 +
vat# lisp gpe enable
 +
vat# lisp gpe disable
 
</pre>
 
</pre>
  
=== Locator_set ===
+
=== Locator set ===
To add new locator_set and locator, use "lisp locator-set add":
+
To add new locator set and assigning locator(s) to it use "lisp locator-set add":
 
<pre>
 
<pre>
 
vpp# lisp locator-set add ls1 iface host-intervpp1 p 1 w 1
 
vpp# lisp locator-set add ls1 iface host-intervpp1 p 1 w 1
Line 31: Line 39:
 
Where <tt>p</tt> is <tt>priority</tt> and <tt>w</tt> is <tt>weight</tt>.
 
Where <tt>p</tt> is <tt>priority</tt> and <tt>w</tt> is <tt>weight</tt>.
  
To delete a specific locator_set, use "lisp locator-set del"
+
To delete a specific locator set, use "lisp locator-set del"
 
<pre>
 
<pre>
 
vpp# lisp locator-set del ls1
 
vpp# lisp locator-set del ls1
 
</pre>
 
</pre>
  
To display locator_set and locator:
+
To display current locator sets and their locators:
 
<pre>
 
<pre>
 
vpp# show lisp locator-set
 
vpp# show lisp locator-set
Line 43: Line 51:
 
</pre>
 
</pre>
  
=== Eid ===
+
=== Locator ===
To add new Eid address, use "lisp eid-table":
+
To extend existing locator set with a new locator use "lisp locator add":
 +
<pre>
 +
vpp# lisp locator add locator-set ls1 iface host-intervpp1 p 1 w 1
 +
</pre>
 +
Where <tt>locator-set</tt> is <tt>locator-set name</tt>, <tt>p</tt> is <tt>priority</tt> and <tt>w</tt> is <tt>weight</tt>.
 +
 
 +
To delete a specific locator set, use "lisp locator del"
 +
<pre>
 +
vpp# lisp locator-set del locator-set ls1 iface host-intervpp1 p 1 w 1
 +
</pre>
 +
 
 +
=== Manipulating EID table ===
 +
EID table contains mappings between EIDs and a locator sets. For adding an entry use following command:
 
<pre>
 
<pre>
 
vpp# lisp eid-table add eid 6.0.1.0/24 locator-set ls1
 
vpp# lisp eid-table add eid 6.0.1.0/24 locator-set ls1
 
</pre>
 
</pre>
 +
Currently an EID can be IPv4, IPv6 or MAC address.
  
To delete a specific eid address, use "lisp eid-table del"
+
To delete a specific entry from EID table use "lisp eid-table del"
 
<pre>
 
<pre>
vpp# lisp eid-table del eid 6.0.1.0/24 locator-set ls1
+
vpp# lisp eid-table del eid 6.0.1.0/24
 
</pre>
 
</pre>
  
To display eid table:
+
To list EID table use <tt>show lisp eid-table [local|remote] [eid <eid>]</tt>
 
<pre>
 
<pre>
vpp# show lisp eid-table
+
DBGvpp# show lisp eid-table
        EID             Locator   
+
EID                     type          locators            ttl      autoritative
6.0.2.0/24                   ls1
+
[0] 6.0.2.0/24           local(ls1)    host-xtr_rtr1      0        0
 
</pre>
 
</pre>
 +
It is also possible to specify a filter that will output only local or remote EID entries. You can also specify a EID entry that prints only info about it if found.
  
 
=== Map resolver ===
 
=== Map resolver ===
Line 72: Line 94:
 
</pre>
 
</pre>
  
== LISP VAT commands ==
+
=== Proxy-ITR (PITR) ===
 
+
VPP can be used as a proxy ITR by specifying a locator set:
=== Lisp GPE enable ===
+
To enable lisp, use "lisp_gpe_enable_disable":
+
 
<pre>
 
<pre>
vat# lisp_gpe_enable_disable enable
+
vpp# lisp pitr ls ls1
 
</pre>
 
</pre>
 +
Where <tt>ls</tt> is <tt>locator-set name</tt>.
  
To disable lisp.
+
To disable PITR use:
 
<pre>
 
<pre>
vat# lisp_gpe_enable_disable disable
+
vpp# lisp pitr disable ls ls1
 
</pre>
 
</pre>
  
To display lisp status
+
Following command tells if VPP is in PITR mode. If yes it also shows the name of locator set.
<pre>
+
vat# lisp_gpe_enable_disable_status_dump
+
    lisp gpe
+
    enable
+
</pre>
+
 
+
=== Locator_set ===
+
To add new locator_set, use "lisp_add_del_locator_set". This command also "reset" exist locator_set in vpp:
+
<pre>
+
vat# lisp_add_del_locator_set locator-set ls1
+
</pre>
+
 
+
To delete a specific locator_set, use "lisp_add_del_locator_set locator-set <name> del":
+
<pre>
+
vat# lisp_add_del_locator_set locator-set ls1 del
+
</pre>
+
When delete locator_set, then also delete all locator which are assigned to locator_set
+
 
+
To add new locator to locator_set, use "lisp_add_del_locator":
+
<pre>
+
vat# lisp_add_del_locator locator-set  ls1 iface GigabitEthernet0/a/0 p 1 w 2
+
</pre>
+
Where <tt>p</tt> is <tt>priority</tt> and <tt>w</tt> is <tt>weight</tt>.
+
 
+
Locator API also support sw_if_index instead of interface name:
+
<pre>
+
lisp_add_del_locator locator-set ls1 sw_if_index 6 p 1 w 2
+
</pre>
+
 
+
To delete specific locator, use "lisp_add_del_locator locator-set  <name> iface <interface> p <priority> w <weight> del"
+
<pre>
+
vat# lisp_add_del_locator locator-set  ls1 iface GigabitEthernet0/a/0 p 1 w 2 del
+
</pre>
+
 
+
To display locator_set and locator:
+
<pre>
+
vat# lisp_locator_set_dump                                                                                                                                                                                                                                                                 
+
    Locator-set        Locator        Priority        Weight                                                                                                                                                                                                                             
+
        ls1                6              1              2
+
</pre>
+
 
+
=== Eid ===
+
To add new Eid address, use "lisp_add_del_local_eid"
+
<pre>
+
vat# lisp_add_del_local_eid eid 6:0:1::0/64 locator-set ls1
+
</pre>
+
There must exist locator_set, before add new eid address.
+
 
+
To delete specific eid address, use "isp_add_del_local_eid eid <address>/<prefix> locator-set <name>"
+
<pre>
+
vat# lisp_add_del_local_eid eid 6:0:1::0/64 locator-set ls1 del
+
</pre>
+
 
+
To display Eid table:
+
<pre>
+
vat# lisp_local_eid_table_dump
+
    Locator-set                  Eid           
+
        ls1                  6.0.1.0/24         
+
        ls1                  6:0:1::/64
+
</pre>
+
 
+
=== Map resolver ===
+
To add new map resolver, use "lisp_add_del_map_resolver"
+
 
<pre>
 
<pre>
vat# lisp_add_del_map_resolver 6:0:3::100
+
vpp# show lisp pitr
 +
    pitr
 +
    disable
 
</pre>
 
</pre>
  
To delete specific map resolver, use "lisp_add_del_map_resolver <ip address> del"
+
=== Remote mapping ===
 +
This command provides a way to configure remote mappings programmed statically without a need of a map resolver.
 +
To add new remote mapping use "lisp remote-mapping add":
 
<pre>
 
<pre>
vat# lisp_add_del_map_resolver 6:0:3::100 del
+
vpp# lisp remote-mapping add vni 0 eid 6.2.1.0/24 rloc 6.0.1.1
 
</pre>
 
</pre>
 +
Where <tt>vni</vni> is <tt>Virtual Network Identifier</tt>, <tt>eid</tt> is <tt>eid prefix</tt> and <tt>rloc</tt> is <tt>remote locator</tt>
  
To display map resolver:
+
To disable remote mapping, use "lisp remote-mapping del":
 
<pre>
 
<pre>
vat# lisp_map_resolver_dump
+
vpp# lisp remote-mapping del vni 0 eid 6.2.1.0/24
    Map resolver   
+
    6:0:3::100
+
 
</pre>
 
</pre>

Latest revision as of 15:13, 1 August 2016

Introduction

The vpp contain a set of commands to set and debug LISP. Access VPP's CLI over telnet, assuming cli-listen localhost:5002 is configured under unix{} in the startup.conf, with:

telnet 0 5002

Telnet LISP CLI a.k.a debug CLI

Following is a list of CLI commands used by LISP.

Enabling LISP

For turning on LISP functionality type:

vpp# lisp enable

...and this will disable LISP

vpp# lisp disable

To display LISP status use

vat# show lisp status
feature: enabled
gpe: enabled

where 'feature' field show status of LISP - both control plane and dataplane. 'gpe' is dataplane status indicator which can be enabled/disabled with its own set of commands:

vat# lisp gpe enable
vat# lisp gpe disable

Locator set

To add new locator set and assigning locator(s) to it use "lisp locator-set add":

vpp# lisp locator-set add ls1 iface host-intervpp1 p 1 w 1

Where p is priority and w is weight.

To delete a specific locator set, use "lisp locator-set del"

vpp# lisp locator-set del ls1

To display current locator sets and their locators:

vpp# show lisp locator-set
     Locator-set         Locator        Priority         Weight     
     ls1                      6               1               1

Locator

To extend existing locator set with a new locator use "lisp locator add":

vpp# lisp locator add locator-set ls1 iface host-intervpp1 p 1 w 1

Where locator-set is locator-set name, p is priority and w is weight.

To delete a specific locator set, use "lisp locator del"

vpp# lisp locator-set del locator-set ls1 iface host-intervpp1 p 1 w 1

Manipulating EID table

EID table contains mappings between EIDs and a locator sets. For adding an entry use following command:

vpp# lisp eid-table add eid 6.0.1.0/24 locator-set ls1

Currently an EID can be IPv4, IPv6 or MAC address.

To delete a specific entry from EID table use "lisp eid-table del"

vpp# lisp eid-table del eid 6.0.1.0/24

To list EID table use show lisp eid-table [local|remote] [eid <eid>]

DBGvpp# show lisp eid-table
EID                      type           locators            ttl       autoritative
[0] 6.0.2.0/24           local(ls1)     host-xtr_rtr1       0         0

It is also possible to specify a filter that will output only local or remote EID entries. You can also specify a EID entry that prints only info about it if found.

Map resolver

To add new map resolver, use "lisp map-resolver":

vpp# lisp map-resolver add 6.0.3.100

To delete a specific map resolver address, use "lisp map-resolver del":

vpp# lisp map-resolver del 6.0.3.100

Proxy-ITR (PITR)

VPP can be used as a proxy ITR by specifying a locator set:

vpp# lisp pitr ls ls1

Where ls is locator-set name.

To disable PITR use:

vpp# lisp pitr disable ls ls1

Following command tells if VPP is in PITR mode. If yes it also shows the name of locator set.

vpp# show lisp pitr
     pitr
    disable

Remote mapping

This command provides a way to configure remote mappings programmed statically without a need of a map resolver. To add new remote mapping use "lisp remote-mapping add":

vpp# lisp remote-mapping add vni 0 eid 6.2.1.0/24 rloc 6.0.1.1

Where vni</vni> is <tt>Virtual Network Identifier, eid is eid prefix and rloc is remote locator

To disable remote mapping, use "lisp remote-mapping del":

vpp# lisp remote-mapping del vni 0 eid 6.2.1.0/24