diff --git a/transporthandler.cpp b/transporthandler.cpp
index 4de9400..30526b3 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -49,6 +49,7 @@
 {
     ipmi_ret_t rc = IPMI_CC_OK;
     sdbusplus::bus::bus bus(ipmid_get_sd_bus_connection());
+
     try
     {
         switch (lan_param)
@@ -180,6 +181,37 @@
             }
             break;
 
+            case LAN_PARM_VLAN:
+            {
+                if (lan_set_in_progress == SET_COMPLETE)
+                {
+                    auto ipObjectInfo = ipmi::getDbusObject(
+                                            bus,
+                                            ipmi::network::IP_INTERFACE,
+                                            ipmi::network::ROOT,
+                                            ipmi::network::IP_TYPE);
+
+                    auto vlanID = static_cast<uint16_t>(
+                            ipmi::network::getVLAN(ipObjectInfo.first));
+
+                    vlanID = htole16(vlanID);
+
+                    if (vlanID)
+                    {
+                        //Enable the 16th bit
+                        vlanID |= htole16(ipmi::network::VLAN_ENABLE_MASK);
+                    }
+
+                    memcpy(data, &vlanID, ipmi::network::VLAN_SIZE_BYTE);
+                }
+                else if (lan_set_in_progress == SET_IN_PROGRESS)
+                {
+                    memcpy(data, &(channelConfig.vlanID),
+                           ipmi::network::VLAN_SIZE_BYTE);
+                }
+            }
+            break;
+
             default:
                 rc = IPMI_CC_PARM_OUT_OF_RANGE;
         }
@@ -290,6 +322,18 @@
         }
         break;
 
+        case LAN_PARM_VLAN:
+        {
+            uint16_t vlan {};
+            memcpy(&vlan, reqptr->data, ipmi::network::VLAN_SIZE_BYTE);
+            // We are not storing the enable bit
+            // We assume that ipmitool always send enable
+            // bit as 1.
+            vlan = le16toh(vlan);
+            channelConfig.vlanID = vlan;
+        }
+        break;
+
         case LAN_PARM_INPROGRESS:
         {
             if (reqptr->data[0] == SET_COMPLETE)
@@ -299,7 +343,8 @@
                 log<level::INFO>("Network data from Cache",
                                  entry("PREFIX=%s", channelConfig.netmask.c_str()),
                                  entry("ADDRESS=%s", channelConfig.ipaddr.c_str()),
-                                 entry("GATEWAY=%s", channelConfig.gateway.c_str()));
+                                 entry("GATEWAY=%s", channelConfig.gateway.c_str()),
+                                 entry("VLAN=%d", channelConfig.vlanID));
 
                 log<level::INFO>("Use Set Channel Access command to apply");
 
@@ -314,8 +359,6 @@
 
         default:
         {
-            log<level::ERR>("Unsupported parameter",
-                            entry("PARAMETER=0x%x", reqptr->parameter));
             rc = IPMI_CC_PARM_NOT_SUPPORTED;
         }
 
@@ -398,6 +441,18 @@
             rc = IPMI_CC_UNSPECIFIED_ERROR;
         }
     }
+    else if (reqptr->parameter == LAN_PARM_VLAN)
+    {
+        uint8_t buf[ipmi::network::VLAN_SIZE_BYTE + 1];
+
+        *data_len = sizeof(current_revision);
+        memcpy(buf, &current_revision, *data_len);
+        if (getNetworkData(reqptr->parameter, &buf[1]) == IPMI_CC_OK)
+        {
+            *data_len = sizeof(buf);
+            memcpy(response, &buf, *data_len);
+        }
+    }
     else
     {
         log<level::ERR>("Unsupported parameter",
