diff --git a/tools/nfdc/find-face.cpp b/tools/nfdc/find-face.cpp
index d877e81..5645e26 100644
--- a/tools/nfdc/find-face.cpp
+++ b/tools/nfdc/find-face.cpp
@@ -43,7 +43,7 @@
 {
   FaceQueryFilter filter;
   filter.setRemoteUri(faceUri.toString());
-  return this->execute(filter);
+  return this->execute(filter, allowMulti);
 }
 
 FindFace::Code
@@ -55,14 +55,14 @@
 }
 
 FindFace::Code
-FindFace::execute(const boost::any& faceIdOrUri)
+FindFace::execute(const boost::any& faceIdOrUri, bool allowMulti)
 {
   const uint64_t* faceId = boost::any_cast<uint64_t>(&faceIdOrUri);
   if (faceId != nullptr) {
     return this->execute(*faceId);
   }
   else {
-    return this->execute(boost::any_cast<FaceUri>(faceIdOrUri));
+    return this->execute(boost::any_cast<FaceUri>(faceIdOrUri), allowMulti);
   }
 }
 
diff --git a/tools/nfdc/find-face.hpp b/tools/nfdc/find-face.hpp
index 45c3f1e..2661aa6 100644
--- a/tools/nfdc/find-face.hpp
+++ b/tools/nfdc/find-face.hpp
@@ -72,11 +72,11 @@
 
   /** \brief find face by FaceId or FaceUri
    *  \param faceIdOrUri a boost::any that contains uint64_t or FaceUri
-   *  \note allowMulti will be set to false
+   *  \param allowMulti effective only if \p faceIdOrUri contains a FaceUri
    *  \throw boost::bad_any_cast faceIdOrUri is neither uint64_t nor FaceUri
    */
   Code
-  execute(const boost::any& faceIdOrUri);
+  execute(const boost::any& faceIdOrUri, bool allowMulti = false);
 
   /** \brief find face by FaceQueryFilter
    *  \pre execute has not been invoked
diff --git a/tools/nfdc/rib-module.cpp b/tools/nfdc/rib-module.cpp
index b85410c..295ad3f 100644
--- a/tools/nfdc/rib-module.cpp
+++ b/tools/nfdc/rib-module.cpp
@@ -45,6 +45,14 @@
     .addArg("capture", ArgValueType::NONE, Required::NO, Positional::NO)
     .addArg("expires", ArgValueType::UNSIGNED, Required::NO, Positional::NO);
   parser.addCommand(defRouteAdd, &RibModule::add);
+
+  CommandDefinition defRouteRemove("route", "remove");
+  defRouteRemove
+    .setTitle("remove a route")
+    .addArg("prefix", ArgValueType::NAME, Required::YES, Positional::YES)
+    .addArg("nexthop", ArgValueType::FACE_ID_OR_URI, Required::YES, Positional::YES)
+    .addArg("origin", ArgValueType::UNSIGNED, Required::NO, Positional::NO);
+  parser.addCommand(defRouteRemove, &RibModule::remove);
 }
 
 void
@@ -116,6 +124,54 @@
 }
 
 void
+RibModule::remove(ExecuteContext& ctx)
+{
+  auto prefix = ctx.args.get<Name>("prefix");
+  const boost::any& nexthop = ctx.args.at("nexthop");
+  auto origin = ctx.args.get<uint64_t>("origin", ndn::nfd::ROUTE_ORIGIN_STATIC);
+
+  FindFace findFace(ctx);
+  FindFace::Code res = findFace.execute(nexthop, true);
+
+  ctx.exitCode = static_cast<int>(res);
+  switch (res) {
+    case FindFace::Code::OK:
+      break;
+    case FindFace::Code::ERROR:
+    case FindFace::Code::CANONIZE_ERROR:
+    case FindFace::Code::NOT_FOUND:
+      ctx.err << findFace.getErrorReason() << '\n';
+      return;
+    default:
+      BOOST_ASSERT_MSG(false, "unexpected FindFace result");
+      return;
+  }
+
+  for (const FaceStatus& faceStatus : findFace.getResults()) {
+    ControlParameters unregisterParams;
+    unregisterParams
+      .setName(prefix)
+      .setFaceId(faceStatus.getFaceId())
+      .setOrigin(origin);
+
+    ctx.controller.start<ndn::nfd::RibUnregisterCommand>(
+      unregisterParams,
+      [&] (const ControlParameters& resp) {
+        ctx.out << "route-removed ";
+        text::ItemAttributes ia;
+        ctx.out << ia("prefix") << resp.getName()
+                << ia("nexthop") << resp.getFaceId()
+                << ia("origin") << resp.getOrigin()
+                << '\n';
+      },
+      ctx.makeCommandFailureHandler("removing route"),
+      ctx.makeCommandOptions());
+  }
+
+  ctx.face.processEvents();
+}
+
+void
 RibModule::fetchStatus(Controller& controller,
                        const function<void()>& onSuccess,
                        const Controller::DatasetFailCallback& onFailure,
diff --git a/tools/nfdc/rib-module.hpp b/tools/nfdc/rib-module.hpp
index cca1ef4..aee2c8b 100644
--- a/tools/nfdc/rib-module.hpp
+++ b/tools/nfdc/rib-module.hpp
@@ -52,6 +52,11 @@
   static void
   add(ExecuteContext& ctx);
 
+  /** \brief the 'route remove' command
+   */
+  static void
+  remove(ExecuteContext& ctx);
+
   void
   fetchStatus(Controller& controller,
               const function<void()>& onSuccess,
