diff --git a/xos/core/models/service.py b/xos/core/models/service.py
index 2b450e0..135dce9 100644
--- a/xos/core/models/service.py
+++ b/xos/core/models/service.py
@@ -168,12 +168,35 @@
 
                 # print "add instance", s
 
+    def get_vtn_src_nets(self):
+        nets=[]
+        for slice in self.slices.all():
+            for ns in slice.networkslices.all():
+                if not ns.network:
+                    continue
+                if ns.network.template.access in ["direct", "indirect"]:
+                    # skip access networks; we want to use the private network
+                    continue
+                if ns.network.name in ["wan_network", "lan_network"]:
+                    # we don't want to attach to the vCPE's lan or wan network
+                    # we only want to attach to its private network
+                    # TODO: fix hard-coding of network name
+                    continue
+                for cn in ns.network.controllernetworks.all():
+                    if cn.net_id:
+                        net = {"name": ns.network.name, "net_id": cn.net_id}
+                        nets.append(net)
+        return nets
+
     def get_vtn_nets(self):
         nets=[]
         for slice in self.slices.all():
             for ns in slice.networkslices.all():
                 if not ns.network:
                     continue
+                if ns.network.template.access not in ["direct", "indirect"]:
+                    # skip anything that's not an access network
+                    continue
                 for cn in ns.network.controllernetworks.all():
                     if cn.net_id:
                         net = {"name": ns.network.name, "net_id": cn.net_id}
@@ -195,11 +218,11 @@
     def get_vtn_dependencies_names(self):
         return [x["name"]+"_"+x["net_id"] for x in self.get_vtn_dependencies_nets()]
 
-    def get_vtn_ids(self):
-        return [x["net_id"] for x in self.get_vtn_nets()]
+    def get_vtn_src_ids(self):
+        return [x["net_id"] for x in self.get_vtn_src_nets()]
 
-    def get_vtn_names(self):
-        return [x["name"]+"_"+x["net_id"] for x in self.get_vtn_nets()]
+    def get_vtn_src_names(self):
+        return [x["name"]+"_"+x["net_id"] for x in self.get_vtn_src_nets()]
 
 
 class ServiceAttribute(PlCoreBase):
diff --git a/xos/core/xoslib/methods/vtn.py b/xos/core/xoslib/methods/vtn.py
index a912613..14dd458 100644
--- a/xos/core/xoslib/methods/vtn.py
+++ b/xos/core/xoslib/methods/vtn.py
@@ -38,7 +38,7 @@
     def get_services_names(self, request, pk=None):
         result = {}
         for service in Service.objects.all():
-           for id in service.get_vtn_names():
+           for id in service.get_vtn_src_names():
                dependencies = service.get_vtn_dependencies_names()
                if dependencies:
                    result[id] = dependencies
@@ -47,7 +47,7 @@
     def get_services(self, request, pk=None):
         result = {}
         for service in Service.objects.all():
-           for id in service.get_vtn_ids():
+           for id in service.get_vtn_src_ids():
                dependencies = service.get_vtn_dependencies_ids()
                if dependencies:
                    result[id] = dependencies
