diff --git a/src/net/address-converter.cpp b/src/net/address-converter.cpp
new file mode 100644
index 0000000..b6f2de2
--- /dev/null
+++ b/src/net/address-converter.cpp
@@ -0,0 +1,151 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-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 ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "address-converter.hpp"
+
+#if BOOST_VERSION < 105800
+#include <boost/algorithm/string.hpp>
+#include <boost/lexical_cast.hpp>
+#include <vector>
+#endif // BOOST_VERSION < 105800
+
+#include <net/if.h> // for if_nametoindex and if_indextoname
+
+namespace ndn {
+namespace ip {
+
+optional<std::string>
+scopeNameFromId(unsigned int scopeId)
+{
+  char buffer[IFNAMSIZ];
+  auto scopeName = if_indextoname(scopeId, buffer);
+  if (scopeName != nullptr) {
+    return std::string(scopeName);
+  }
+  return nullopt;
+}
+
+#if BOOST_VERSION < 105800
+static unsigned int
+scopeIdFromString(const std::string& scope)
+{
+  auto id = if_nametoindex(scope.c_str());
+  if (id != 0) {
+    return id;
+  }
+
+  // cannot find a corresponding index, assume it's not a name but an interface index
+  try {
+    return boost::lexical_cast<unsigned int>(scope);
+  }
+  catch (const boost::bad_lexical_cast&) {
+    return 0;
+  }
+}
+
+struct ParsedAddress
+{
+  boost::asio::ip::address addr;
+  std::string scope;
+};
+
+static ParsedAddress
+parseAddressFromString(const std::string& address, boost::system::error_code& ec)
+{
+  std::vector<std::string> parseResult;
+  boost::algorithm::split(parseResult, address, boost::is_any_of("%"));
+  auto addr = boost::asio::ip::address::from_string(parseResult[0], ec);
+
+  switch (parseResult.size()) {
+  case 1:
+    // regular address
+    return {addr, ""};
+  case 2:
+    // the presence of % in either an IPv4 address or a regular IPv6 address is invalid
+    if (!ec && addr.is_v6() && addr.to_v6().is_link_local()) {
+      return {addr, parseResult[1]};
+    }
+    // Fallthrough, if the presence of % is invalid set ec to invalid_argument
+  default:
+    ec = boost::asio::error::invalid_argument;
+    return {};
+  }
+}
+#endif // BOOST_VERSION < 105800
+
+boost::asio::ip::address
+addressFromString(const std::string& address, boost::system::error_code& ec)
+{
+  // boost < 1.58 cannot recognize scope-id in link-local IPv6 address
+#if BOOST_VERSION < 105800
+  auto parsedAddress = parseAddressFromString(address, ec);
+  if (ec || parsedAddress.addr.is_v4()) {
+    return parsedAddress.addr;
+  }
+  auto addr = parsedAddress.addr.to_v6();
+  addr.scope_id(scopeIdFromString(parsedAddress.scope));
+  return addr;
+#else
+  return boost::asio::ip::address::from_string(address, ec);
+#endif // BOOST_VERSION < 105800
+}
+
+boost::asio::ip::address
+addressFromString(const std::string& address)
+{
+  boost::system::error_code ec;
+  auto addr = addressFromString(address, ec);
+  if (ec) {
+    BOOST_THROW_EXCEPTION(boost::system::system_error(ec));
+  }
+  return addr;
+}
+
+boost::asio::ip::address_v6
+addressV6FromString(const std::string& address, boost::system::error_code& ec)
+{
+  auto addr = addressFromString(address, ec);
+  if (ec || addr.is_v4()) {
+    ec = boost::asio::error::invalid_argument;
+    return {};
+  }
+  return addr.to_v6();
+}
+
+boost::asio::ip::address_v6
+addressV6FromString(const std::string& address)
+{
+  boost::system::error_code ec;
+  auto addr = addressV6FromString(address, ec);
+  if (ec) {
+    BOOST_THROW_EXCEPTION(boost::system::system_error(ec));
+  }
+  return addr;
+}
+
+} // namespace ip
+} // namespace ndn
diff --git a/src/net/address-converter.hpp b/src/net/address-converter.hpp
new file mode 100644
index 0000000..b58cfff
--- /dev/null
+++ b/src/net/address-converter.hpp
@@ -0,0 +1,96 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-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 ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_NET_ADDRESS_CONVERTER_HPP
+#define NDN_NET_ADDRESS_CONVERTER_HPP
+
+#include "../common.hpp"
+
+#include <boost/asio/ip/address.hpp>
+#include <boost/system/error_code.hpp>
+
+namespace ndn {
+namespace ip {
+
+/**
+ * \brief Convert scope ID of IPv6 address into interface name
+ *
+ * \return interface name, or ndn::nullopt if \p scopeId cannot be converted
+ */
+optional<std::string>
+scopeNameFromId(unsigned int scopeId);
+
+/**
+ * \brief parse and convert the input string into an IP address
+ *
+ * \param str the string to parse
+ *
+ * \return the converted IP address
+ * \throw boost::system::system_error in case of failure
+ */
+boost::asio::ip::address
+addressFromString(const std::string& str);
+
+/**
+ * \brief parse and convert the input string into an IP address
+ *
+ * \param str the string to parse
+ * \param ec the error code of failure in conversion
+ *
+ * \return the converted IP address, or a default-constructed
+ *         `boost::asio::ip::address` in case of failure
+ */
+boost::asio::ip::address
+addressFromString(const std::string& str, boost::system::error_code& ec);
+
+/**
+ * \brief parse and convert the input string into an IPv6 address
+ *
+ * \param str the string to parse
+ *
+ * \return the converted IPv6 address
+ * \throw boost::system::system_error in case of failure
+ */
+boost::asio::ip::address_v6
+addressV6FromString(const std::string& str);
+
+/**
+ * \brief parse and convert the input string into an IPv6 address
+ *
+ * \param str the string to parse
+ * \param ec the error code of failure in conversion
+ *
+ * \return the converted IPv6 address, or a default-constructed
+ *         `boost::asio::ip::address_v6` in case of failure
+ */
+boost::asio::ip::address_v6
+addressV6FromString(const std::string& str, boost::system::error_code& ec);
+
+} // namespace ip
+} // namespace ndn
+
+#endif // NDN_NET_ADDRESS_CONVERTER_HPP
diff --git a/src/net/face-uri.cpp b/src/net/face-uri.cpp
index 11e4fe5..3e9f358 100644
--- a/src/net/face-uri.cpp
+++ b/src/net/face-uri.cpp
@@ -26,8 +26,12 @@
  */
 
 #include "face-uri.hpp"
