Index: /branches/rel_avx_2_7_2/src/backend/sys_cmd.c
===================================================================
--- /branches/rel_avx_2_7_2/src/backend/sys_cmd.c	(revision 8837)
+++ /branches/rel_avx_2_7_2/src/backend/sys_cmd.c	(working copy)
@@ -50,6 +50,8 @@
 #include <sys/prctl.h>
 #include <pty.h>
 
+#include <json-c/json.h>
+
 #include <libxml/tree.h>
 #include <libxml/parser.h>
 #include <libxml/xpath.h>
@@ -6677,6 +6679,28 @@
     AVX_INIT_IFREQ(ifr); \
     strcpy(ifr.ifr_name, if_name)
 
+#define AVX_PORT_TO_IF_NAME(port, if_name, nic_vf_numa) \
+    int len; \
+    int port_idx;\
+    if (!port) { \
+        AVX_ERR_BEEP_JUMP(-2, "It seems that you do not give me any port\n"); \
+    } else if (strcmp(port, "mgmt") == 0) { \
+        AVX_ERR_BEEP_JUMP(-2, "mgmt port does not support this feature\n"); \
+    } \
+    /* Only parse the first two digits
+     * to prevent buffer overflow.
+     * This is reasonable as many
+     * motherboards do not support
+     * more than 99 devices
+     * attached to PCI-E. */ \
+    sscanf(port, "port%2d", &port_idx); \
+    if(port_idx < 1 || port_idx > 99) { \
+        AVX_ERR_BEEP_JUMP(-3, "It seems that you provide an invalid port\n"); \
+    } \
+    if(__avx_get_physical_nic(&nic_vf_numa, &len) < 0) \
+        goto cleanup; \
+    AVX_GET_IF_NAME(if_name, nic_vf_numa, port_idx - 1)
+
 static int
 set_if_state(char *port, int up_down)
 {
@@ -6828,3 +6852,166 @@
 }
 
 #undef AVX_IF_SHUTDOWN_CMD_LENGTH
