diff --git a/tools/ndn-autoconfig-server/main.cpp b/tools/ndn-autoconfig-server/main.cpp
new file mode 100644
index 0000000..3806d9a
--- /dev/null
+++ b/tools/ndn-autoconfig-server/main.cpp
@@ -0,0 +1,101 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2017,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "program.hpp"
+#include "core/extended-error-message.hpp"
+#include "core/version.hpp"
+#include <unistd.h>
+
+namespace ndn {
+namespace tools {
+namespace autoconfig_server {
+
+static void
+usage(const char* programName)
+{
+  std::cout << "Usage:\n" << programName  << " [-h] [-V] [-p prefix] [-p prefix] ... hub-face\n"
+            << "  -h        - print usage and exit\n"
+            << "  -V        - print version number and exit\n"
+            << "  -p prefix - a local prefix of the HUB\n"
+            << "\n"
+            << "  hub-face  - a FaceUri to reach the HUB\n"
+            << std::endl;
+}
+
+int
+main(int argc, char** argv)
+{
+  Options options;
+
+  int opt = -1;
+  while ((opt = ::getopt(argc, argv, "hVp:")) != -1) {
+    switch (opt) {
+    case 'h':
+      usage(argv[0]);
+      return 0;
+    case 'V':
+      std::cout << NFD_VERSION_BUILD_STRING << std::endl;
+      return 0;
+    case 'p':
+      options.routablePrefixes.emplace_back(::optarg);
+      break;
+    default:
+      usage(argv[0]);
+      return 2;
+    }
+  }
+
+  if (argc != ::optind + 1) {
+    usage(argv[0]);
+    return 2;
+  }
+
+  if (!options.hubFaceUri.parse(argv[::optind])) {
+    std::cerr << "ERROR: cannot parse HUB FaceUri\n";
+    return 2;
+  }
+
+  try {
+    Face face;
+    KeyChain keyChain;
+    Program program(options, face, keyChain);
+    program.run();
+  }
+  catch (const std::exception& e) {
+    std::cerr << ::nfd::getExtendedErrorMessage(e) << std::endl;
+    return 1;
+  }
+  return 0;
+}
+
+} // namespace autoconfig_server
+} // namespace tools
+} // namespace ndn
+
+int
+main(int argc, char** argv)
+{
+  return ndn::tools::autoconfig_server::main(argc, argv);
+}
diff --git a/tools/ndn-autoconfig-server/program.cpp b/tools/ndn-autoconfig-server/program.cpp
new file mode 100644
index 0000000..c6c3b1a
--- /dev/null
+++ b/tools/ndn-autoconfig-server/program.cpp
@@ -0,0 +1,98 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2017,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "program.hpp"
+#include <ndn-cxx/encoding/block-helpers.hpp>
+#include <ndn-cxx/encoding/tlv.hpp>
+#include <ndn-cxx/encoding/tlv-nfd.hpp>
+
+namespace ndn {
+namespace tools {
+namespace autoconfig_server {
+
+static const Name HUB_DATA_NAME("/localhop/ndn-autoconf/hub");
+static const Name ROUTABLE_PREFIXES_DATA_PREFIX("/localhop/nfd");
+static const PartialName ROUTABLE_PREFIXES_DATA_SUFFIX("rib/routable-prefixes");
+
+Program::Program(const Options& options, Face& face, KeyChain& keyChain)
+  : m_face(face)
+  , m_keyChain(keyChain)
+  , m_dispatcher(face, keyChain)
+{
+  this->enableHubData(options.hubFaceUri);
+  if (!options.routablePrefixes.empty()) {
+    this->enableRoutablePrefixesDataset(options.routablePrefixes);
+  }
+}
+
+void
+Program::enableHubData(const FaceUri& hubFaceUri)
+{
+  std::string uri = hubFaceUri.toString();
+
+  auto data = make_shared<Data>(Name(HUB_DATA_NAME).appendVersion());
+  data->setFreshnessPeriod(time::hours(1));
+  data->setContent(makeBinaryBlock(tlv::nfd::Uri,
+                                   reinterpret_cast<const uint8_t*>(uri.data()), uri.size()));
+  m_keyChain.sign(*data);
+
+  m_face.setInterestFilter(HUB_DATA_NAME,
+    [this, data] (const Name&, const Interest& interest) {
+      if (interest.matchesData(*data)) {
+        m_face.put(*data);
+      }
+    },
+    bind(&Program::handlePrefixRegistrationFailure, this, _1, _2));
+}
+
+void
+Program::enableRoutablePrefixesDataset(const std::vector<Name>& routablePrefixes)
+{
+  m_dispatcher.addStatusDataset(ROUTABLE_PREFIXES_DATA_SUFFIX,
+    mgmt::makeAcceptAllAuthorization(),
+    [=] (const Name& prefix, const Interest& interest, mgmt::StatusDatasetContext& context) {
+      for (const Name& routablePrefix : routablePrefixes) {
+        context.append(routablePrefix.wireEncode());
+      }
+      context.end();
+    });
+  m_dispatcher.addTopPrefix(ROUTABLE_PREFIXES_DATA_PREFIX, false);
+
+  m_face.registerPrefix(Name(ROUTABLE_PREFIXES_DATA_PREFIX).append(ROUTABLE_PREFIXES_DATA_SUFFIX),
+    nullptr,
+    bind(&Program::handlePrefixRegistrationFailure, this, _1, _2));
+}
+
+void
+Program::handlePrefixRegistrationFailure(const Name& prefix, const std::string& reason)
+{
+  std::cerr << "ERROR: cannot register prefix " << prefix
+            << " (" << reason << ")" << std::endl;
+  m_face.shutdown();
+}
+
+} // namespace autoconfig_server
+} // namespace tools
+} // namespace ndn
diff --git a/tools/ndn-autoconfig-server/program.hpp b/tools/ndn-autoconfig-server/program.hpp
new file mode 100644
index 0000000..39b5bce
--- /dev/null
+++ b/tools/ndn-autoconfig-server/program.hpp
@@ -0,0 +1,75 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2017,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_TOOLS_NDN_AUTOCONFIG_SERVER_PROGRAM_HPP
+#define NFD_TOOLS_NDN_AUTOCONFIG_SERVER_PROGRAM_HPP
+
+#include "core/common.hpp"
+#include <ndn-cxx/face.hpp>
+#include <ndn-cxx/mgmt/dispatcher.hpp>
+#include <ndn-cxx/security/key-chain.hpp>
+
+namespace ndn {
+namespace tools {
+namespace autoconfig_server {
+
+struct Options
+{
+  FaceUri hubFaceUri;
+  std::vector<Name> routablePrefixes;
+};
+
+class Program : noncopyable
+{
+public:
+  Program(const Options& options, Face& face, KeyChain& keyChain);
+
+  void
+  run()
+  {
+    m_face.processEvents();
+  }
+
+private:
+  void
+  enableHubData(const FaceUri& hubFaceUri);
+
+  void
+  enableRoutablePrefixesDataset(const std::vector<Name>& routablePrefixes);
+
+  void
+  handlePrefixRegistrationFailure(const Name& prefix, const std::string& reason);
+
+private:
+  Face& m_face;
+  KeyChain& m_keyChain;
+  mgmt::Dispatcher m_dispatcher;
+};
+
+} // namespace autoconfig_server
+} // namespace tools
+} // namespace ndn
+
+#endif // NFD_TOOLS_NDN_AUTOCONFIG_SERVER_PROGRAM_HPP