-#include "dns.hpp"
 
+#include "address-converter.hpp"
+#include "dns.hpp"
+#include "util/string-helper.hpp"
+
+#include <boost/algorithm/string.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/mpl/vector.hpp>
 #include <boost/mpl/for_each.hpp>
@@ -74,6 +78,9 @@
   const std::string& authority = protocolMatch[3];
   m_path = protocolMatch[4];
 
+  // pattern for IPv6 link local address enclosed in [ ], with optional port number
+  static const boost::regex v6LinkLocalExp("^\\[([a-fA-F0-9:]+)%([a-zA-Z0-9]+)\\]"
+                                           "(?:\\:(\\d+))?$");
   // pattern for IPv6 address enclosed in [ ], with optional port number
   static const boost::regex v6Exp("^\\[([a-fA-F0-9:]+)\\](?:\\:(\\d+))?$");
   // pattern for Ethernet address in standard hex-digits-and-colons notation
@@ -88,6 +95,13 @@
   }
   else {
     boost::smatch match;
+    if (boost::regex_match(authority, match, v6LinkLocalExp)) {
+      m_isV6 = true;
+      m_host = match[1] + "%" + match[2];
+      m_port = match[3];
+      return true;
+    }
+
     m_isV6 = boost::regex_match(authority, match, v6Exp);
     if (m_isV6 ||
         boost::regex_match(authority, match, etherExp) ||
@@ -256,18 +270,43 @@
     }
 
     boost::system::error_code ec;
-    boost::asio::ip::address addr;
-    if (faceUri.getScheme() == m_v4Scheme) {
-      addr = boost::asio::ip::address_v4::from_string(faceUri.getHost(), ec);
-    }
-    else if (faceUri.getScheme() == m_v6Scheme) {
-      addr = boost::asio::ip::address_v6::from_string(faceUri.getHost(), ec);
-    }
-    else {
+    auto addr = ip::addressFromString(unescapeHost(faceUri.getHost()), ec);
+    if (ec) {
       return false;
     }
 
-    return !ec && addr.to_string() == faceUri.getHost() && checkAddress(addr).first;
+    bool hasCorrectScheme = (faceUri.getScheme() == m_v4Scheme && addr.is_v4()) ||
+                            (faceUri.getScheme() == m_v6Scheme && addr.is_v6());
+    if (!hasCorrectScheme) {
+      return false;
+    }
+
+    auto checkAddressWithUri = [] (const boost::asio::ip::address& addr,
+                                   const FaceUri& faceUri) -> bool {
+      if (addr.is_v4() || !addr.to_v6().is_link_local()) {
+        return addr.to_string() == faceUri.getHost();
+      }
+
+      std::vector<std::string> addrFields, faceUriFields;
+      std::string addrString = addr.to_string();
+      std::string faceUriString = faceUri.getHost();
+
+      boost::algorithm::split(addrFields, addrString, boost::is_any_of("%"));
+      boost::algorithm::split(faceUriFields, faceUriString, boost::is_any_of("%"));
+      if (addrFields.size() != 2 || faceUriFields.size() != 2) {
+        return false;
+      }
+
+      if (faceUriFields[1].size() > 2 && faceUriFields[1].compare(0, 2, "25") == 0) {
+        // %25... is accepted, but not a canonical form
+        return false;
+      }
+
+      return addrFields[0] == faceUriFields[0] &&
+             addrFields[1] == faceUriFields[1];
+    };
+
+    return checkAddressWithUri(addr, faceUri) && checkAddress(addr).first;
   }
 
   void
@@ -284,7 +323,7 @@
     // make a copy because caller may modify faceUri
     auto uri = make_shared<FaceUri>(faceUri);
     boost::system::error_code ec;
-    auto ipAddress = boost::asio::ip::address::from_string(faceUri.getHost(), ec);
+    auto ipAddress = ip::addressFromString(unescapeHost(faceUri.getHost()), ec);
     if (!ec) {
       // No need to resolve IP address if host is already an IP
       if ((faceUri.getScheme() == m_v4Scheme && !ipAddress.is_v4()) ||
@@ -307,7 +346,7 @@
         addressSelector = dns::AnyAddress();
       }
 
-      dns::asyncResolve(faceUri.getHost(),
+      dns::asyncResolve(unescapeHost(faceUri.getHost()),
         bind(&IpHostCanonizeProvider<Protocol>::onDnsSuccess, this, uri, onSuccess, onFailure, _1),
         bind(&IpHostCanonizeProvider<Protocol>::onDnsFailure, this, uri, onFailure, _1),
         io, addressSelector, timeout);
@@ -377,6 +416,16 @@
     return {true, ""};
   }
 
+  static std::string
+  unescapeHost(std::string host)
+  {
+    auto escapePos = host.find("%25");
+    if (escapePos != std::string::npos && escapePos < host.size() - 3) {
+      host = unescape(host);
+    }
+    return host;
+  }
+
 private:
   std::string m_baseScheme;
   std::string m_v4Scheme;
diff --git a/tests/unit-tests/net/address-converter.t.cpp b/tests/unit-tests/net/address-converter.t.cpp
new file mode 100644
index 0000000..712bf6d
--- /dev/null
+++ b/tests/unit-tests/net/address-converter.t.cpp
@@ -0,0 +1,159 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-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 ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "net/address-converter.hpp"
+
+#include "boost-test.hpp"
+#include "collect-netifs.hpp"
+
+namespace ndn {
+namespace ip {
+namespace tests {
+
+BOOST_AUTO_TEST_SUITE(Net)
+BOOST_AUTO_TEST_SUITE(TestAddressConverter)
+
+#define CHECK_IPV6_ADDRESS(address, string, scope) do {                 \
+    auto addrV6 = boost::asio::ip::address_v6::from_string(string);     \
+    addrV6.scope_id(scope);                                             \
+    BOOST_CHECK_EQUAL(address, addrV6);                                 \
+} while (false)
+
+BOOST_AUTO_TEST_CASE(ScopeNameFromId)
+{
+  const auto& networkInterfaces = net::tests::collectNetworkInterfaces();
+  if (!networkInterfaces.empty()) {
+    const auto& netif = networkInterfaces.front();
+    auto index = netif->getIndex();
+    auto name = netif->getName();
+
+    BOOST_CHECK_EQUAL(scopeNameFromId(index).value(), name);
+  }
+
+  BOOST_CHECK(!scopeNameFromId(std::numeric_limits<unsigned int>::max()));
+}
+
+BOOST_AUTO_TEST_CASE(AddressFromString)
+{
+  boost::asio::ip::address addr;
+  boost::system::error_code ec;
+
+  // empty string
+  BOOST_CHECK_THROW(addressFromString(""), boost::system::system_error);
+  BOOST_CHECK_EQUAL(addressFromString("", ec), addr);
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::invalid_argument);
+
+  // IPv4 address
+  BOOST_CHECK_EQUAL(addressFromString("192.168.0.1", ec),
+                    boost::asio::ip::address::from_string("192.168.0.1"));
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::success);
+
+  BOOST_CHECK_THROW(addressFromString("192.168.0"), boost::system::system_error);
+  BOOST_CHECK_EQUAL(addressFromString("192.168.0", ec), addr);
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::invalid_argument);
+
+  BOOST_CHECK_THROW(addressFromString("192.168.0.1%"), boost::system::system_error);
+  BOOST_CHECK_EQUAL(addressFromString("192.168.0.1%", ec), addr);
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::invalid_argument);
+
+  // regular IPv6 address
+  BOOST_CHECK_EQUAL(addressFromString("2001:db8::1", ec),
+                    boost::asio::ip::address::from_string("2001:db8::1"));
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::success);
+
+  BOOST_CHECK_THROW(addressFromString("2001:db8:::"), boost::system::system_error);
+  BOOST_CHECK_EQUAL(addressFromString("2001:db8:::", ec), addr);
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::invalid_argument);
+
+  // link-local IPv6 address
+  const auto& networkInterfaces = net::tests::collectNetworkInterfaces();
+  if (!networkInterfaces.empty()) {
+    const auto& netif = networkInterfaces.front();
+    CHECK_IPV6_ADDRESS(addressFromString("fe80::1%" + netif->getName(), ec).to_v6(),
+                       "fe80::1", netif->getIndex());
+    BOOST_CHECK_EQUAL(ec, boost::system::errc::success);
+  }
+}
+
+BOOST_AUTO_TEST_CASE(AddressV6FromString)
+{
+  boost::asio::ip::address_v6 addr;
+  boost::system::error_code ec;
+
+  // empty string
+  BOOST_CHECK_THROW(addressV6FromString(""), boost::system::system_error);
+  BOOST_CHECK_EQUAL(addressV6FromString("", ec), addr);
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::invalid_argument);
+
+  // IPv4 address
+  BOOST_CHECK_THROW(addressV6FromString("192.168.0.1"), boost::system::system_error);
+  BOOST_CHECK_EQUAL(addressV6FromString("192.168.0.1", ec), addr);
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::invalid_argument);
+
+  // regular IPv6 addresses
+  BOOST_CHECK_EQUAL(addressV6FromString("2001:db8::1", ec),
+                    boost::asio::ip::address_v6::from_string("2001:db8::1", ec));
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::success);
+
+  BOOST_CHECK_THROW(addressV6FromString("2001:db8:::"), boost::system::system_error);
+  BOOST_CHECK_EQUAL(addressV6FromString("2001:db8:::", ec), addr);
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::invalid_argument);
+
+
+  const auto& networkInterfaces = net::tests::collectNetworkInterfaces();
+  if (!networkInterfaces.empty()) {
+    const auto& netif = networkInterfaces.front();
+    auto index = netif->getIndex();
+
+    CHECK_IPV6_ADDRESS(addressV6FromString("fe80::1%" + netif->getName(), ec), "fe80::1", index);
+    BOOST_CHECK_EQUAL(ec, boost::system::errc::success);
+
+    CHECK_IPV6_ADDRESS(addressV6FromString("fe80::1%" + to_string(index), ec), "fe80::1", index);
+    BOOST_CHECK_EQUAL(ec, boost::system::errc::success);
+  }
+
+  int invalidIndex = 0;
+  for (const auto& netif : networkInterfaces) {
+    invalidIndex += netif->getIndex();
+  }
+
+  // an invalid interface name will lead to a default scope id (i.e. 0) which means no scope
+  CHECK_IPV6_ADDRESS(addressV6FromString("fe80::1%NotAnInterface", ec), "fe80::1", 0);
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::success);
+
+  // supplying an interface index in the string won't trigger any checks on its validity
+  CHECK_IPV6_ADDRESS(addressV6FromString("fe80::1%" + to_string(invalidIndex), ec),
+                     "fe80::1", invalidIndex);
+  BOOST_CHECK_EQUAL(ec, boost::system::errc::success);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestAddressConverter
+BOOST_AUTO_TEST_SUITE_END() // Net
+
+} // namespace tests
+} // namespace ip
+} // namespace ndn
diff --git a/tests/unit-tests/net/collect-netifs.cpp b/tests/unit-tests/net/collect-netifs.cpp
new file mode 100644
index 0000000..51bd71e
--- /dev/null
+++ b/tests/unit-tests/net/collect-netifs.cpp
@@ -0,0 +1,64 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-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 ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "collect-netifs.hpp"
+#include "net/network-monitor.hpp"
+
+#include <boost/asio/io_service.hpp>
+
+namespace ndn {
+namespace net {
+namespace tests {
+
+std::vector<shared_ptr<const NetworkInterface>>
+collectNetworkInterfaces(bool allowCached)
+{
+  static std::vector<shared_ptr<const NetworkInterface>> cached;
+  // cached.empty() indicates there's no cached list of netifs.
+  // Although it could also mean a system without any network interface, this situation is rare
+  // because the loopback interface is present on almost all systems.
+
+  if (!allowCached || cached.empty()) {
+    boost::asio::io_service io;
+    NetworkMonitor netmon(io);
+    if ((netmon.getCapabilities() & NetworkMonitor::CAP_ENUM) == 0) {
+      BOOST_THROW_EXCEPTION(NetworkMonitor::Error("NetworkMonitor::CAP_ENUM is unavailable"));
+    }
+
+    netmon.onEnumerationCompleted.connect([&io] { io.stop(); });
+    io.run();
+    io.reset();
+
+    cached = netmon.listNetworkInterfaces();
+  }
+
+  return cached;
+}
+
+} // namespace tests
+} // namespace net
+} // namespace ndn
diff --git a/tests/unit-tests/net/collect-netifs.hpp b/tests/unit-tests/net/collect-netifs.hpp
new file mode 100644
index 0000000..c7e4e8f
--- /dev/null
+++ b/tests/unit-tests/net/collect-netifs.hpp
@@ -0,0 +1,52 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-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 ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NFD_TESTS_UNIT_TESTS_NET_COLLECT_NETIFS_HPP
+#define NFD_TESTS_UNIT_TESTS_NET_COLLECT_NETIFS_HPP
+
+#include "common.hpp"
+#include "net/network-interface.hpp"
+
+#include <vector>
+
+namespace ndn {
+namespace net {
+namespace tests {
+
+/** \brief Collect information about network interfaces
+ *  \param allowCached if true, previously collected information can be returned
+ *  \note This function is blocking if \p allowCached is false or no previous information exists
+ *  \throw ndn::net::NetworkMonitor::Error NetworkMonitor::CAP_ENUM is unavailable
+ */
+std::vector<shared_ptr<const NetworkInterface>>
+collectNetworkInterfaces(bool allowCached = true);
+
+} // namespace tests
+} // namespace net
+} // namespace ndn
+
+#endif // NFD_TESTS_UNIT_TESTS_NET_COLLECT_NETIFS_HPP
diff --git a/tests/unit-tests/net/face-uri.t.cpp b/tests/unit-tests/net/face-uri.t.cpp
index 27313f7..1dd40c8 100644
--- a/tests/unit-tests/net/face-uri.t.cpp
+++ b/tests/unit-tests/net/face-uri.t.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California,
  *                         Arizona Board of Regents,
  *                         Colorado State University,