+
+/* Store user-defined attributes in `ifalias` */
+#define AVX_IF_IFALIAS_PATH "/sys/class/net/%s/ifalias"
+
+#define AVX_IF_CANNOT_ALLOCATE_MEM AVX_ERR_BEEP_JUMP(-2, "Cannot allocate memory\n")
+
+/* Set the last character of path as null terminated
+ * or json-c will return segmentation fault.
+ * reference: https://github.com/json-c/json-c/issues/401#issuecomment-362139972
+ */
+#define AVX_IF_BUILD_IFALIAS_PATH(path, if_name, stmt) \
+    int sz = snprintf(NULL, 0, AVX_IF_IFALIAS_PATH, if_name) + 1; \
+    path = (char *) malloc(sizeof(char) * sz); \
+    if(!path) { \
+        stmt \
+    } \
+    snprintf(path, sz, AVX_IF_IFALIAS_PATH, if_name); \
+    path[sz - 1] = '\0'
+
+/* As json-c does not provide write JSON to file feature,
+ * We have to write by our own. */
+#define AVX_WRITE_JSON_TO_FILE(json, outputfile) \
+    const char *serialize_json = (const char *) json_object_to_json_string(json); \
+    FILE *fp = fopen(outputfile, "w"); \
+    fwrite(serialize_json, sizeof(char), strlen(serialize_json), fp); \
+    fclose(fp); \
+    sleep(1)
+
+int set_if_description(char *port, char *desc) {
+    char *path = NULL;
+    struct json_object *obj = NULL;
+    pci_dev_info_t* nic_vf_numa = NULL;
+    int ret = -1;
+
+    int n = strlen(desc);
+    if(n < 1 || n > 255) {
+        AVX_ERR_BEEP_JUMP(-6, "Description length is not in range\n");
+    }
+
+    AVX_PORT_TO_IF_NAME(port, if_name, nic_vf_numa);
+
+    AVX_IF_BUILD_IFALIAS_PATH(path, if_name, AVX_IF_CANNOT_ALLOCATE_MEM;);
+
+    obj = json_object_from_file(path);
+    if(!obj) {
+        obj = json_object_new_object();
+    }
+    if(!obj) { /* Check whether the JSON object is allocated or not */
+        AVX_ERR_BEEP_JUMP(-5, "Cannot allocate JSON\n");
+    }
+
+    json_object_object_add(obj, "description", json_object_new_string(desc));
+
+    AVX_WRITE_JSON_TO_FILE(obj, path);
+
+    ret = 0;
+
+cleanup:
+    _FREE(nic_vf_numa);
+    free(path);
+    json_object_put(obj);
+    if(ret != 0) {
+        printf("Operation of setting port description is unsuccessful\n");
+    }
+    return ret;
+}
+
+int unset_if_description(char *port) {
+    char *path = NULL;
+    struct json_object *obj = NULL;
+    pci_dev_info_t* nic_vf_numa = NULL;
+    int ret = -1;
+
+    AVX_PORT_TO_IF_NAME(port, if_name, nic_vf_numa);
+
+    AVX_IF_BUILD_IFALIAS_PATH(path, if_name, AVX_IF_CANNOT_ALLOCATE_MEM;);
+
+    obj = json_object_from_file(path);
+    if(!obj) {
+        AVX_ERR_BEEP_JUMP(1, "The description of this port maybe empty or corrupted\n");
+    }
+
+    json_object_object_del(obj, "description");
+
+    AVX_WRITE_JSON_TO_FILE(obj, path);
+
+    ret = 0;
+
+cleanup:
+    _FREE(nic_vf_numa);
+    free(path);
+    json_object_put(obj);
+    if(ret != 0) {
+        printf("Operation of deleting port description is unsuccessful\n");
+    }
+    return ret;
+}
+
+/* 80 + 255 (for the description with maximum length to 255) */
+#define AVX_IF_DESC_CMD_LENGTH 335
+
+char *write_if_description(void) {
+    char *save_if = NULL;
+    int len;
+    pci_dev_info_t *nic_vf_numa = NULL;
+
+    if(__avx_get_physical_nic(&nic_vf_numa, &len) < 0)
+        goto cleanup;
+
+    size_t malloc_sz = AVX_IF_DESC_CMD_LENGTH * len;
+    save_if = (char *) malloc(sizeof(char) * malloc_sz);
+    if(!save_if) {
+        printf("Cannot malloc save_if\n");
+        return NULL;
+    }
+
+    int i;
+    int idx = 0;
+    for(i = 0; i < len; i++) {
+        char *path = NULL;
+        json_object *obj;
+        json_object *desc;
+
+        AVX_GET_IF_NAME(if_name, nic_vf_numa, i);
+        AVX_IF_BUILD_IFALIAS_PATH(path, if_name, goto early_continue;);
+
+        /* Test path existence to suppress
+         * errors created by json_object_from_file()
+         * when reading non-existed files. */
+        if(access(path, F_OK) != 0) {
+            goto early_continue;
+        }
+
+        obj = json_object_from_file(path);
+        if(!obj) {
+            goto early_continue;
+        }
+        desc = json_object_object_get(obj, "description");
+        if(!desc) {
+            goto early_continue;
+        }
+
+        /* Write to config */
+        idx += snprintf(
+            save_if + idx,
+            malloc_sz - idx,
+            "interface description port%d \"%s\"\n",
+            i + 1,
+            json_object_get_string(desc)
+        );
+
+early_continue:
+        json_object_put(desc);
+        json_object_put(obj);
+        free(path);
+    }
+
+cleanup:
+    _FREE(nic_vf_numa);
+    return save_if;
+}
+
+#undef AVX_IF_DESC_CMD_LENGTH
Index: /branches/rel_avx_2_7_2/src/backend/sys_tool.h
===================================================================
--- /branches/rel_avx_2_7_2/src/backend/sys_tool.h	(revision 8837)
+++ /branches/rel_avx_2_7_2/src/backend/sys_tool.h	(working copy)
@@ -71,6 +71,7 @@
 extern char* writessh(void);
 extern char* write_system_interactive(void);
 extern char* write_if_shutdown(void);
+extern char* write_if_description(void);
 extern int clear_nameserver(char *ip);
 extern int clear_iphost(void);
 extern int ui_clear_supportip(void);
Index: /branches/rel_avx_2_7_2/src/backend/sys_tool.c
===================================================================
--- /branches/rel_avx_2_7_2/src/backend/sys_tool.c	(revision 8837)
+++ /branches/rel_avx_2_7_2/src/backend/sys_tool.c	(working copy)
@@ -353,6 +353,11 @@
         CMD_NORMAL | CMD_ARRAYOS | CMD_GLOBAL,
         "#interface shutdown"
     },
+    {
+        write_if_description,
+        CMD_NORMAL | CMD_ARRAYOS | CMD_GLOBAL,
+        "#interface description"
+    },
     /*last entry is empty*/
     {
         NULL,
Index: /branches/rel_avx_2_7_2/src/generator/commands.pm
===================================================================
--- /branches/rel_avx_2_7_2/src/generator/commands.pm	(revision 8837)
+++ /branches/rel_avx_2_7_2/src/generator/commands.pm	(working copy)
@@ -7206,6 +7206,39 @@
             optional => "NO",
         }, ],
     },
+    {
+        obj_type => "ITEM",
+        name => "description",
+        help_string => "    Configure interface description",
+        menu => "root_interface",
+        cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_GLOBAL",
+        user_level => "CLI_LEVEL_CONFIG",
+        function_name => "set_if_description",
+        function_args => [ {
+            type => "STRING",
+            help_string => "Interaface ID (e.g., port1)",
+            optional => "NO",
+        },
+        {
+            type => "STRING",
+            help_string => "Description of interface information (a string of 1 to 255 ASCII characters)",
+            optional => "NO",
+        }, ],
+    },
+    {
+        obj_type => "ITEM",
+        name => "description",
+        help_string => "    Delete interface description",
+        menu => "root_no_interface",
+        cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_GLOBAL",
+        user_level => "CLI_LEVEL_CONFIG",
+        function_name => "unset_if_description",
+        function_args => [ {
+            type => "STRING",
+            help_string => "Interface ID (e.g., port1)",
+            optional => "NO",
+        }, ],
+    },
 );
 
 # This method is required to expost the command table to the caller.
