diff --git a/transporthandler.cpp b/transporthandler.cpp
index da4231a..dd2ac14 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -843,6 +843,28 @@
     return true;
 }
 
+/**
+ * @brief is a valid LAN channel.
+ *
+ * This function checks whether the input channel is a valid LAN channel or not.
+ *
+ * @param[in] channel: the channel number.
+ * @return nullopt if the channel is invalid, false if the channel is not a LAN
+ * channel, true if the channel is a LAN channel.
+ **/
+std::optional<bool> isLanChannel(uint8_t channel)
+{
+    ChannelInfo chInfo;
+    auto cc = getChannelInfo(channel, chInfo);
+    if (cc != ccSuccess)
+    {
+        return std::nullopt;
+    }
+
+    return chInfo.mediumType ==
+           static_cast<uint8_t>(EChannelMediumType::lan8032);
+}
+
 RspType<> setLan(Context::ptr ctx, uint4_t channelBits, uint4_t reserved1,
                  uint8_t parameter, message::Payload& req)
 {
@@ -855,6 +877,12 @@
         return responseInvalidFieldRequest();
     }
 
+    if (!isLanChannel(channel).value_or(false))
+    {
+        log<level::ERR>("Set Lan - Not a LAN channel");
+        return responseInvalidFieldRequest();
+    }
+
     switch (static_cast<LanParam>(parameter))
     {
         case LanParam::SetStatus:
@@ -1278,6 +1306,12 @@
         return responseInvalidFieldRequest();
     }
 
+    if (!isLanChannel(channel).value_or(false))
+    {
+        log<level::ERR>("Set Lan - Not a LAN channel");
+        return responseInvalidFieldRequest();
+    }
+
     static std::vector<uint8_t> cipherList;
     static bool listInit = false;
     if (!listInit)