@@ -28,6 +28,7 @@
 #include "net/face-uri.hpp"
 
 #include "boost-test.hpp"
+#include "collect-netifs.hpp"
 #include "network-configuration-detector.hpp"
 
 namespace ndn {
@@ -163,6 +164,15 @@
   ip::udp::endpoint endpoint6(ip::address_v6::from_string("2001:DB8::1"), 7777);
   BOOST_REQUIRE_NO_THROW(FaceUri(endpoint6));
   BOOST_CHECK_EQUAL(FaceUri(endpoint6).toString(), "udp6://[2001:db8::1]:7777");
+
+  BOOST_CHECK(uri.parse("udp6://[fe80::1%25eth1]:6363"));
+  BOOST_CHECK_EQUAL(uri.getHost(), "fe80::1%25eth1");
+
+  BOOST_CHECK(uri.parse("udp6://[fe80::1%eth1]:6363"));
+  BOOST_CHECK_EQUAL(uri.getHost(), "fe80::1%eth1");
+
+  BOOST_CHECK(uri.parse("udp6://[fe80::1%1]:6363"));
+  BOOST_CHECK(uri.parse("udp6://[fe80::1%eth1]"));
 }
 
 BOOST_FIXTURE_TEST_CASE(IsCanonicalUdp, CanonizeFixture)
