Do a better job with network interfaces when faced with vlans
This commit is contained in:
parent
073cba135e
commit
cecd14a901
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user