diff --git a/src/vpp-api/vom/prefix.cpp b/src/vpp-api/vom/prefix.cpp
index 24fb57b..269c28f 100644
--- a/src/vpp-api/vom/prefix.cpp
+++ b/src/vpp-api/vom/prefix.cpp
@@ -281,32 +281,127 @@
   return (addr);
 }
 
-boost::asio::ip::address_v4
-route::prefix_t::mask() const
+boost::asio::ip::address_v6
+operator|(const boost::asio::ip::address_v6& addr1,
+          const boost::asio::ip::address_v6& addr2)
 {
-  uint32_t a;
+  boost::asio::ip::address_v6::bytes_type b1 = addr1.to_bytes();
+  boost::asio::ip::address_v6::bytes_type b2 = addr2.to_bytes();
 
-  a = ~((1 << mask_width()) - 1);
-  boost::asio::ip::address_v4 addr(a);
+  for (boost::asio::ip::address_v6::bytes_type::size_type ii = 0;
+       ii < b1.max_size(); ii++) {
+    b1[ii] |= b2[ii];
+  }
+
+  boost::asio::ip::address_v6 addr(b1);
   return (addr);
 }
 
-boost::asio::ip::address_v4
-route::prefix_t::low() const
+boost::asio::ip::address_v6 operator&(const boost::asio::ip::address_v6& addr1,
+                                      const boost::asio::ip::address_v6& addr2)
 {
-  boost::asio::ip::address_v4 low;
-  low = address().to_v4() & mask();
-  return (low);
+  boost::asio::ip::address_v6::bytes_type b1 = addr1.to_bytes();
+  boost::asio::ip::address_v6::bytes_type b2 = addr2.to_bytes();
+
+  for (boost::asio::ip::address_v6::bytes_type::size_type ii = 0;
+       ii < b1.max_size(); ii++) {
+    b1[ii] &= b2[ii];
+  }
+
+  boost::asio::ip::address_v6 addr(b1);
+  return (addr);
 }
 
-boost::asio::ip::address_v4
+boost::asio::ip::address_v6 operator~(const boost::asio::ip::address_v6& addr1)
+{
+  boost::asio::ip::address_v6::bytes_type b1 = addr1.to_bytes();
+
+  for (boost::asio::ip::address_v6::bytes_type::size_type ii = 0;
+       ii < b1.max_size(); ii++) {
+    b1[ii] = ~b1[ii];
+  }
+
+  boost::asio::ip::address_v6 addr(b1);
+  return (addr);
+}
+boost::asio::ip::address
+operator|(const boost::asio::ip::address& addr1,
+          const boost::asio::ip::address& addr2)
+{
+  if (addr1.is_v6())
+    return (addr1.to_v6() | addr2.to_v6());
+  else
+    return (addr1.to_v4() | addr2.to_v4());
+}
+
+boost::asio::ip::address operator&(const boost::asio::ip::address& addr1,
+                                   const boost::asio::ip::address& addr2)
+{
+  if (addr1.is_v6())
+    return (addr1.to_v6() & addr2.to_v6());
+  else
+    return (addr1.to_v4() & addr2.to_v4());
+}
+
+boost::asio::ip::address operator~(const boost::asio::ip::address& addr1)
+{
+  if (addr1.is_v6())
+    return ~(addr1.to_v6());
+  else
+    return ~(addr1.to_v4());
+}
+
+boost::asio::ip::address
+route::prefix_t::mask() const
+{
+  if (m_addr.is_v6()) {
+    boost::asio::ip::address_v6::bytes_type b =
+      boost::asio::ip::address_v6::any().to_bytes();
+
+    uint8_t n_bits = mask_width();
+
+    for (boost::asio::ip::address_v6::bytes_type::size_type ii = 0;
+         ii < b.max_size(); ii++) {
+      for (int8_t bit = 7; bit >= 0 && n_bits; bit--) {
+        b[ii] |= (1 << bit);
+        n_bits--;
+      }
+      if (!n_bits)
+        break;
+    }
+
+    return (boost::asio::ip::address_v6(b));
+  } else {
+    uint32_t a;
+
+    a = ~((1 << (32 - mask_width())) - 1);
+
+    return (boost::asio::ip::address_v4(a));
+  }
+}
+
+route::prefix_t
+route::prefix_t::low() const
+{
+  prefix_t pfx(*this);
+
+  pfx.m_addr = pfx.m_addr & pfx.mask();
+
+  return (pfx);
+}
+
+route::prefix_t
 route::prefix_t::high() const
 {
-  boost::asio::ip::address_v4 high;
-  high = address().to_v4() | ~mask();
-  return (high);
+  prefix_t pfx(*this);
+
+  pfx.m_addr = pfx.m_addr | ~pfx.mask();
+
+  return (pfx);
 }
-}
+
+}; // namespace VOM
+
 /*
  * fd.io coding-style-patch-verification: ON
  *
diff --git a/src/vpp-api/vom/prefix.hpp b/src/vpp-api/vom/prefix.hpp
index 3277929..e395e17 100644
--- a/src/vpp-api/vom/prefix.hpp
+++ b/src/vpp-api/vom/prefix.hpp
@@ -170,17 +170,17 @@
   /**
    * Return a address representation of the mask, e.g. 255.255.0.0
    */
-  boost::asio::ip::address_v4 mask() const;
+  boost::asio::ip::address mask() const;
 
   /**
    * get the lowest address in the prefix
    */
-  boost::asio::ip::address_v4 low() const;
+  prefix_t low() const;
 
   /**
    * Get the highest address in the prefix
    */
-  boost::asio::ip::address_v4 high() const;
+  prefix_t high() const;
 
   /**
    * Get the L3 protocol
@@ -208,6 +208,22 @@
 
 boost::asio::ip::address_v4 operator~(const boost::asio::ip::address_v4& addr1);
 
+boost::asio::ip::address_v6 operator|(const boost::asio::ip::address_v6& addr1,
+                                      const boost::asio::ip::address_v6& addr2);
+
+boost::asio::ip::address_v6 operator&(const boost::asio::ip::address_v6& addr1,
+                                      const boost::asio::ip::address_v6& addr2);
+
+boost::asio::ip::address_v6 operator~(const boost::asio::ip::address_v6& addr1);
+
+boost::asio::ip::address operator|(const boost::asio::ip::address& addr1,
+                                   const boost::asio::ip::address& addr2);
+
+boost::asio::ip::address operator&(const boost::asio::ip::address& addr1,
+                                   const boost::asio::ip::address& addr2);
+
+boost::asio::ip::address operator~(const boost::asio::ip::address& addr1);
+
 /**
  * Ostream printer for prefix_t
  */
diff --git a/src/vpp-api/vom/route_domain.cpp b/src/vpp-api/vom/route_domain.cpp
index c723f9f..e8c1e59 100644
--- a/src/vpp-api/vom/route_domain.cpp
+++ b/src/vpp-api/vom/route_domain.cpp
@@ -101,8 +101,8 @@
 {
   std::ostringstream s;
   s << "route-domain:["
-    << "table-id:" << m_table_id << " v4:" << m_hw_v4 << " v6:" << m_hw_v6
-    << "]";
+    << "table-id:" << m_table_id << " v4:" << m_hw_v4.to_string()
+    << " v6:" << m_hw_v6.to_string() << "]";
 
   return (s.str());
 }