@@ -184,6 +194,18 @@
   BOOST_CHECK_EQUAL(FaceUri("udp4://224.0.23.170:56363").isCanonical(), true);
   BOOST_CHECK_EQUAL(FaceUri("udp4://[2001:db8::1]:6363").isCanonical(), false);
   BOOST_CHECK_EQUAL(FaceUri("udp6://192.0.2.1:6363").isCanonical(), false);
+
+  const auto& networkInterfaces = ndn::net::tests::collectNetworkInterfaces();
+  if (!networkInterfaces.empty()) {
+    const auto& netif = networkInterfaces.front();
+    auto name = netif->getName();
+    auto index = to_string(netif->getIndex());
+
+    BOOST_CHECK_EQUAL(FaceUri("udp6://[fe80::1%" + name + "]:6363").isCanonical(), true);
+    BOOST_CHECK_EQUAL(FaceUri("udp6://[fe80::1%" + index + "]:6363").isCanonical(), false);
+    BOOST_CHECK_EQUAL(FaceUri("udp6://[fe80::1%" + name + "]").isCanonical(), false);
+    BOOST_CHECK_EQUAL(FaceUri("udp6://[fe80::1068:dddb:fe26:fe3f%25en0]:6363").isCanonical(), false);
+  }
 }
 
 BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(CanonizeUdpV4, 1)
