diff --git a/scripts/nbhelper.py b/scripts/nbhelper.py
index ecdfc66..d91108f 100644
--- a/scripts/nbhelper.py
+++ b/scripts/nbhelper.py
@@ -143,12 +143,16 @@
 
         # Get the Device and Virtual Machines from Netbox API
         for device_data in netboxapi.dcim.devices.filter(tenant=self.tenant.slug):
-            self.devices.append(NBDevice(device_data))
+            device = NBDevice(device_data)
+            device.tenant = self
+            self.devices.append(device)
 
         for vm_data in netboxapi.virtualization.virtual_machines.filter(
             tenant=self.tenant.slug
         ):
-            self.vms.append(NBVirtualMachine(vm_data))
+            vm = NBVirtualMachine(vm_data)
+            vm.tenant = self
+            self.vms.append(vm)
 
     def get_prefixes(self):
         """Get the IP Prefixes owns by current tenant"""
@@ -292,6 +296,12 @@
         if prefix.reserved_ips:
             return list(prefix.reserved_ips.values())
 
+    def check_ip_belonging(self, ip):
+        """
+        Check if an IP address is belonging to this prefix
+        """
+        return ip in netaddr.IPSet([self.data.prefix])
+
     def parent(self):
         """
         Get the parent prefix to this prefix
@@ -374,6 +384,7 @@
         self.data = data
 
         # The AssignedObject attributes
+        self.tenant = None
         self.id = data.id
         self.name = data.name
         self.ips = dict()
@@ -573,6 +584,14 @@
                 if interface.mgmt_only is True or str(interface.type) == "Virtual":
                     continue
 
+                if not any(
+                    [
+                        p.check_ip_belonging(address)
+                        for p in self.tenant.prefixes.values()
+                    ]
+                ):
+                    continue
+
                 self.netplan_config["ethernets"].setdefault(interface.name, {})
                 self.netplan_config["ethernets"][interface.name].setdefault(
                     "addresses", []
@@ -636,7 +655,8 @@
                 "addresses": [ip.address for ip in virtual_if_ips],
             }
 
-            if routes:
+            # Only the fabric virtual interface will need to route to other network segments
+            if routes and "fab" in virtual_if.name:
                 self.netplan_config["vlans"][virtual_if.name]["routes"] = routes
 
         return self.netplan_config
@@ -695,7 +715,9 @@
                 ):
                     for ip, device in prefix.aos.items():
                         if device.name == self.name:
-                            ret["ue_routing"]["snat_addr"] = ip
+                            ret["ue_routing"]["snat_addr"] = str(
+                                netaddr.IPNetwork(ip).ip
+                            )
                             break
 
         return ret