Index: /branches/rel_avx_2_7_2/src/library/avxvainst/va_resource.c
===================================================================
--- /branches/rel_avx_2_7_2/src/library/avxvainst/va_resource.c	(revision 8837)
+++ /branches/rel_avx_2_7_2/src/library/avxvainst/va_resource.c	(working copy)
@@ -21,6 +21,8 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 
+#include <json-c/json.h>
+
 #include "va_resource.h"
 #include "va_log.h"
 #include "va_constants.h"
@@ -1900,6 +1902,36 @@
     return -1;
 }
 
+#define AVX_NIC_IFALIAS_PROTO "/sys/class/net/%s/ifalias"
+#define AVX_NIC_DESC_PROTO "description: %s"
+
+#define AVX_NIC_GET_STR_SIZE(dst, sz, msg, stmt, ...) \
+    sz = snprintf(NULL, 0, __VA_ARGS__) + 1; \
+    dst = (char *) malloc(sizeof(char) * sz); \
+    do { \
+        if(!dst) { \
+            printf(msg); \
+            stmt \
+            return -1; \
+        } \
+    } while(0)
+
+#define AVX_NIC_BUILD_STR(dst, sz, ...) \
+    snprintf(dst, sz, __VA_ARGS__); \
+    dst[sz - 1] = '\0'
+
+#define AVX_NIC_FREE_PATHS \
+    free(ifalias_path); \
+    free(desc)
+
+#define AVX_NIC_FREE_JSONS \
+    json_object_put(obj_desc); \
+    json_object_put(obj)
+
+#define AVX_NIC_FREE_DESC \
+    AVX_NIC_FREE_JSONS; \
+    AVX_NIC_FREE_PATHS
+
 int nic_display_media_info(char *interface){
 	char pbuf[256] = {0}, buf[1024] = {0};
 	FILE *fp = NULL;
@@ -1907,6 +1939,7 @@
     char status[64] = "status: active ";
     const char *AVX_IF_STATUS_NO_CARRIER = "status: no carrier ";
     const char *AVX_IF_STATUS_ADMIN_DOWN = "status: down(Administratively down) ";
+
 	snprintf(pbuf, sizeof(pbuf), "ethtool %s", interface);
 
 	fp = popen(pbuf, "r");
@@ -1950,6 +1983,57 @@
 		memset(pbuf, 0, sizeof(pbuf));
 	}
 	pclose(fp);
+
+    int sz;
+    char *ifalias_path;
+    char *desc;
+    json_object *obj;
+    json_object *obj_desc;
+    /* Build ifalias string of the interface */
+#define ERR_MSG "Unable to create description path string\n"
+    AVX_NIC_GET_STR_SIZE(ifalias_path, sz, ERR_MSG, AVX_NIC_FREE_PATHS;, AVX_NIC_IFALIAS_PROTO, interface);
+#undef ERR_MSG
+    AVX_NIC_BUILD_STR(ifalias_path, sz, AVX_NIC_IFALIAS_PROTO, interface);
+
+    /* Check whether we can access the ifalias */
+    if(access(ifalias_path, F_OK) != 0) {
+        AVX_NIC_FREE_DESC;
+        return -1;
+    }
+
+    /* Get the description of the interface */
+    obj = json_object_from_file(ifalias_path);
+    if(!obj) {
+        /* As calling json_object_put() with the json_object
+         * with zero reference count (i.e., obj_desc)
+         * causes segmentation fault, we should only free
+         * the json_object with at least one reference count. */
+        json_object_put(obj);
+        AVX_NIC_FREE_PATHS;
+        goto output;
+    }
+    obj_desc = json_object_object_get(obj, "description");
+    if(!obj_desc) {
+        AVX_NIC_FREE_DESC;
+        goto output;
+    }
+
+    /* Build description string */
+#define DESC_STR(desc) json_object_get_string(desc)
+#define ERR_MSG "Unable to create description string\n"
+    AVX_NIC_GET_STR_SIZE(desc, sz, ERR_MSG, AVX_NIC_FREE_DESC;, AVX_NIC_DESC_PROTO, DESC_STR(obj_desc));
+#undef ERR_MSG
+    AVX_NIC_BUILD_STR(desc, sz, AVX_NIC_DESC_PROTO, DESC_STR(obj_desc));
+
+#undef DESC_STR
+
+    /* Append description string to buf */
+    strcat(buf, "\n\t");
+    strcat(buf, desc);
+
+    AVX_NIC_FREE_DESC;
+
+output:
 	printf("\t%s ", status);
 	printf("%s\n", buf);
 	return 0;
