diff --git a/daemon/mgmt/local-control-header-manager.cpp b/daemon/mgmt/local-control-header-manager.cpp
new file mode 100644
index 0000000..6a0f056
--- /dev/null
+++ b/daemon/mgmt/local-control-header-manager.cpp
@@ -0,0 +1,110 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (C) 2014 Named Data Networking Project
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "local-control-header-manager.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("LocalControlHeaderManager");
+
+const Name LocalControlHeaderManager::COMMAND_PREFIX = "/localhost/nfd/control-header";
+
+const size_t LocalControlHeaderManager::COMMAND_UNSIGNED_NCOMPS =
+  LocalControlHeaderManager::COMMAND_PREFIX.size() +
+  1 + // control-module
+  1; // verb
+
+const size_t LocalControlHeaderManager::COMMAND_SIGNED_NCOMPS =
+  LocalControlHeaderManager::COMMAND_UNSIGNED_NCOMPS +
+  0; // No signed Interest support in mock
+
+
+LocalControlHeaderManager::LocalControlHeaderManager(function<shared_ptr<Face>(FaceId)> getFace,
+                                                     shared_ptr<AppFace> face)
+  : ManagerBase(face),
+    m_getFace(getFace)
+{
+  face->setInterestFilter("/localhost/nfd/control-header",
+                          bind(&LocalControlHeaderManager::onLocalControlHeaderRequest, this, _2));
+}
+
+void
+LocalControlHeaderManager::onLocalControlHeaderRequest(const Interest& request)
+{
+  static const Name::Component MODULE_IN_FACEID("in-faceid");
+  static const Name::Component MODULE_NEXTHOP_FACEID("nexthop-faceid");
+  static const Name::Component VERB_ENABLE("enable");
+  static const Name::Component VERB_DISABLE("disable");
+
+  const Name& command = request.getName();
+  const size_t commandNComps = command.size();
+
+  if (COMMAND_UNSIGNED_NCOMPS <= commandNComps &&
+      commandNComps < COMMAND_SIGNED_NCOMPS)
+    {
+      NFD_LOG_INFO("command result: unsigned verb: " << command);
+      sendResponse(command, 401, "Signature required");
+
+      return;
+    }
+  else if (commandNComps < COMMAND_SIGNED_NCOMPS ||
+      !COMMAND_PREFIX.isPrefixOf(command))
+    {
+      NFD_LOG_INFO("command result: malformed");
+      sendResponse(command, 400, "Malformed command");
+      return;
+    }
+
+  shared_ptr<Face> face = m_getFace(request.getIncomingFaceId());
+
+  const Name::Component& module = command.get(COMMAND_PREFIX.size());
+  const Name::Component& verb = command.get(COMMAND_PREFIX.size() + 1);
+
+  if (module == MODULE_IN_FACEID)
+    {
+      if (verb == VERB_ENABLE)
+        {
+          face->setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID, true);
+          sendResponse(command, 200, "Success");
+        }
+      else if (verb == VERB_DISABLE)
+        {
+          face->setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID, false);
+          sendResponse(command, 200, "Success");
+        }
+      else
+        {
+          NFD_LOG_INFO("command result: unsupported verb: " << verb);
+          sendResponse(command, 501, "Unsupported");
+        }
+    }
+  else if (module == MODULE_NEXTHOP_FACEID)
+    {
+      if (verb == VERB_ENABLE)
+        {
+          face->setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_NEXTHOP_FACEID, true);
+          sendResponse(command, 200, "Success");
+        }
+      else if (verb == VERB_DISABLE)
+        {
+          face->setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_NEXTHOP_FACEID, false);
+          sendResponse(command, 200, "Success");
+        }
+      else
+        {
+          NFD_LOG_INFO("command result: unsupported verb: " << verb);
+          sendResponse(command, 501, "Unsupported");
+        }
+    }
+  else
+    {
+      NFD_LOG_INFO("command result: unsupported module: " << module);
+      sendResponse(command, 501, "Unsupported");
+    }
+}
+
+} // namespace nfd
+
diff --git a/daemon/mgmt/local-control-header-manager.hpp b/daemon/mgmt/local-control-header-manager.hpp
new file mode 100644
index 0000000..ab3c08a
--- /dev/null
+++ b/daemon/mgmt/local-control-header-manager.hpp
@@ -0,0 +1,46 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (C) 2014 Named Data Networking Project
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NFD_MGMT_LOCAL_CONTROL_HEADER_MANAGER_HPP
+#define NFD_MGMT_LOCAL_CONTROL_HEADER_MANAGER_HPP
+
+#include "common.hpp"
+#include "face/face.hpp"
+#include "mgmt/app-face.hpp"
+#include "mgmt/manager-base.hpp"
+
+namespace nfd {
+
+class LocalControlHeaderManager : public ManagerBase
+{
+public:
+  LocalControlHeaderManager(function<shared_ptr<Face>(FaceId)> getFace,
+                            shared_ptr<AppFace> face);
+
+  void
+  onLocalControlHeaderRequest(const Interest& request);
+
+
+private:
+  function<shared_ptr<Face>(FaceId)> m_getFace;
+
+  static const Name COMMAND_PREFIX; // /localhost/nfd/control-header
+
+  // number of components in an invalid, but not malformed, unsigned command.
+  // (/localhost/nfd/control-headeer + control-module + verb) = 5
+  static const size_t COMMAND_UNSIGNED_NCOMPS;
+
+  // number of components in a valid signed Interest.
+  // 5 in mock (see UNSIGNED_NCOMPS)
+  static const size_t COMMAND_SIGNED_NCOMPS;
+};
+
+} // namespace nfd
+
+#endif // NFD_MGMT_LOCAL_CONTROL_HEADER_MANAGER_HPP
+
+
+
