diff --git a/netbox/dcim/models.py b/netbox/dcim/models.py index b1c6b60b7..a0e2b4e0f 100644 --- a/netbox/dcim/models.py +++ b/netbox/dcim/models.py @@ -1032,6 +1032,13 @@ class Interface(models.Model): def __unicode__(self): return self.name + def clean(self): + + if self.form_factor == IFACE_FF_VIRTUAL and self.is_connected: + raise ValidationError({'form_factor': "Virtual interfaces cannot be connected to another interface or " + "circuit. Disconnect the interface or choose a physical form " + "factor."}) + @property def is_physical(self): return self.form_factor != IFACE_FF_VIRTUAL