@@ -238,6 +260,19 @@
   // IPv4 used with udp6 protocol - not canonical
   addTest("udp6://192.0.2.1:6363", false, "");
 
+  const auto& networkInterfaces = ndn::net::tests::collectNetworkInterfaces();
+  if (!networkInterfaces.empty()) {
+    const auto& netif = networkInterfaces.front();
+    auto name = netif->getName();
+    auto index = to_string(netif->getIndex());
+
+    addTest("udp6://[fe80::1068:dddb:fe26:fe3f%25" + name + "]:6363", true,
+            "udp6://[fe80::1068:dddb:fe26:fe3f%" + name + "]:6363");
+
+    addTest("udp6://[fe80::1068:dddb:fe26:fe3f%" + index + "]:6363", true,
+            "udp6://[fe80::1068:dddb:fe26:fe3f%" + name + "]:6363");
+  }
+
   runTests();
 }
 
@@ -266,6 +301,15 @@
   ip::tcp::endpoint endpoint6(ip::address_v6::from_string("2001:DB8::1"), 7777);
   BOOST_REQUIRE_NO_THROW(FaceUri(endpoint6));
   BOOST_CHECK_EQUAL(FaceUri(endpoint6).toString(), "tcp6://[2001:db8::1]:7777");
+
+  BOOST_CHECK(uri.parse("tcp6://[fe80::1%25eth1]:6363"));
+  BOOST_CHECK_EQUAL(uri.getHost(), "fe80::1%25eth1");
+
+  BOOST_CHECK(uri.parse("tcp6://[fe80::1%eth1]:6363"));
+  BOOST_CHECK_EQUAL(uri.getHost(), "fe80::1%eth1");
+
+  BOOST_CHECK(uri.parse("tcp6://[fe80::1%1]:6363"));
+  BOOST_CHECK(uri.parse("tcp6://[fe80::1%eth1]"));
 }
 
 BOOST_FIXTURE_TEST_CASE(IsCanonicalTcp, CanonizeFixture)
