diff --git a/src/vnet/lldp/lldp.api b/src/vnet/lldp/lldp.api
new file mode 100644
index 0000000..02fe32c
--- /dev/null
+++ b/src/vnet/lldp/lldp.api
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** \brief configure global parameter for LLDP
+    @param client_index - opaque cookie to identify the sender
+    @param context - sender context, to match reply w/ request
+    @param system_name - VPP system name
+    @param tx_hold - multiplier for tx_interval when setting time-to-live (TTL)
+                     value in the LLDP packets
+    @param tx_interval - time interval, in seconds, between each LLDP frames
+*/
+autoreply define lldp_config
+{
+  u32 client_index;
+  u32 context;
+  u8 system_name[256];
+  u32 tx_hold;
+  u32 tx_interval;
+};
+
+/** \brief Interface set LLDP request
+    @param client_index - opaque cookie to identify the sender
+    @param context - sender context, to match reply w/ request
+    @param sw_if_index - interface for which to enable/disable LLDP
+    @param port_desc - local port description
+    @param enable - if non-zero enable, else disable
+*/
+autoreply define sw_interface_set_lldp
+{
+  u32 client_index;
+  u32 context;
+  u32 sw_if_index;
+  u8 port_desc[256];
+  u8 enable;
+};
diff --git a/src/vnet/lldp/lldp.h b/src/vnet/lldp/lldp.h
new file mode 100644
index 0000000..473c202
--- /dev/null
+++ b/src/vnet/lldp/lldp.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @file
+ * @brief LLDP external definition
+ */
+#ifndef __included_lldp_h__
+#define __included_lldp_h__
+
+typedef enum lldp_cfg_err
+{
+  lldp_ok,
+  lldp_not_supported,
+  lldp_invalid_arg,
+} lldp_cfg_err_t;
+
+lldp_cfg_err_t lldp_cfg_intf_set (u32 hw_if_index, u8 ** port_desc, int enable);
+lldp_cfg_err_t lldp_cfg_set (u8 ** host, int hold_time, int tx_interval);
+
+#endif /* __included_lldp_h__ */
diff --git a/src/vnet/lldp/lldp_api.c b/src/vnet/lldp/lldp_api.c
new file mode 100644
index 0000000..bdada89
--- /dev/null
+++ b/src/vnet/lldp/lldp_api.c
@@ -0,0 +1,144 @@
+/*
+ *------------------------------------------------------------------
+ * lldp_api.c - lldp api
+ *
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *------------------------------------------------------------------
+ */
+
+#include <vnet/vnet.h>
+#include <vlibmemory/api.h>
+
+#include <vnet/interface.h>
+#include <vnet/api_errno.h>
+#include <vnet/lldp/lldp.h>
+
+#include <vnet/vnet_msg_enum.h>
+
+#define vl_typedefs		/* define message structures */
+#include <vnet/vnet_all_api_h.h>
+#undef vl_typedefs
+
+#define vl_endianfun		/* define message structures */
+#include <vnet/vnet_all_api_h.h>
+#undef vl_endianfun
+
+/* instantiate all the print functions we know about */
+#define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
+#define vl_printfun
+#include <vnet/vnet_all_api_h.h>
+#undef vl_printfun
+
+#include <vlibapi/api_helper_macros.h>
+
+#define foreach_vpe_api_msg                             \
+_(LLDP_CONFIG, lldp_config)                             \
+_(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp)
+
+static void
+vl_api_lldp_config_t_handler (vl_api_lldp_config_t * mp)
+{
+  vl_api_lldp_config_reply_t *rmp;
+  int rv = 0;
+  u8 *sys_name = 0;
+
+  vec_validate (sys_name, strlen ((char *) mp->system_name) - 1);
+  strncpy ((char *) sys_name, (char *) mp->system_name, vec_len (sys_name));
+
+  if (lldp_cfg_set (&sys_name, ntohl (mp->tx_hold),
+		    ntohl (mp->tx_interval)) != lldp_ok)
+    {
+      vec_free (sys_name);
+      rv = VNET_API_ERROR_INVALID_VALUE;
+    }
+
+  REPLY_MACRO (VL_API_LLDP_CONFIG_REPLY);
+}
+
+static void
+vl_api_sw_interface_set_lldp_t_handler (vl_api_sw_interface_set_lldp_t * mp)
+{
+  vl_api_sw_interface_set_lldp_reply_t *rmp;
+  int rv = 0;
+  u8 *port_desc = 0;
+
+  vec_validate (port_desc, strlen ((char *) mp->port_desc) - 1);
+  strncpy ((char *) port_desc, (char *) mp->port_desc, vec_len (port_desc));
+
+  VALIDATE_SW_IF_INDEX (mp);
+
+  if (lldp_cfg_intf_set (ntohl (mp->sw_if_index), &port_desc,
+			 mp->enable) != lldp_ok)
+    {
+      vec_free (port_desc);
+      rv = VNET_API_ERROR_INVALID_VALUE;
+    }
+
+  BAD_SW_IF_INDEX_LABEL;
+
+  REPLY_MACRO (VL_API_SW_INTERFACE_SET_LLDP_REPLY);
+}
+
+
+/*
+ *  * lldp_api_hookup
+ *   * Add vpe's API message handlers to the table.
+ *    * vlib has alread mapped shared memory and
+ *     * added the client registration handlers.
+ *      * See .../vlib-api/vlibmemory/memclnt_vlib.c:memclnt_process()
+ *       */
+#define vl_msg_name_crc_list
+#include <vnet/vnet_all_api_h.h>
+#undef vl_msg_name_crc_list
+
+static void
+setup_message_id_table (api_main_t * am)
+{
+#define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
+  foreach_vl_msg_name_crc_lldp;
+#undef _
+}
+
+static clib_error_t *
+lldp_api_hookup (vlib_main_t * vm)
+{
+  api_main_t *am = &api_main;
+
+#define _(N,n)                                                  \
+    vl_msg_api_set_handlers(VL_API_##N, #n,                     \
+                           vl_api_##n##_t_handler,              \
+                           vl_noop_handler,                     \
+                           vl_api_##n##_t_endian,               \
+                           vl_api_##n##_t_print,                \
+                           sizeof(vl_api_##n##_t), 1);
+  foreach_vpe_api_msg;
+#undef _
+
+  /*
+   *    * Set up the (msg_name, crc, message-id) table
+   *       */
+  setup_message_id_table (am);
+
+  return 0;
+}
+
+VLIB_API_INIT_FUNCTION (lldp_api_hookup);
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */
diff --git a/src/vnet/lldp/lldp_cli.c b/src/vnet/lldp/lldp_cli.c
index d6d84bf..af18f90 100644
--- a/src/vnet/lldp/lldp_cli.c
+++ b/src/vnet/lldp/lldp_cli.c
@@ -19,19 +19,13 @@
  *
  */
 #include <vnet/lisp-cp/lisp_types.h>
+#include <vnet/lldp/lldp.h>
 #include <vnet/lldp/lldp_node.h>
 
 #ifndef ETHER_ADDR_LEN
 #include <net/ethernet.h>
 #endif
 
-typedef enum lldp_cfg_err
-{
-  lldp_ok,
-  lldp_not_supported,
-  lldp_invalid_arg,
-} lldp_cfg_err_t;
-
 static clib_error_t *
 lldp_cfg_err_to_clib_err (lldp_cfg_err_t e)
 {
@@ -48,8 +42,8 @@
   return 0;
 }
 
-static lldp_cfg_err_t
-lldp_cfg_intf_set (u32 hw_if_index, int enable)
+lldp_cfg_err_t
+lldp_cfg_intf_set (u32 hw_if_index, u8 ** port_desc, int enable)
 {
   lldp_main_t *lm = &lldp_main;
   vnet_main_t *vnm = lm->vnet_main;
@@ -68,9 +62,16 @@
       if (n)
 	{
 	  /* already enabled */
-	  return 0;
+	  return lldp_ok;
 	}
       n = lldp_create_intf (lm, hw_if_index);
+
+      if (port_desc && *port_desc)
+	{
+	  n->port_desc = *port_desc;
+	  *port_desc = NULL;
+	}
+
       const vnet_sw_interface_t *sw =
 	vnet_get_sw_interface (lm->vnet_main, hi->sw_if_index);
       if (sw->flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
@@ -84,7 +85,7 @@
       lldp_delete_intf (lm, n);
     }
 
-  return 0;
+  return lldp_ok;
 }
 
 static clib_error_t *
@@ -93,24 +94,33 @@
 {
   lldp_main_t *lm = &lldp_main;
   vnet_main_t *vnm = lm->vnet_main;
-  u32 hw_if_index;
-  int enable = 0;
+  u32 sw_if_index = (u32) ~ 0;
+  int enable = 1;
+  u8 *port_desc = NULL;
 
-  if (unformat (input, "%U %U", unformat_vnet_hw_interface, vnm, &hw_if_index,
-		unformat_vlib_enable_disable, &enable))
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
     {
-      return
-	lldp_cfg_err_to_clib_err (lldp_cfg_intf_set (hw_if_index, enable));
+      if (unformat (input, "sw_if_index %d", &sw_if_index))
+	;
+      if (unformat
+	  (input, "%U", unformat_vnet_sw_interface, vnm, &sw_if_index))
+	;
+      else if (unformat (input, "disable"))
+	enable = 0;
+      else if (unformat (input, "port-desc %s", &port_desc))
+	;
+      else
+	break;
     }
-  else
-    {
-      return clib_error_return (0, "unknown input `%U'",
-				format_unformat_error, input);
-    }
-  return 0;
+
+  if (sw_if_index == (u32) ~ 0)
+    return clib_error_return (0, "Interface name is invalid!");
+
+  return lldp_cfg_err_to_clib_err (lldp_cfg_intf_set (sw_if_index,
+						      &port_desc, enable));
 }
 
-static lldp_cfg_err_t
+lldp_cfg_err_t
 lldp_cfg_set (u8 ** host, int hold_time, int tx_interval)
 {
   lldp_main_t *lm = &lldp_main;
@@ -208,7 +218,8 @@
 /* *INDENT-OFF* */
 VLIB_CLI_COMMAND(set_interface_lldp_cmd, static) = {
   .path = "set interface lldp",
-  .short_help = "set interface lldp <interface> (enable | disable) ",
+  .short_help = "set interface lldp <interface> | sw_if_index <idx>"
+                " [port-desc <string>] [disable]",
   .function = lldp_intf_cmd,
 };
 
@@ -499,23 +510,26 @@
         else if (now < n->last_heard + n->ttl)
           {
             s = format(s,
-                       "\nInterface name: %s\nInterface/peer state: "
-                       "active\nPeer chassis ID: %U\nRemote port ID: %U\nLast "
-                       "packet sent: %U\nLast packet received: %U\n",
-                       hw->name, format_lldp_chassis_id, n->chassis_id_subtype,
-                       n->chassis_id, vec_len(n->chassis_id), 1,
+                       "\nInterface name: %s\nPort Desc: %s\nInterface/peer "
+                       "state: active\nPeer chassis ID: %U\nRemote port ID:"
+                       " %U\nLast packet sent: %U\nLast packet received: %U\n",
+                       hw->name, n->port_desc, format_lldp_chassis_id,
+                       n->chassis_id_subtype, n->chassis_id,
+                       vec_len(n->chassis_id), 1,
                        format_lldp_port_id, n->port_id_subtype, n->port_id,
                        vec_len(n->port_id), 1, format_time_ago, n->last_sent,
                        now, format_time_ago, n->last_heard, now);
           }
         else
           {
-            s = format(s, "\nInterface name: %s\nInterface/peer state: "
-                          "inactive(timeout)\nLast known peer chassis ID: "
-                          "%U\nLast known peer port ID: %U\nLast packet sent: "
-                          "%U\nLast packet received: %U\n",
-                       hw->name, format_lldp_chassis_id, n->chassis_id_subtype,
-                       n->chassis_id, vec_len(n->chassis_id), 1,
+            s = format(s,
+                       "\nInterface name: %s\nPort Desc: %s\nInterface/peer "
+                       "state: inactive(timeout)\nLast known peer chassis ID:"
+                       "%U\nLast known peer port ID: %U\nLast packet sent: "
+                       "%U\nLast packet received: %U\n",
+                       hw->name, n->port_desc, format_lldp_chassis_id,
+                       n->chassis_id_subtype, n->chassis_id,
+                       vec_len(n->chassis_id), 1,
                        format_lldp_port_id, n->port_id_subtype, n->port_id,
                        vec_len(n->port_id), 1, format_time_ago, n->last_sent,
                        now, format_time_ago, n->last_heard, now);
diff --git a/src/vnet/lldp/lldp_doc.md b/src/vnet/lldp/lldp_doc.md
index bac480a..717de89 100644
--- a/src/vnet/lldp/lldp_doc.md
+++ b/src/vnet/lldp/lldp_doc.md
@@ -27,10 +27,12 @@
 
 Per interface setting is done using the "set interface lldp" command
 
-set interface lldp <interface> (enable | disable)
+set interface lldp <interface> | if_index <idx> [port-desc <string>] [disable]
 
 interface: the name of the interface for which to enable/disable LLDP
-
+if_index: sw interface index can be used if interface name is not used.
+port-desc: port description
+disable: LLDP feature can be enabled or disabled per interface.
 
 ### Configuration example
 
@@ -38,9 +40,9 @@
 
 set lldp system-name VPP tx-interval 10
 
-Enable LLDP on interface TenGigabitEthernet5/0/1
+Enable LLDP on interface TenGigabitEthernet5/0/1 with port description
 
-set interface lldp TenGigabitEthernet5/0/1 enable
+set interface lldp TenGigabitEthernet5/0/1 port-desc vtf:eth0
 
 
 ### Operational data
diff --git a/src/vnet/lldp/lldp_node.h b/src/vnet/lldp/lldp_node.h
index 477ca7d..14a10e3 100644
--- a/src/vnet/lldp/lldp_node.h
+++ b/src/vnet/lldp/lldp_node.h
@@ -43,6 +43,9 @@
   lldp_port_id_subtype_t port_id_subtype;
   lldp_chassis_id_subtype_t chassis_id_subtype;
 
+  /* Local info */
+  u8 *port_desc;
+
 } lldp_intf_t;
 
 typedef struct
diff --git a/src/vnet/lldp/lldp_output.c b/src/vnet/lldp/lldp_output.c
index 6cb2627..950b79a 100644
--- a/src/vnet/lldp/lldp_output.c
+++ b/src/vnet/lldp/lldp_output.c
@@ -75,6 +75,20 @@
 }
 
 static void
+lldp_add_port_desc (const lldp_main_t * lm, lldp_intf_t * n, u8 ** t0p)
+{
+  const size_t len = vec_len (n->port_desc);
+  if (len)
+    {
+      lldp_tlv_t *t = (lldp_tlv_t *) * t0p;
+      lldp_tlv_set_code (t, LLDP_TLV_NAME (port_desc));
+      lldp_tlv_set_length (t, len);
+      clib_memcpy (t->v, n->port_desc, len);
+      *t0p += STRUCT_SIZE_OF (lldp_tlv_t, head) + len;
+    }
+}
+
+static void
 lldp_add_sys_name (const lldp_main_t * lm, u8 ** t0p)
 {
   const size_t len = vec_len (lm->sys_name);
@@ -99,11 +113,12 @@
 
 static void
 lldp_add_tlvs (lldp_main_t * lm, vnet_hw_interface_t * hw, u8 ** t0p,
-	       int shutdown)
+	       int shutdown, lldp_intf_t * n)
 {
   lldp_add_chassis_id (hw, t0p);
   lldp_add_port_id (hw, t0p);
   lldp_add_ttl (lm, t0p, shutdown);
+  lldp_add_port_desc (lm, n, t0p);
   lldp_add_sys_name (lm, t0p);
   lldp_add_pdu_end (t0p);
 }
@@ -139,7 +154,7 @@
   t0 = data;
 
   /* add TLVs */
-  lldp_add_tlvs (lm, hw, &t0, shutdown);
+  lldp_add_tlvs (lm, hw, &t0, shutdown, n);
 
   /* Set the outbound packet length */
   b0 = vlib_get_buffer (vm, bi0);
@@ -167,6 +182,7 @@
       hash_unset (lm->intf_by_hw_if_index, n->hw_if_index);
       vec_free (n->chassis_id);
       vec_free (n->port_id);
+      vec_free (n->port_desc);
       pool_put (lm->intfs, n);
     }
 }
