diff --git a/EduNetworkBuilder/NetworkDevice.cs b/EduNetworkBuilder/NetworkDevice.cs index 9ee8e88..c9eb29a 100644 --- a/EduNetworkBuilder/NetworkDevice.cs +++ b/EduNetworkBuilder/NetworkDevice.cs @@ -1393,8 +1393,17 @@ namespace EduNetworkBuilder //If we are doing vlans, the vlan should match if we are doing management interface // //right now, just do it. - nic.PrimaryInterface().myIP = new NB_IPAddress(newip, gateway._mask.ToIpString(), IPAddressType.ip); - return true; + NetworkInterface nif = nic.PrimaryInterface(); + if(nif == null) + { //There are multiple interfaces, or there are no interfaces. + //If multiple interfaces, try one with the specified vlan. + nif = nic.InterfaceFromVlanTag(vlan); + } + if (nif != null) + { + nif.myIP = new NB_IPAddress(newip, gateway._mask.ToIpString(), IPAddressType.ip); + return true; + } } } return false;