@@ -287,6 +331,18 @@
   BOOST_CHECK_EQUAL(FaceUri("tcp4://224.0.23.170:56363").isCanonical(), false);
   BOOST_CHECK_EQUAL(FaceUri("tcp4://[2001:db8::1]:6363").isCanonical(), false);
   BOOST_CHECK_EQUAL(FaceUri("tcp6://192.0.2.1:6363").isCanonical(), false);
+
+  const auto& networkInterfaces = ndn::net::tests::collectNetworkInterfaces();
+  if (!networkInterfaces.empty()) {
+    const auto& netif = networkInterfaces.front();
+    auto name = netif->getName();
+    auto index = to_string(netif->getIndex());
+
+    BOOST_CHECK_EQUAL(FaceUri("tcp6://[fe80::1%" + name + "]:6363").isCanonical(), true);
+    BOOST_CHECK_EQUAL(FaceUri("tcp6://[fe80::1%" + index + "]:6363").isCanonical(), false);
+    BOOST_CHECK_EQUAL(FaceUri("tcp6://[fe80::1%" + name + "]").isCanonical(), false);
+    BOOST_CHECK_EQUAL(FaceUri("tcp6://[fe80::1068:dddb:fe26:fe3f%25en0]:6363").isCanonical(), false);
+  }
 }
 
 BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(CanonizeTcpV4, 1)
@@ -314,6 +370,19 @@
   // IPv6 used with tcp4 protocol - not canonical
   addTest("tcp4://[2001:db8::1]:6363", false, "");
 
+  const auto& networkInterfaces = ndn::net::tests::collectNetworkInterfaces();
+  if (!networkInterfaces.empty()) {
+    const auto& netif = networkInterfaces.front();
+    auto name = netif->getName();
+    auto index = to_string(netif->getIndex());
+
+    addTest("tcp6://[fe80::1068:dddb:fe26:fe3f%25" + name + "]:6363", true,
+            "tcp6://[fe80::1068:dddb:fe26:fe3f%" + name + "]:6363");
+
+    addTest("tcp6://[fe80::1068:dddb:fe26:fe3f%" + index + "]:6363", true,
+            "tcp6://[fe80::1068:dddb:fe26:fe3f%" + name + "]:6363");
+  }
+
   runTests();
 }
 
