diff --git a/tests/daemon/face/datagram-transport.t.cpp b/tests/daemon/face/datagram-transport.t.cpp
index 70403d6..96585ae 100644
--- a/tests/daemon/face/datagram-transport.t.cpp
+++ b/tests/daemon/face/datagram-transport.t.cpp
@@ -24,6 +24,7 @@
  */
 
 #include "unicast-udp-transport-fixture.hpp"
+#include "multicast-udp-transport-fixture.hpp"
 
 #include <boost/mpl/vector.hpp>
 
@@ -34,11 +35,14 @@
 BOOST_AUTO_TEST_SUITE(Face)
 BOOST_AUTO_TEST_SUITE(TestDatagramTransport)
 
-typedef boost::mpl::vector<UnicastUdpTransportFixture> DatagramTransportFixtures;
+typedef boost::mpl::vector<UnicastUdpTransportFixture,
+                           MulticastUdpTransportFixture
+                           > DatagramTransportFixtures;
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(Send, T, DatagramTransportFixtures, T)
 {
-  this->initialize();
+  SKIP_IF_IP_UNAVAILABLE(this->defaultAddr);
+  this->initialize(this->defaultAddr);
 
   auto block1 = ndn::encoding::makeStringBlock(300, "hello");
   this->transport->send(Transport::Packet{Block{block1}}); // make a copy of the block
@@ -46,13 +50,7 @@
   BOOST_CHECK_EQUAL(this->transport->getCounters().nOutBytes, block1.size());
 
   std::vector<uint8_t> readBuf(block1.size());
-  this->remoteSocket.async_receive(boost::asio::buffer(readBuf),
-    [this] (const boost::system::error_code& error, size_t) {
-      BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
-      this->limitedIo.afterOp();
-    });
-
-  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  this->remoteRead(readBuf);
 
   BOOST_CHECK_EQUAL_COLLECTIONS(readBuf.begin(), readBuf.end(), block1.begin(), block1.end());
   BOOST_CHECK_EQUAL(this->transport->getState(), TransportState::UP);
@@ -60,7 +58,8 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(ReceiveNormal, T, DatagramTransportFixtures, T)
 {
-  this->initialize();
+  SKIP_IF_IP_UNAVAILABLE(this->defaultAddr);
+  this->initialize(this->defaultAddr);
 
   Block pkt = ndn::encoding::makeStringBlock(300, "hello");
   ndn::Buffer buf(pkt.begin(), pkt.end());
@@ -74,7 +73,8 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(ReceiveIncomplete, T, DatagramTransportFixtures, T)
 {
-  this->initialize();
+  SKIP_IF_IP_UNAVAILABLE(this->defaultAddr);
+  this->initialize(this->defaultAddr);
 
   std::vector<uint8_t> buf{
     0x05, 0x03, 0x00, 0x01,
@@ -89,7 +89,8 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(ReceiveTrailingGarbage, T, DatagramTransportFixtures, T)
 {
-  this->initialize();
+  SKIP_IF_IP_UNAVAILABLE(this->defaultAddr);
+  this->initialize(this->defaultAddr);
 
   Block pkt1 = ndn::encoding::makeStringBlock(300, "hello");
   Block pkt2 = ndn::encoding::makeStringBlock(301, "world");
@@ -107,7 +108,8 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(ReceiveTooLarge, T, DatagramTransportFixtures, T)
 {
-  this->initialize();
+  SKIP_IF_IP_UNAVAILABLE(this->defaultAddr);
+  this->initialize(this->defaultAddr);
 
   std::vector<uint8_t> bytes(ndn::MAX_NDN_PACKET_SIZE, 0);
   Block pkt1 = ndn::encoding::makeBinaryBlock(300, bytes.data(), bytes.size() - 6);
@@ -135,7 +137,8 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(Close, T, DatagramTransportFixtures, T)
 {
-  this->initialize();
+  SKIP_IF_IP_UNAVAILABLE(this->defaultAddr);
+  this->initialize(this->defaultAddr);
 
   this->transport->close();
   BOOST_CHECK_EQUAL(this->transport->getState(), TransportState::CLOSING);
diff --git a/tests/daemon/face/get-available-interface-ip.hpp b/tests/daemon/face/get-available-interface-ip.hpp
index 3a98632..e7088a8 100644
--- a/tests/daemon/face/get-available-interface-ip.hpp
+++ b/tests/daemon/face/get-available-interface-ip.hpp
@@ -42,19 +42,22 @@
 
 /** \brief get a non-local IP address from any available network interface
  *  \tparam A the address type, either boost::asio::ip::address_v4 or boost::asio::ip::address_v6
+ *  \param needMulticast true if the address must be chosen from a multicast-capable interface
  *  \return an IP address
  *  \retval default-constructed A, if no address is available
  */
 template<typename A>
 A
-getAvailableInterfaceIp();
+getAvailableInterfaceIp(bool needMulticast = false);
 
 template<>
 inline boost::asio::ip::address_v4
-getAvailableInterfaceIp()
+getAvailableInterfaceIp(bool needMulticast)
 {
   for (const auto& interface : listNetworkInterfaces()) {
-    if (interface.isUp() && !interface.isLoopback()) {
+    if (interface.isUp() &&
+        !interface.isLoopback() &&
+        (!needMulticast || interface.isMulticastCapable())) {
       for (const auto& address : interface.ipv4Addresses) {
         if (!address.is_unspecified() &&
             !address.is_loopback()) {
@@ -63,16 +66,17 @@
       }
     }
   }
-
   return {};
 }
 
 template<>
 inline boost::asio::ip::address_v6
-getAvailableInterfaceIp()
+getAvailableInterfaceIp(bool needMulticast)
 {
   for (const auto& interface : listNetworkInterfaces()) {
-    if (interface.isUp() && !interface.isLoopback()) {
+    if (interface.isUp() &&
+        !interface.isLoopback() &&
+        (!needMulticast || interface.isMulticastCapable())) {
       for (const auto& address : interface.ipv6Addresses) {
         if (!address.is_unspecified() &&
             !address.is_link_local() && // see #1428
@@ -82,7 +86,6 @@
       }
     }
   }
-
   return {};
 }
 
diff --git a/tests/daemon/face/multicast-udp-transport-fixture.hpp b/tests/daemon/face/multicast-udp-transport-fixture.hpp
new file mode 100644
index 0000000..639c828
--- /dev/null
+++ b/tests/daemon/face/multicast-udp-transport-fixture.hpp
@@ -0,0 +1,133 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2015,  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_TESTS_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_FIXTURE_HPP
+#define NFD_TESTS_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_FIXTURE_HPP
+
+#include "face/multicast-udp-transport.hpp"
+#include "face/face.hpp"
+
+#include "dummy-receive-link-service.hpp"
+#include "get-available-interface-ip.hpp"
+#include "tests/limited-io.hpp"
+
+namespace nfd {
+namespace face {
+namespace tests {
+
+using namespace nfd::tests;
+namespace ip = boost::asio::ip;
+using ip::udp;
+
+class MulticastUdpTransportFixture : public BaseFixture
+{
+protected:
+  MulticastUdpTransportFixture()
+    : transport(nullptr)
+    , multicastEp(ip::address::from_string("230.15.19.47"), 7070)
+    , defaultAddr(getAvailableInterfaceIp<ip::address_v4>(true))
+    , receivedPackets(nullptr)
+    , remoteSockRx(g_io)
+    , remoteSockTx(g_io)
+  {
+  }
+
+  void
+  initialize(ip::address_v4 address)
+  {
+    openMulticastSockets(remoteSockRx, remoteSockTx, multicastEp.port());
+
+    udp::socket sockRx(g_io);
+    udp::socket sockTx(g_io);
+    localEp = udp::endpoint(address, 7001);
+    openMulticastSockets(sockRx, sockTx, localEp.port());
+
+    face = make_unique<Face>(
+             make_unique<DummyReceiveLinkService>(),
+             make_unique<MulticastUdpTransport>(localEp, multicastEp, std::move(sockRx), std::move(sockTx)));
+    transport = static_cast<MulticastUdpTransport*>(face->getTransport());
+    receivedPackets = &static_cast<DummyReceiveLinkService*>(face->getLinkService())->receivedPackets;
+
+    BOOST_REQUIRE_EQUAL(transport->getState(), TransportState::UP);
+  }
+
+  void
+  openMulticastSockets(udp::socket& rx, udp::socket& tx, uint16_t port)
+  {
+    rx.open(udp::v4());
+    rx.set_option(udp::socket::reuse_address(true));
+    rx.bind(udp::endpoint(multicastEp.address(), port));
+    rx.set_option(ip::multicast::join_group(multicastEp.address()));
+
+    tx.open(udp::v4());
+    tx.set_option(udp::socket::reuse_address(true));
+    tx.set_option(ip::multicast::enable_loopback(true));
+    tx.bind(udp::endpoint(ip::address_v4::any(), port));
+  }
+
+  void
+  remoteRead(std::vector<uint8_t>& buf, bool needToCheck = true)
+  {
+    remoteSockRx.async_receive(boost::asio::buffer(buf),
+      [this, needToCheck] (const boost::system::error_code& error, size_t) {
+        if (needToCheck) {
+          BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
+        }
+        limitedIo.afterOp();
+      });
+    BOOST_REQUIRE_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  }
+
+  void
+  remoteWrite(const std::vector<uint8_t>& buf, bool needToCheck = true)
+  {
+    remoteSockTx.async_send_to(boost::asio::buffer(buf), udp::endpoint(multicastEp.address(), 7001),
+      [needToCheck] (const boost::system::error_code& error, size_t) {
+        if (needToCheck) {
+          BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
+        }
+      });
+    limitedIo.defer(time::seconds(1));
+  }
+
+protected:
+  LimitedIo limitedIo;
+  MulticastUdpTransport* transport;
+  udp::endpoint localEp;
+  udp::endpoint multicastEp;
+  const ip::address_v4 defaultAddr;
+  std::vector<Transport::Packet>* receivedPackets;
+
+private:
+  unique_ptr<Face> face;
+  udp::socket remoteSockRx;
+  udp::socket remoteSockTx;
+};
+
+} // namespace tests
+} // namespace face
+} // namespace nfd
+
+#endif // NFD_TESTS_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/multicast-udp-transport.t.cpp b/tests/daemon/face/multicast-udp-transport.t.cpp
index 545d4b8..ac1e33c 100644
--- a/tests/daemon/face/multicast-udp-transport.t.cpp
+++ b/tests/daemon/face/multicast-udp-transport.t.cpp
@@ -23,43 +23,82 @@
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "face/multicast-udp-transport.hpp"
 #include "transport-test-common.hpp"
 
+#include "multicast-udp-transport-fixture.hpp"
+
 namespace nfd {
 namespace face {
 namespace tests {
 
-using namespace nfd::tests;
-namespace ip = boost::asio::ip;
-using ip::udp;
-
 BOOST_AUTO_TEST_SUITE(Face)
-BOOST_FIXTURE_TEST_SUITE(TestMulticastUdpTransport, BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestMulticastUdpTransport, MulticastUdpTransportFixture)
 
-BOOST_AUTO_TEST_CASE(StaticPropertiesIpv4)
+BOOST_AUTO_TEST_CASE(StaticPropertiesNonLocalIpv4)
 {
-  udp::socket sockRx(g_io);
-  sockRx.open(udp::v4());
-  sockRx.set_option(udp::socket::reuse_address(true));
-  sockRx.bind(udp::endpoint(ip::address::from_string("127.0.0.1"), 7001));
+  SKIP_IF_IP_UNAVAILABLE(defaultAddr);
+  initialize(defaultAddr);
 
-  udp::socket sockTx(g_io);
-  sockTx.open(udp::v4());
-  sockTx.set_option(udp::socket::reuse_address(true));
-  sockTx.bind(udp::endpoint(udp::v4(), 7001));
+  checkStaticPropertiesInitialized(*transport);
 
-  MulticastUdpTransport transport(sockRx.local_endpoint(),
-                                  udp::endpoint(ip::address::from_string("230.15.19.47"), 7001),
-                                  std::move(sockRx), std::move(sockTx));
-  checkStaticPropertiesInitialized(transport);
+  BOOST_CHECK_EQUAL(transport->getLocalUri(),
+                    FaceUri("udp4://" + defaultAddr.to_string() + ":" + to_string(localEp.port())));
+  BOOST_CHECK_EQUAL(transport->getRemoteUri(),
+                    FaceUri("udp4://" + multicastEp.address().to_string() + ":" + to_string(multicastEp.port())));
+  BOOST_CHECK_EQUAL(transport->getScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
+  BOOST_CHECK_EQUAL(transport->getPersistency(), ndn::nfd::FACE_PERSISTENCY_PERMANENT);
+  BOOST_CHECK_EQUAL(transport->getLinkType(), ndn::nfd::LINK_TYPE_MULTI_ACCESS);
+  BOOST_CHECK_EQUAL(transport->getMtu(), 65535 - 60 - 8);
+}
 
-  BOOST_CHECK_EQUAL(transport.getLocalUri(), FaceUri("udp4://127.0.0.1:7001"));
-  BOOST_CHECK_EQUAL(transport.getRemoteUri(), FaceUri("udp4://230.15.19.47:7001"));
-  BOOST_CHECK_EQUAL(transport.getScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
-  BOOST_CHECK_EQUAL(transport.getPersistency(), ndn::nfd::FACE_PERSISTENCY_PERMANENT);
-  BOOST_CHECK_EQUAL(transport.getLinkType(), ndn::nfd::LINK_TYPE_MULTI_ACCESS);
-  BOOST_CHECK_EQUAL(transport.getMtu(), 65535 - 60 - 8);
+BOOST_AUTO_TEST_CASE(ReceiveMultipleRemoteEndpoints)
+{
+  SKIP_IF_IP_UNAVAILABLE(defaultAddr);
+  initialize(defaultAddr);
+
+  // remoteSockRx2 unnecessary for this test case - only remoteSockTx2 is needed
+  udp::socket remoteSockTx2(g_io);
+  remoteSockTx2.open(udp::v4());
+  remoteSockTx2.set_option(udp::socket::reuse_address(true));
+  remoteSockTx2.set_option(ip::multicast::enable_loopback(true));
+  remoteSockTx2.bind(udp::endpoint(ip::address_v4::any(), 7071));
+
+  Block pkt1 = ndn::encoding::makeStringBlock(300, "hello");
+  ndn::Buffer buf1(pkt1.begin(), pkt1.end());
+  remoteWrite(buf1);
+
+  Block pkt2 = ndn::encoding::makeStringBlock(301, "world");
+  ndn::Buffer buf2(pkt2.begin(), pkt2.end());
+  remoteWrite(buf2);
+
+  BOOST_CHECK_EQUAL(transport->getCounters().nInPackets, 2);
+  BOOST_CHECK_EQUAL(transport->getCounters().nInBytes, buf1.size() + buf2.size());
+  BOOST_CHECK_EQUAL(transport->getState(), TransportState::UP);
+
+  BOOST_REQUIRE_EQUAL(receivedPackets->size(), 2);
+  BOOST_CHECK_EQUAL(receivedPackets->at(0).remoteEndpoint,
+                    receivedPackets->at(1).remoteEndpoint);
+
+  udp::endpoint destEp(multicastEp.address(), localEp.port());
+  remoteSockTx2.async_send_to(boost::asio::buffer(buf1), destEp,
+    [] (const boost::system::error_code& error, size_t) {
+      BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
+    });
+  remoteSockTx2.async_send_to(boost::asio::buffer(buf2), destEp,
+    [] (const boost::system::error_code& error, size_t) {
+      BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
+    });
+  limitedIo.defer(time::seconds(1));
+
+  BOOST_CHECK_EQUAL(transport->getCounters().nInPackets, 4);
+  BOOST_CHECK_EQUAL(transport->getCounters().nInBytes, 2 * buf1.size() + 2 * buf2.size());
+  BOOST_CHECK_EQUAL(transport->getState(), TransportState::UP);
+
+  BOOST_REQUIRE_EQUAL(receivedPackets->size(), 4);
+  BOOST_CHECK_EQUAL(receivedPackets->at(2).remoteEndpoint,
+                    receivedPackets->at(3).remoteEndpoint);
+  BOOST_CHECK_NE(receivedPackets->at(0).remoteEndpoint,
+                 receivedPackets->at(2).remoteEndpoint);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestMulticastUdpTransport
diff --git a/tests/daemon/face/stream-transport.t.cpp b/tests/daemon/face/stream-transport.t.cpp
index 89470de..587c818 100644
--- a/tests/daemon/face/stream-transport.t.cpp
+++ b/tests/daemon/face/stream-transport.t.cpp
@@ -35,7 +35,9 @@
 BOOST_AUTO_TEST_SUITE(Face)
 BOOST_AUTO_TEST_SUITE(TestStreamTransport)
 
-typedef boost::mpl::vector<TcpTransportFixture, UnixStreamTransportFixture> StreamTransportFixtures;
+typedef boost::mpl::vector<TcpTransportFixture,
+                           UnixStreamTransportFixture
+                           > StreamTransportFixtures;
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(Send, T, StreamTransportFixtures, T)
 {
diff --git a/tests/daemon/face/unicast-udp-transport-fixture.hpp b/tests/daemon/face/unicast-udp-transport-fixture.hpp
index 1ec37b0..01698cb 100644
--- a/tests/daemon/face/unicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/unicast-udp-transport-fixture.hpp
@@ -46,6 +46,7 @@
   UnicastUdpTransportFixture()
     : transport(nullptr)
     , remoteSocket(g_io)
+    , defaultAddr(ip::address_v4::loopback())
     , receivedPackets(nullptr)
   {
   }
@@ -80,6 +81,19 @@
   }
 
   void
+  remoteRead(std::vector<uint8_t>& buf, bool needToCheck = true)
+  {
+    remoteSocket.async_receive(boost::asio::buffer(buf),
+      [this, needToCheck] (const boost::system::error_code& error, size_t) {
+        if (needToCheck) {
+          BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
+        }
+        limitedIo.afterOp();
+      });
+    BOOST_REQUIRE_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  }
+
+  void
   remoteWrite(const std::vector<uint8_t>& buf, bool needToCheck = true)
   {
     remoteSocket.async_send(boost::asio::buffer(buf),
@@ -96,6 +110,7 @@
   UnicastUdpTransport* transport;
   udp::endpoint localEp;
   udp::socket remoteSocket;
+  const ip::address defaultAddr;
   std::vector<Transport::Packet>* receivedPackets;
 
 private:
