Can lock ourselves out of a switch

This commit is contained in:
Tim Young 2016-11-02 16:27:43 -05:00
parent 8af09704ab
commit c1bce08f77
13 changed files with 2789 additions and 61 deletions

View File

@ -11,10 +11,10 @@
<AssemblyName>EduNetworkBuilder</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<IsWebBootstrapper>true</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Background</UpdateMode>
<UpdateInterval>7</UpdateInterval>
@ -22,12 +22,13 @@
<UpdatePeriodically>true</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<InstallUrl>http://tyounglightsys.ddns.info/EduNetworkBuilder/v1/</InstallUrl>
<UpdateUrl>http://tyounglightsys.ddns.info/EduNetworkBuilder/v1/</UpdateUrl>
<ProductName>EduNetworkBuilder</ProductName>
<PublisherName>Tim Young</PublisherName>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.htm</WebPage>
<ApplicationRevision>28</ApplicationRevision>
<ApplicationRevision>29</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
@ -279,8 +280,10 @@
<None Include="Resources\Level5_WirelessRepeater2.enbx" />
<None Include="Resources\Level5_WirelessRouters.enbx" />
<None Include="Resources\Level6_ForbiddenVLAN.enbx" />
<None Include="Resources\Level6_SorryBoss.enbx" />
<None Include="Resources\Level6_TaggedBetweenSwitches.enbx" />
<None Include="Resources\level6_UntaggedAndDHCP.enbx" />
<None Include="Resources\Level6_VLANFrustrations.enbx" />
<None Include="Resources\Level6_VLANRouting.enbx" />
<None Include="Resources\Level6_VLANRouting2.enbx" />
<None Include="Resources\Level6_VLAN_Intro.enbx" />

View File

@ -72,7 +72,7 @@ namespace EduNetworkBuilder
Level5_WirelessRouters, Level5_WirelessDevices, Level5_WirelessBridge, Level5_WirelessRepeater, Level5_WirelessRepeater2,
Level5_WirelessAccessPoint, Level5_WirelessCorruption, Level5_Failed, Level5_LostPacket, Level5_HereComesTrouble,
Level6_VLAN_Intro, Level6_VLAN_Intro2, Level6_ForbiddenVLAN, Level6_TaggedBetweenSwitches, Level6_VLANRouting,
Level6_VLANRouting2, level6_UntaggedAndDHCP,
Level6_VLANRouting2, level6_UntaggedAndDHCP, Level6_SorryBoss, Level6_VLANFrustrations,
}
public enum DebugPausePoint { none=0, packet_create=1, packet_kill=2,

View File

@ -580,72 +580,83 @@ namespace EduNetworkBuilder
private void pbNetworkView_RightMouseUp(NetworkDevice ReleasedOn, MouseEventArgs e)
{
int index = 0;
bool LockedOut = false;
if (pbNetworkView.ContextMenuStrip == null)
{
pbNetworkView.ContextMenuStrip = new ContextMenuStrip();
}
if (ReleasedOn != null) LockedOut = ReleasedOn.DeviceIsLockedOutByVLANs();
pbNetworkView.ContextMenuStrip.Items.Clear();
if (ReleasedOn != null && ReleasedOn.IsNotNetDevice())
if (!LockedOut)
{
List<string> DoneList = new List<string>();
foreach (string tStr in myNetwork.GetIncompleteTestDestinations(ReleasedOn.hostname, true))
if (ReleasedOn != null && ReleasedOn.IsNotNetDevice())
{
if (!DoneList.Contains(tStr))
List<string> DoneList = new List<string>();
foreach (string tStr in myNetwork.GetIncompleteTestDestinations(ReleasedOn.hostname, true))
{
pbNetworkView.ContextMenuStrip.Items.Add(string.Format(NB.Translate("_PingStr"), tStr));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Ping_Name_Click;
DoneList.Add(tStr);
if (!DoneList.Contains(tStr))
{
pbNetworkView.ContextMenuStrip.Items.Add(string.Format(NB.Translate("_PingStr"), tStr));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Ping_Name_Click;
DoneList.Add(tStr);
}
}
DoneList.Clear();
foreach (string tStr in myNetwork.GetIncompleteTestDestinations(ReleasedOn.hostname, false))
{
if (!DoneList.Contains(tStr))
{
pbNetworkView.ContextMenuStrip.Items.Add(string.Format(NB.Translate("H_ARP_TitleStr"), tStr));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Arp_Name_Click;
DoneList.Add(tStr);
}
}
}
DoneList.Clear();
foreach (string tStr in myNetwork.GetIncompleteTestDestinations(ReleasedOn.hostname, false))
if (ReleasedOn != null && ReleasedOn.IsNotNetDevice())
{
if (!DoneList.Contains(tStr))
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("_Ping1"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Ping_Click;
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("H_ARP_Title"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Arp_Click;
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_NetViewClr"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_ArpClear_Click;
}
if (ReleasedOn != null)
{
if (!myNetwork.ItemIsCritical(ReleasedOn.hostname))
{
pbNetworkView.ContextMenuStrip.Items.Add(string.Format(NB.Translate("H_ARP_TitleStr"), tStr));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Arp_Name_Click;
DoneList.Add(tStr);
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("_Delete"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Delete_Click;
}
}
if (ReleasedOn != null && ReleasedOn.IsNotNetDevice())
{
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("_Edit"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Edit_Click;
}
if (ReleasedOn != null)
{
ItemClickedOn = ReleasedOn;
if (ReleasedOn.HasDHCPNic())
{
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_NetViewDHCP"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_DHCPRequest_Click;
}
foreach (string host in ReleasedOn.ListOfConnectedHosts())
{
pbNetworkView.ContextMenuStrip.Items.Add(string.Format(NB.Translate("NB_NetViewRmLnkStr"), host));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_RemoveLink_Click;
}
}
}
if (ReleasedOn != null && ReleasedOn.IsNotNetDevice())
else //we are locked out.
{
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("_Ping1"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Ping_Click;
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("H_ARP_Title"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Arp_Click;
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_NetViewClr"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_ArpClear_Click;
pbNetworkView.ContextMenuStrip.Items.Add(string.Format(NB.Translate("NB_Reset")));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Reset_Click;
}
if (ReleasedOn != null)
{
if (!myNetwork.ItemIsCritical(ReleasedOn.hostname))
{
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("_Delete"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Delete_Click;
}
}
if (ReleasedOn != null && ReleasedOn.IsNotNetDevice())
{
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("_Edit"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Edit_Click;
}
if (ReleasedOn != null)
{
ItemClickedOn = ReleasedOn;
if(ReleasedOn.HasDHCPNic())
{
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_NetViewDHCP"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_DHCPRequest_Click;
}
foreach (string host in ReleasedOn.ListOfConnectedHosts())
{
pbNetworkView.ContextMenuStrip.Items.Add(string.Format(NB.Translate("NB_NetViewRmLnkStr"), host));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_RemoveLink_Click;
}
}
if(ReleasedOn != null && myNetwork.VLANsEnabled)
if (ReleasedOn != null && myNetwork.VLANsEnabled)
{
int MenuIndex = pbNetworkView.ContextMenuStrip.Items.Count;
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_ColorStr"));
@ -655,8 +666,6 @@ namespace EduNetworkBuilder
(pbNetworkView.ContextMenuStrip.Items[MenuIndex] as ToolStripMenuItem).DropDownItems.Add(NB.Translate("NB_Green"), null, pbNetworkView_Color_Click);
(pbNetworkView.ContextMenuStrip.Items[MenuIndex] as ToolStripMenuItem).DropDownItems.Add(NB.Translate("NB_Orange"), null, pbNetworkView_Color_Click);
(pbNetworkView.ContextMenuStrip.Items[MenuIndex] as ToolStripMenuItem).DropDownItems.Add(NB.Translate("NB_Cyan"), null, pbNetworkView_Color_Click);
}
if (ReleasedOn == null)
{
@ -715,9 +724,17 @@ namespace EduNetworkBuilder
myNetwork.TestForCompletion(true);
}
private void pbNetworkView_Reset_Click(object sender, EventArgs e)
{
if (ItemClickedOn == null) return;
ItemClickedOn.ClearIPs(); //reset the device
UpdateVisuals();
}
private void pbNetworkView_Edit_Click(object sender, EventArgs e)
{
if (ItemClickedOn == null) return;
if (ItemClickedOn.DeviceIsLockedOutByVLANs()) return; //we cannot edit this
if (ItemClickedOn.GetNetType() == NetworkComponentType.microwave || ItemClickedOn.GetNetType() == NetworkComponentType.fluorescent)
return;
if (ItemClickedOn != null)

View File

@ -757,15 +757,22 @@ namespace EduNetworkBuilder
{
foreach(NetworkInterface nf in interfaces)
{
if(myNicType != NicType.lo)
if (myNicType != NicType.lo)
{
nf.myIP = new IPAddress(NB.ZeroIPString);
nf.SetVLANTag(1, VLANTagType.Untagged);
}
}
}
public NetworkInterface InterfaceFromVlanTag(Packet tPacket)
{
int ID = tPacket.VLANID;
foreach(NetworkInterface oneIF in interfaces)
return InterfaceFromVlanTag(ID);
}
public NetworkInterface InterfaceFromVlanTag(int ID)
{
foreach (NetworkInterface oneIF in interfaces)
{
if (oneIF.GetVLANTag(ID) != VLANTagType.Forbidden)
return oneIF;

View File

@ -1303,6 +1303,7 @@ namespace EduNetworkBuilder
{
bool typesMatch=false;
if (tPacket.sourceIP == null) return ResponseToPacket.reject;
if (tPacket.TsourceIP != null && !tPacket.TsourceIP.IsLocal(tPacket.destIP)) return ResponseToPacket.none;
foreach(IPConnectionEntry ipc in IPConnections)
{
if(ipc.What == PacketType.dhcp_request)
@ -1378,7 +1379,8 @@ namespace EduNetworkBuilder
// and we process arrival
bool MacAddressMatch = HasMac(tPacket.destMAC);
bool ExactMatch = HasIPAddress(tPacket.destIP);
//It is an exact match if it is coming from a local source.
bool ExactMatch = HasIPAddress(tPacket.destIP) && (tPacket.TsourceIP == null || tPacket.TsourceIP.IsLocal(tPacket.destIP));
bool BroadcastMatch = HasBroadcastAddress(tPacket.destIP);
bool NeedsRouting = MacAddressMatch && (!ExactMatch && !BroadcastMatch);
@ -1645,6 +1647,31 @@ namespace EduNetworkBuilder
bool isbroadcast = HasBroadcastAddress(tPacket);
if (!isbroadcast || (isbroadcast && HasLocalNic(tPacket.sourceIP)))
{
//We would be responding to it. We have an odd case for switches.
//Verify that the management IP can talk to the packet
if(myType == NetworkComponentType.net_switch || myType == NetworkComponentType.wrouter)
{
//only a few devices have management ips
NetworkCard nic = HubManagementCard();
if(nic != null)
{
NetworkInterface nif = nic.GetInterface(0); //management interfaces only have one ip
if(nif != null)
{
VLANTagType VTT = nif.GetVLANTag(tPacket.VLANID);
if(VTT == VLANTagType.Forbidden)
{
//we cannot ping! The packet is blocked by vlan
//Console.WriteLine("blocked by vlan");
tPacket.AddMessage(DebugLevel.info, NB.Translate("ND_PrepPackVLANErr"));
tPacket.Tracking.Status = NB.LeftPad(hostname) + " " + string.Format(NB.Translate("ND_PrepPackVLANErr")) + tPacket.sourceIP.GetIP.ToIpString() + " -> " + hostname;
tPacket.MyStatus = PacketStatus.finished_failed;
return;
}
}
}
}
nPacket = new Packet(this, tPacket.sourceIP, "", PacketType.ping_answer, tPacket.packetID);
nPacket.OriginalDestIP = tPacket.destIP;
nPacket.isFresh = true; //So it starts from here
@ -1701,7 +1728,8 @@ namespace EduNetworkBuilder
if (tPacket.MyType == PacketType.ping_answer)
{
ResponseToPacket response = HowToRespondToPacket(tPacket);
if (response == ResponseToPacket.accept || HasIPAddress(tPacket.destIP))
if (response == ResponseToPacket.none) return; //We do not do anything with it here.
if (response == ResponseToPacket.accept || (HasIPAddress(tPacket.destIP) && (tPacket.TsourceIP == null || tPacket.destIP.IsLocal(tPacket.TsourceIP))))
{
if (tPacket.health < 100)
{
@ -1956,6 +1984,33 @@ namespace EduNetworkBuilder
return null;
}
public bool DeviceIsLockedOutByVLANs()
{
if (myType != NetworkComponentType.net_switch && myType != NetworkComponentType.wrouter)
return false; //We can only be locked out of a few things.
NetworkCard nic = HubManagementCard();
if (nic == null) return false; //this should never happen. Eject for now.
NetworkInterface nif = nic.GetInterface(0);
if (nif == null) return false;//this should never happen. Eject for now.
int managementID = nif.GetNonForbiddenVLANID();
bool lockedOUT = true;
foreach(NetworkCard tCard in NICs)
{
if (tCard.GetNicType == NicType.lo) continue;
if (tCard.GetNicType == NicType.management_interface) continue;
NetworkInterface tNIF = tCard.InterfaceFromVlanTag(managementID);
if(tNIF != null)
{
lockedOUT = false;
break;
}
}
return lockedOUT;
}
public List<IPAddress> IPAddressList()
{
List<IPAddress> thelist = new List<IPAddress>();

View File

@ -72,6 +72,16 @@ namespace EduNetworkBuilder
return VLANTagType.Forbidden; //if not defined, it is forbidden
}
public int GetNonForbiddenVLANID()
{
foreach(VLANInfo vin in VLANs)
{
if (vin.Tag != VLANTagType.Forbidden)
return vin.ID;
}
return -999;
}
public void SetVLANTag(int id, VLANTagType Tag)
{
bool foundit = false;

View File

@ -782,6 +782,16 @@ namespace EduNetworkBuilder.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] Level6_SorryBoss {
get {
object obj = ResourceManager.GetObject("Level6_SorryBoss", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
@ -822,6 +832,16 @@ namespace EduNetworkBuilder.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] Level6_VLANFrustrations {
get {
object obj = ResourceManager.GetObject("Level6_VLANFrustrations", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>

View File

@ -415,4 +415,10 @@
<data name="VLAN" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\VLAN.enbx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Level6_SorryBoss" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Level6_SorryBoss.enbx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Level6_VLANFrustrations" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Level6_VLANFrustrations.enbx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@ -0,0 +1,874 @@
<?xml version="1.0" encoding="utf-8"?>
<EduNetworkBuilder>
<!--This is a network file for EduNetworkBuilder.-->
<Network>
<en_message>Today your boss brought in a laptop, plugged it into a network-port in his office, and then called you in when it did not work. Fix it, please.</en_message>
<en_title>Sorry, Boss.</en_title>
<height>1024</height>
<width>1024</width>
<itemsize>100</itemsize>
<showlabels>True</showlabels>
<level>6</level>
<sortorder>8</sortorder>
<uniqueidentifier>153</uniqueidentifier>
<startinghelplevel>full</startinghelplevel>
<vlansenabled>True</vlansenabled>
<VLANPacketColors>True</VLANPacketColors>
<device>
<hostname>firewall0</hostname>
<size>100</size>
<uniqueidentifier>146</uniqueidentifier>
<location>390,180</location>
<mytype>firewall</mytype>
<isdns>False</isdns>
<isdhcp>True</isdhcp>
<gateway>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>gw</type>
</gateway>
<nic>
<nictype>lo</nictype>
<nicname>lo0</nicname>
<myid>
<hostid>146</hostid>
<nicid>147</nicid>
<hostname>firewall0</hostname>
<nicname>lo0</nicname>
</myid>
<nictype>lo</nictype>
<uniqueidentifier>147</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<ssid />
<interface>
<nicname>lo0</nicname>
<myip>
<ip>127.0.0.1</ip>
<mask>255.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>wan</nictype>
<nicname>wan0</nicname>
<myid>
<hostid>146</hostid>
<nicid>150</nicid>
<hostname>firewall0</hostname>
<nicname>wan0</nicname>
</myid>
<nictype>wan</nictype>
<uniqueidentifier>150</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<ssid />
<interface>
<nicname>wan0</nicname>
<myip>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>eth</nictype>
<nicname>eth0</nicname>
<myid>
<hostid>146</hostid>
<nicid>148</nicid>
<hostname>firewall0</hostname>
<nicname>eth0</nicname>
</myid>
<nictype>eth</nictype>
<uniqueidentifier>148</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<ssid />
<interface>
<nicname>eth0</nicname>
<myip>
<ip>192.168.1.1</ip>
<mask>255.255.255.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Tagged</VLAN>
</interface>
<interface>
<nicname>eth0:1</nicname>
<myip>
<ip>192.168.2.1</ip>
<mask>255.255.255.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Forbidden</VLAN>
<VLAN
ID="2">Tagged</VLAN>
</interface>
</nic>
<nic>
<nictype>eth</nictype>
<nicname>eth1</nicname>
<myid>
<hostid>146</hostid>
<nicid>149</nicid>
<hostname>firewall0</hostname>
<nicname>eth1</nicname>
</myid>
<nictype>eth</nictype>
<uniqueidentifier>149</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<ssid />
<interface>
<nicname>eth1</nicname>
<myip>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
<dhcprange>
<ip>127.0.0.1</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>route</type>
</dhcprange>
<dhcprange>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>route</type>
</dhcprange>
<dhcprange>
<ip>192.168.1.1</ip>
<mask>192.168.1.10</mask>
<gateway>192.168.1.20</gateway>
<type>route</type>
</dhcprange>
<dhcprange>
<ip>192.168.2.1</ip>
<mask>192.168.2.10</mask>
<gateway>192.168.2.20</gateway>
<type>route</type>
</dhcprange>
</device>
<device>
<hostname>laptop0</hostname>
<size>100</size>
<uniqueidentifier>142</uniqueidentifier>
<location>470,790</location>
<mytype>laptop</mytype>
<isdns>False</isdns>
<isdhcp>False</isdhcp>
<morphcolor>Green</morphcolor>
<gateway>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>gw</type>
</gateway>
<nic>
<nictype>lo</nictype>
<nicname>lo0</nicname>
<myid>
<hostid>142</hostid>
<nicid>143</nicid>
<hostname>laptop0</hostname>
<nicname>lo0</nicname>
</myid>
<nictype>lo</nictype>
<uniqueidentifier>143</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<ssid />
<interface>
<nicname>lo0</nicname>
<myip>
<ip>127.0.0.1</ip>
<mask>255.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>eth</nictype>
<nicname>eth0</nicname>
<myid>
<hostid>142</hostid>
<nicid>144</nicid>
<hostname>laptop0</hostname>
<nicname>eth0</nicname>
</myid>
<nictype>eth</nictype>
<uniqueidentifier>144</uniqueidentifier>
<usesdhcp>True</usesdhcp>
<encryptionkey />
<ssid />
<interface>
<nicname>eth0</nicname>
<myip>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
</device>
<device>
<hostname>net_switch0</hostname>
<size>100</size>
<uniqueidentifier>109</uniqueidentifier>
<location>390,400</location>
<mytype>net_switch</mytype>
<isdns>False</isdns>
<isdhcp>False</isdhcp>
<gateway>
<ip>192.168.1.1</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>gw</type>
</gateway>
<nic>
<nictype>lo</nictype>
<nicname>lo0</nicname>
<myid>
<hostid>109</hostid>
<nicid>110</nicid>
<hostname>net_switch0</hostname>
<nicname>lo0</nicname>
</myid>
<nictype>lo</nictype>
<uniqueidentifier>110</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>lo0</nicname>
<myip>
<ip>127.0.0.1</ip>
<mask>255.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>management_interface</nictype>
<nicname>management_interface0</nicname>
<myid>
<hostid>109</hostid>
<nicid>111</nicid>
<hostname>net_switch0</hostname>
<nicname>management_interface0</nicname>
</myid>
<nictype>management_interface</nictype>
<uniqueidentifier>111</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>management_interface0</nicname>
<myip>
<ip>192.168.1.5</ip>
<mask>255.255.255.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>port</nictype>
<nicname>port1</nicname>
<myid>
<hostid>109</hostid>
<nicid>112</nicid>
<hostname>net_switch0</hostname>
<nicname>port1</nicname>
</myid>
<nictype>port</nictype>
<uniqueidentifier>112</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>port1</nicname>
<myip>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Tagged</VLAN>
<VLAN
ID="2">Tagged</VLAN>
</interface>
</nic>
<nic>
<nictype>port</nictype>
<nicname>port2</nicname>
<myid>
<hostid>109</hostid>
<nicid>113</nicid>
<hostname>net_switch0</hostname>
<nicname>port2</nicname>
</myid>
<nictype>port</nictype>
<uniqueidentifier>113</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>port2</nicname>
<myip>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Forbidden</VLAN>
<VLAN
ID="2">Forbidden</VLAN>
</interface>
</nic>
<nic>
<nictype>port</nictype>
<nicname>port3</nicname>
<myid>
<hostid>109</hostid>
<nicid>114</nicid>
<hostname>net_switch0</hostname>
<nicname>port3</nicname>
</myid>
<nictype>port</nictype>
<uniqueidentifier>114</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>port3</nicname>
<myip>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
<VLAN
ID="2">Forbidden</VLAN>
</interface>
</nic>
<nic>
<nictype>port</nictype>
<nicname>port4</nicname>
<myid>
<hostid>109</hostid>
<nicid>115</nicid>
<hostname>net_switch0</hostname>
<nicname>port4</nicname>
</myid>
<nictype>port</nictype>
<uniqueidentifier>115</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>port4</nicname>
<myip>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
<VLAN
ID="2">Forbidden</VLAN>
</interface>
</nic>
<nic>
<nictype>port</nictype>
<nicname>port5</nicname>
<myid>
<hostid>109</hostid>
<nicid>116</nicid>
<hostname>net_switch0</hostname>
<nicname>port5</nicname>
</myid>
<nictype>port</nictype>
<uniqueidentifier>116</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>port5</nicname>
<myip>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Forbidden</VLAN>
<VLAN
ID="2">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>port</nictype>
<nicname>port6</nicname>
<myid>
<hostid>109</hostid>
<nicid>117</nicid>
<hostname>net_switch0</hostname>
<nicname>port6</nicname>
</myid>
<nictype>port</nictype>
<uniqueidentifier>117</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>port6</nicname>
<myip>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Forbidden</VLAN>
<VLAN
ID="2">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>port</nictype>
<nicname>port7</nicname>
<myid>
<hostid>109</hostid>
<nicid>118</nicid>
<hostname>net_switch0</hostname>
<nicname>port7</nicname>
</myid>
<nictype>port</nictype>
<uniqueidentifier>118</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>port7</nicname>
<myip>
<ip>0.0.0.0</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Forbidden</VLAN>
<VLAN
ID="2">Forbidden</VLAN>
</interface>
</nic>
</device>
<device>
<hostname>pc0</hostname>
<size>100</size>
<uniqueidentifier>121</uniqueidentifier>
<location>80,490</location>
<mytype>pc</mytype>
<isdns>False</isdns>
<isdhcp>False</isdhcp>
<morphcolor>Purple</morphcolor>
<gateway>
<ip>192.168.1.1</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>gw</type>
</gateway>
<nic>
<nictype>lo</nictype>
<nicname>lo0</nicname>
<myid>
<hostid>121</hostid>
<nicid>122</nicid>
<hostname>pc0</hostname>
<nicname>lo0</nicname>
</myid>
<nictype>lo</nictype>
<uniqueidentifier>122</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>lo0</nicname>
<myip>
<ip>127.0.0.1</ip>
<mask>255.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>eth</nictype>
<nicname>eth0</nicname>
<myid>
<hostid>121</hostid>
<nicid>123</nicid>
<hostname>pc0</hostname>
<nicname>eth0</nicname>
</myid>
<nictype>eth</nictype>
<uniqueidentifier>123</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>eth0</nicname>
<myip>
<ip>192.168.1.2</ip>
<mask>255.255.255.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
</device>
<device>
<hostname>pc1</hostname>
<size>100</size>
<uniqueidentifier>124</uniqueidentifier>
<location>90,820</location>
<mytype>pc</mytype>
<isdns>False</isdns>
<isdhcp>False</isdhcp>
<morphcolor>Purple</morphcolor>
<gateway>
<ip>192.168.1.1</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>gw</type>
</gateway>
<nic>
<nictype>lo</nictype>
<nicname>lo0</nicname>
<myid>
<hostid>124</hostid>
<nicid>125</nicid>
<hostname>pc1</hostname>
<nicname>lo0</nicname>
</myid>
<nictype>lo</nictype>
<uniqueidentifier>125</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>lo0</nicname>
<myip>
<ip>127.0.0.1</ip>
<mask>255.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>eth</nictype>
<nicname>eth0</nicname>
<myid>
<hostid>124</hostid>
<nicid>126</nicid>
<hostname>pc1</hostname>
<nicname>eth0</nicname>
</myid>
<nictype>eth</nictype>
<uniqueidentifier>126</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>eth0</nicname>
<myip>
<ip>192.168.1.3</ip>
<mask>255.255.255.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
</device>
<device>
<hostname>pc2</hostname>
<size>100</size>
<uniqueidentifier>127</uniqueidentifier>
<location>710,820</location>
<mytype>pc</mytype>
<isdns>False</isdns>
<isdhcp>False</isdhcp>
<morphcolor>Green</morphcolor>
<gateway>
<ip>192.168.2.1</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>gw</type>
</gateway>
<nic>
<nictype>lo</nictype>
<nicname>lo0</nicname>
<myid>
<hostid>127</hostid>
<nicid>128</nicid>
<hostname>pc2</hostname>
<nicname>lo0</nicname>
</myid>
<nictype>lo</nictype>
<uniqueidentifier>128</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>lo0</nicname>
<myip>
<ip>127.0.0.1</ip>
<mask>255.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>eth</nictype>
<nicname>eth0</nicname>
<myid>
<hostid>127</hostid>
<nicid>129</nicid>
<hostname>pc2</hostname>
<nicname>eth0</nicname>
</myid>
<nictype>eth</nictype>
<uniqueidentifier>129</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>eth0</nicname>
<myip>
<ip>192.168.2.3</ip>
<mask>255.255.255.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
</device>
<device>
<hostname>pc3</hostname>
<size>100</size>
<uniqueidentifier>130</uniqueidentifier>
<location>760,500</location>
<mytype>pc</mytype>
<isdns>False</isdns>
<isdhcp>False</isdhcp>
<morphcolor>Green</morphcolor>
<gateway>
<ip>192.168.2.1</ip>
<mask>0.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>gw</type>
</gateway>
<nic>
<nictype>lo</nictype>
<nicname>lo0</nicname>
<myid>
<hostid>130</hostid>
<nicid>131</nicid>
<hostname>pc3</hostname>
<nicname>lo0</nicname>
</myid>
<nictype>lo</nictype>
<uniqueidentifier>131</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>lo0</nicname>
<myip>
<ip>127.0.0.1</ip>
<mask>255.0.0.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
<nic>
<nictype>eth</nictype>
<nicname>eth0</nicname>
<myid>
<hostid>130</hostid>
<nicid>132</nicid>
<hostname>pc3</hostname>
<nicname>eth0</nicname>
</myid>
<nictype>eth</nictype>
<uniqueidentifier>132</uniqueidentifier>
<usesdhcp>False</usesdhcp>
<encryptionkey />
<interface>
<nicname>eth0</nicname>
<myip>
<ip>192.168.2.2</ip>
<mask>255.255.255.0</mask>
<gateway>0.0.0.0</gateway>
<type>ip</type>
</myip>
<VLAN
ID="1">Untagged</VLAN>
</interface>
</nic>
</device>
<link>
<SrcNic>
<hostid>121</hostid>
<nicid>123</nicid>
<hostname>pc0</hostname>
<nicname>eth0</nicname>
</SrcNic>
<DstNic>
<hostid>109</hostid>
<nicid>114</nicid>
<hostname>net_switch0</hostname>
<nicname>port3</nicname>
</DstNic>
<hostname />
<linktype>normal</linktype>
<uniqueidentifier>133</uniqueidentifier>
</link>
<link>
<SrcNic>
<hostid>124</hostid>
<nicid>126</nicid>
<hostname>pc1</hostname>
<nicname>eth0</nicname>
</SrcNic>
<DstNic>
<hostid>109</hostid>
<nicid>115</nicid>
<hostname>net_switch0</hostname>
<nicname>port4</nicname>
</DstNic>
<hostname />
<linktype>normal</linktype>
<uniqueidentifier>134</uniqueidentifier>
</link>
<link>
<SrcNic>
<hostid>127</hostid>
<nicid>129</nicid>
<hostname>pc2</hostname>
<nicname>eth0</nicname>
</SrcNic>
<DstNic>
<hostid>109</hostid>
<nicid>116</nicid>
<hostname>net_switch0</hostname>
<nicname>port5</nicname>
</DstNic>
<hostname />
<linktype>normal</linktype>
<uniqueidentifier>135</uniqueidentifier>
</link>
<link>
<SrcNic>
<hostid>130</hostid>
<nicid>132</nicid>
<hostname>pc3</hostname>
<nicname>eth0</nicname>
</SrcNic>
<DstNic>
<hostid>109</hostid>
<nicid>117</nicid>
<hostname>net_switch0</hostname>
<nicname>port6</nicname>
</DstNic>
<hostname />
<linktype>normal</linktype>
<uniqueidentifier>136</uniqueidentifier>
</link>
<link>
<SrcNic>
<hostid>146</hostid>
<nicid>148</nicid>
<hostname>firewall0</hostname>
<nicname>eth0</nicname>
</SrcNic>
<DstNic>
<hostid>109</hostid>
<nicid>112</nicid>
<hostname>net_switch0</hostname>
<nicname>port1</nicname>
</DstNic>
<hostname />
<linktype>normal</linktype>
<uniqueidentifier>151</uniqueidentifier>
</link>
<link>
<SrcNic>
<hostid>142</hostid>
<nicid>144</nicid>
<hostname>laptop0</hostname>
<nicname>eth0</nicname>
</SrcNic>
<DstNic>
<hostid>109</hostid>
<nicid>118</nicid>
<hostname>net_switch0</hostname>
<nicname>port7</nicname>
</DstNic>
<hostname />
<linktype>normal</linktype>
<uniqueidentifier>152</uniqueidentifier>
</link>
<nettest>
<shost>laptop0</shost>
<dhost>pc1</dhost>
<thetest>SuccessfullyPings</thetest>
</nettest>
<tag>VLAN</tag>
<VLANName
ID="1"
Color="Purple">Default</VLANName>
<VLANName
ID="2"
Color="Green">Staff</VLANName>
</Network>
</EduNetworkBuilder>

File diff suppressed because it is too large Load Diff

View File

@ -1609,4 +1609,12 @@
<value>When packets are passing across a VLAN link, color the packets so we can visualize them better.</value>
<comment>OW_OWVLANColoredPacketsTT = When packets are passing across a VLAN link, color the packets so we can visualize them better.</comment>
</data>
<data name="NB_Reset" xml:space="preserve">
<value>Reset</value>
<comment>NB_Reset = Reset</comment>
</data>
<data name="ND_PrepPackVLANErr" xml:space="preserve">
<value>ERROR: Packet forbidden by Management Interface VLAN</value>
<comment>ND_PrepPackVLANErr = ERROR: Packet forbidden by Management Interface VLAN</comment>
</data>
</root>

View File

@ -57,6 +57,7 @@
this.dgv_VLANNames.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgv_VLANNames.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgv_VLANNames.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dgv_VLANNames.Location = new System.Drawing.Point(12, 12);
this.dgv_VLANNames.Name = "dgv_VLANNames";
this.dgv_VLANNames.RowTemplate.Height = 24;

View File

@ -159,7 +159,7 @@ namespace EduNetworkBuilder
{
NetworkCard NIC = TheDevice.NicFromName(oneNic);
if (NIC.GetNicType == NicType.lo) continue;
if (NIC.GetNicType == NicType.management_interface) continue;
//if (NIC.GetNicType == NicType.management_interface) continue; //so we can lock outselves out
if (NIC.GetNicType == NicType.wport) continue;
if (NIC.GetNicType == NicType.wlan) continue;
if (NIC.GetNicType == NicType.vpn) continue;
@ -401,7 +401,7 @@ namespace EduNetworkBuilder
{
NetworkCard NIC = TheDevice.NicFromName(oneNic);
if (NIC.GetNicType == NicType.lo) continue;
if (NIC.GetNicType == NicType.management_interface) continue;
//if (NIC.GetNicType == NicType.management_interface) continue;
for (int i = 0; i < NIC.IFCount; i++)
{
NetworkInterface nif = NIC.GetInterface(i);