Compare commits
25 Commits
master
...
Developmen
Author | SHA1 | Date | |
---|---|---|---|
fdc3877e4f | |||
93f0c6e4a3 | |||
5d06bfd8f3 | |||
a0790918fb | |||
c2f41ae5b9 | |||
f5cb1875d2 | |||
5e39a2896d | |||
4a72518ccc | |||
cecd14a901 | |||
073cba135e | |||
e27d960403 | |||
4014439162 | |||
c0b655386e | |||
199ecbcf06 | |||
966f4fe8a8 | |||
b1a13b95bc | |||
fded1f454a | |||
a72aec9f9a | |||
bed1a8a846 | |||
9bf9d58c48 | |||
2a17fba36c | |||
886e1d7911 | |||
06eb896558 | |||
ddebafeec9 | |||
2ae5781bea |
@ -357,7 +357,7 @@ namespace EduNetworkBuilder
|
||||
tnic = ndCLonedItem.AddNic(WhatToAdd[cbQuestions.SelectedIndex]);
|
||||
}
|
||||
}
|
||||
if(tnet != null)
|
||||
if(tnet != null && tnic != null)
|
||||
tnet.RegisterNICAdded(ndCLonedItem.hostname, tnic.NicName());
|
||||
}
|
||||
UpdateForm();
|
||||
|
@ -119,6 +119,7 @@
|
||||
<DependentUpon>ListBoxWindow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NB.cs" />
|
||||
<Compile Include="NBRenumberData.cs" />
|
||||
<Compile Include="NBSettings.cs" />
|
||||
<Compile Include="NetShape.cs" />
|
||||
<Compile Include="NetTest.cs" />
|
||||
|
@ -80,6 +80,11 @@ namespace EduNetworkBuilder
|
||||
}
|
||||
}
|
||||
|
||||
public void SetIP(UInt32 newIP)
|
||||
{
|
||||
_ip = newIP;
|
||||
}
|
||||
|
||||
public bool Equals(NB_IPAddress CompareWith)
|
||||
{
|
||||
if (_ip != CompareWith._ip) return false;
|
||||
@ -241,6 +246,10 @@ namespace EduNetworkBuilder
|
||||
get { return NetworkAddress + ~_mask; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the list of hosts in the subnet.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<UInt32> Hosts()
|
||||
{
|
||||
for (var host = NetworkAddress + 1; host < BroadcastAddress; host++)
|
||||
|
1
EduNetworkBuilder/IPAddressEntry.Designer.cs
generated
1
EduNetworkBuilder/IPAddressEntry.Designer.cs
generated
@ -103,6 +103,7 @@
|
||||
this.btnCancel.Text = "Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
this.btnCancel.CausesValidation = false;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
|
@ -17,10 +17,24 @@ namespace EduNetworkBuilder
|
||||
{
|
||||
NB_IPAddress WhatToEdit;
|
||||
NB_IPAddress DHCPInterface=null;
|
||||
bool WellDone = true;
|
||||
bool WellDone = false;
|
||||
NetworkDevice ParentDevice = null;
|
||||
Point StartLocation = new Point (50,50);
|
||||
|
||||
NB_IPAddress SavedIPAddress = null;
|
||||
ToolTip myTooltip = new ToolTip();
|
||||
|
||||
//variable to hold true if the for is closing
|
||||
private bool isFormClosing = false;
|
||||
// Contant for the close message
|
||||
private const int WM_CLOSE = 16;
|
||||
//override the WndProc msg to trap the WM_CLOSE message
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
if (m.Msg == WM_CLOSE)
|
||||
isFormClosing = true;
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
|
||||
public IPAddressEntry(NB_IPAddress toEdit, NetworkDevice ToEdit, Form ParentForm, bool JustPinging=false)
|
||||
{
|
||||
@ -34,6 +48,7 @@ namespace EduNetworkBuilder
|
||||
ParentDevice = ToEdit;
|
||||
Network myNet = NB.GetNetwork();
|
||||
NB_IPAddress lastIP = myNet.RetrieveLastIP();
|
||||
SavedIPAddress = new NB_IPAddress(toEdit);
|
||||
WhatToEdit = toEdit;
|
||||
string hostname = "";
|
||||
if (ToEdit != null)
|
||||
@ -148,6 +163,7 @@ namespace EduNetworkBuilder
|
||||
WhatToEdit.Reparse(tbIPAddress.Text, tbNetmask.Text, tbGateway.Text);
|
||||
Network myNet = NB.GetNetwork();
|
||||
myNet.StoreLastIP(WhatToEdit);
|
||||
WellDone = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
@ -182,13 +198,16 @@ namespace EduNetworkBuilder
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(SavedIPAddress != null)
|
||||
WhatToEdit.Reparse(SavedIPAddress.GetIPString, SavedIPAddress.GetMaskString, SavedIPAddress.GetGateway.ToIpString());
|
||||
UpdateFieldsFromAddress();
|
||||
WellDone = false;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void tbGateway_Validating(object sender, CancelEventArgs e)
|
||||
{
|
||||
if (isFormClosing) return;
|
||||
|
||||
Network mynet = NB.GetNetwork();
|
||||
if (ParentDevice != null)
|
||||
{
|
||||
@ -216,6 +235,8 @@ namespace EduNetworkBuilder
|
||||
|
||||
private void tbNetmask_Validating(object sender, CancelEventArgs e)
|
||||
{
|
||||
if (isFormClosing) return;
|
||||
|
||||
UInt32 taddress = tbNetmask.Text.ParseIp();
|
||||
tbNetmask.Text = taddress.ToIpString();
|
||||
if (DHCPInterface != null)
|
||||
@ -231,6 +252,8 @@ namespace EduNetworkBuilder
|
||||
|
||||
private void tbIPAddress_Validating(object sender, CancelEventArgs e)
|
||||
{
|
||||
if (isFormClosing) return;
|
||||
|
||||
UInt32 taddress;
|
||||
Network mynet = NB.GetNetwork();
|
||||
NB_IPAddress tIPAddress = null;
|
||||
@ -238,9 +261,11 @@ namespace EduNetworkBuilder
|
||||
{
|
||||
tIPAddress = mynet.DNSLookup(ParentDevice, tbIPAddress.Text);
|
||||
}
|
||||
if(tIPAddress != null)
|
||||
if (tIPAddress != null) //device name used, convert to IP address and netmask
|
||||
{
|
||||
taddress = tIPAddress.GetIP;
|
||||
if (DHCPInterface == null)
|
||||
tbNetmask.Text = tIPAddress.GetMaskString;
|
||||
}
|
||||
else
|
||||
taddress = tbIPAddress.Text.ParseIp();
|
||||
@ -258,5 +283,27 @@ namespace EduNetworkBuilder
|
||||
if (tLocation.X < 0 || tLocation.Y < 0) tLocation = new Point(50, 50);
|
||||
Location = tLocation;
|
||||
}
|
||||
|
||||
public void ShowAsSubnetGateway()
|
||||
{
|
||||
lblIP.Text = NB.Translate("IPE_Network");
|
||||
Text = NB.Translate("NB_Subnet");
|
||||
|
||||
myTooltip.AutoPopDelay = 5000;
|
||||
myTooltip.InitialDelay = 1000;
|
||||
myTooltip.ReshowDelay = 500;
|
||||
// Force the ToolTip text to be displayed whether or not the form is active.
|
||||
myTooltip.ShowAlways = true;
|
||||
|
||||
myTooltip.SetToolTip(tbIPAddress, NB.Translate("IPE_NetworkTooltip"));
|
||||
myTooltip.SetToolTip(tbGateway, NB.Translate("IPE_GatewayTooltip"));
|
||||
myTooltip.SetToolTip(tbNetmask, NB.Translate("IPE_NetmaskTooltip"));
|
||||
|
||||
myTooltip.SetToolTip(lblIP, NB.Translate("IPE_NetworkTooltip"));
|
||||
myTooltip.SetToolTip(lblGateway, NB.Translate("IPE_GatewayTooltip"));
|
||||
myTooltip.SetToolTip(lblNetmask, NB.Translate("IPE_NetmaskTooltip"));
|
||||
|
||||
ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -755,7 +755,10 @@ namespace EduNetworkBuilder
|
||||
{
|
||||
NB_IPAddress newip = new NB_IPAddress(NB.ZeroIPString, NB.ZeroIPString, NB.ZeroIPString);
|
||||
newip.Edit(myNetDevice, this, NB.Translate("LBW_AddRouteCreate"));
|
||||
myNetDevice.AddRoute(newip);
|
||||
if (!newip.Equals(new NB_IPAddress(NB.ZeroIPString, NB.ZeroIPString, NB.ZeroIPString)))
|
||||
{
|
||||
myNetDevice.AddRoute(newip);
|
||||
}
|
||||
UpdateForm();
|
||||
}
|
||||
|
||||
|
@ -379,6 +379,8 @@ namespace EduNetworkBuilder
|
||||
public static int NormalRotation = 5;
|
||||
public static int PacketDamageDistance = 25;
|
||||
|
||||
public static int InvalidVLAN = -999; //What we return when it is invalid
|
||||
|
||||
public static bool DebugActions = false;
|
||||
public static bool DebugTests = false;
|
||||
|
||||
@ -934,6 +936,46 @@ namespace EduNetworkBuilder
|
||||
return tbEvent.Text;
|
||||
}
|
||||
|
||||
public static string ComboBoxPromptBox(string title, string prompt, List<string> Options, string value)
|
||||
{
|
||||
Form QuestionForm = new Form();
|
||||
QuestionForm.Text = title;
|
||||
Label lbPrompt = new Label();
|
||||
lbPrompt.Text = prompt;
|
||||
lbPrompt.Location = new Point(1, 1);
|
||||
lbPrompt.Size = new Size(200, lbPrompt.Size.Height);
|
||||
|
||||
ComboBox Choice = new ComboBox();
|
||||
List<string> tlist = new List<string>();
|
||||
foreach (string tstring in Options)
|
||||
{
|
||||
Choice.Items.Add(tstring);
|
||||
}
|
||||
|
||||
if (value != "" && Choice.Items.Contains(value))
|
||||
{
|
||||
Choice.SelectedItem = value;
|
||||
}
|
||||
Choice.Location = new Point(1, lbPrompt.Location.Y + lbPrompt.Height + 5);
|
||||
|
||||
Button Done = new Button();
|
||||
Done.Click += (s, g) => { Button b = (Button)s; Form f = (Form)b.Parent; f.Close(); };
|
||||
Choice.DoubleClick += (s, g) => { Button b = (Button)s; Form f = (Form)b.Parent; Choice.SelectedIndex = -1; f.Close(); }; ;
|
||||
Done.Text = NB.Translate("_Done");
|
||||
Done.Location = new Point(1, Choice.Location.Y + Choice.Height + 5);
|
||||
QuestionForm.Controls.Clear();
|
||||
QuestionForm.Controls.Add(Choice);
|
||||
QuestionForm.Controls.Add(Done);
|
||||
QuestionForm.Controls.Add(lbPrompt);
|
||||
QuestionForm.AcceptButton = Done;
|
||||
QuestionForm.FormBorderStyle = FormBorderStyle.FixedDialog;
|
||||
QuestionForm.AutoSize = true;
|
||||
QuestionForm.Height = Done.Location.Y + Done.Height + 5; //This is too small for the form, it autosizes to "big enough"
|
||||
QuestionForm.Width = Choice.Location.X + Choice.Width + 5;
|
||||
QuestionForm.ShowDialog();
|
||||
if (Choice.SelectedIndex >= 0) return Choice.SelectedItem.ToString();
|
||||
return "";
|
||||
}
|
||||
|
||||
public static Dictionary<string, bool> CheckPromptBox(Dictionary<string, bool> Checks)
|
||||
{
|
||||
|
293
EduNetworkBuilder/NBRenumberData.cs
Normal file
293
EduNetworkBuilder/NBRenumberData.cs
Normal file
@ -0,0 +1,293 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EduNetworkBuilder
|
||||
{
|
||||
public class NBRenumberer
|
||||
{
|
||||
private bool renumbered = false;
|
||||
public List<NBRenumberData> ListOfItems = new List<NBRenumberData>();
|
||||
|
||||
public void Count(string what)
|
||||
{
|
||||
NBRenumberData entry = DataFromName(what);
|
||||
if(entry != null)
|
||||
{
|
||||
entry.ActiveCount++;
|
||||
return;
|
||||
}
|
||||
//If we get here, we have not found it yet.
|
||||
NBRenumberData One = new NBRenumberData(what, ListOfItems.Count);
|
||||
One.ActiveCount++;
|
||||
ListOfItems.Add(One);
|
||||
}
|
||||
public void SetAsGateway(string what)
|
||||
{
|
||||
NBRenumberData GW = DataFromName(what);
|
||||
if (GW == null) {
|
||||
GW = new NBRenumberData(what, ListOfItems.Count);
|
||||
ListOfItems.Add(GW);
|
||||
}
|
||||
GW.isTheGateway = true;
|
||||
GW.UpdateSortOrder();
|
||||
//We can only have one gateway. Make sure all the rest are set not to be the GW
|
||||
foreach(NBRenumberData one in ListOfItems)
|
||||
{
|
||||
if (one != GW) {
|
||||
one.isTheGateway = false;
|
||||
one.UpdateSortOrder();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public NBRenumberData DataFromName(string hostname)
|
||||
{
|
||||
foreach (NBRenumberData NBRD in ListOfItems)
|
||||
{
|
||||
if (NBRD.Hostname == hostname)
|
||||
{
|
||||
return NBRD;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool TryRenumbering(NB_IPAddress Network, NB_IPAddress Gateway)
|
||||
{
|
||||
renumbered = true;
|
||||
//Separate out the devices by type
|
||||
// Find the gateway too
|
||||
int biggestcount = 0;
|
||||
int spacing = 10;
|
||||
bool HasGateway = false;
|
||||
foreach (NBRenumberData NBRD in ListOfItems)
|
||||
{
|
||||
if (NBRD.ActiveCount > biggestcount) biggestcount = NBRD.ActiveCount;
|
||||
}
|
||||
//now, we can prune off everything that is not part of biggestcount.
|
||||
for(int i=ListOfItems.Count-1; i>=0; i--)
|
||||
{
|
||||
if (ListOfItems[i].ActiveCount != biggestcount)
|
||||
ListOfItems.RemoveAt(i);
|
||||
else
|
||||
{
|
||||
if (ListOfItems[i].isTheGateway) HasGateway = true;
|
||||
ListOfItems[i].SuggestedIP = "";
|
||||
}
|
||||
}
|
||||
if (!HasGateway)
|
||||
for (int i = ListOfItems.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (ListOfItems[i].Device.HasIPAddress(Gateway))
|
||||
SetAsGateway(ListOfItems[i].Hostname);
|
||||
}
|
||||
|
||||
int switches = 0;
|
||||
int servers = 0;
|
||||
int printers = 0;
|
||||
int wireless = 0;
|
||||
int clients = 0;
|
||||
foreach(NBRenumberData NBRD in ListOfItems)
|
||||
{
|
||||
switch(NBRD.TypeString())
|
||||
{
|
||||
case "client":
|
||||
clients++;
|
||||
break;
|
||||
|
||||
case "printer":
|
||||
printers++;
|
||||
break;
|
||||
|
||||
case "switch":
|
||||
switches++;
|
||||
break;
|
||||
|
||||
case "server":
|
||||
servers++;
|
||||
break;
|
||||
case "wireless":
|
||||
wireless++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//Decide on which way we want to do this.
|
||||
biggestcount = 0;
|
||||
if (servers > biggestcount) biggestcount = servers;
|
||||
if (switches > biggestcount) biggestcount = switches;
|
||||
if (printers > biggestcount) biggestcount = printers;
|
||||
if (wireless > biggestcount) biggestcount = wireless;
|
||||
if (clients > biggestcount) biggestcount = clients;
|
||||
|
||||
ListOfItems.Sort((p, q) => p.sortorder.CompareTo(q.sortorder));
|
||||
|
||||
//If it works to do 10 for each bunch, do that. Otherwise, see what the smallest bunch that works is.
|
||||
if (biggestcount < 10)
|
||||
{
|
||||
spacing = 10;
|
||||
}
|
||||
if (biggestcount > 10)
|
||||
spacing = 99; //Don't bother with anything fancy. Punt if it does not fit the first time
|
||||
//Fallback is to simply count up from the gateway.
|
||||
if (Network.NumberOfHosts < ListOfItems.Count)
|
||||
return false;
|
||||
if(spacing * 5 > Network.NumberOfHosts)
|
||||
{
|
||||
renumberlist(Network, 1, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
//We can do this in parts
|
||||
renumberlist(Network, 1, "Gateway");
|
||||
renumberlist(Network, 2, "server");
|
||||
renumberlist(Network, spacing * 1, "switch");
|
||||
renumberlist(Network, spacing * 2, "wireless");
|
||||
renumberlist(Network, spacing * 3, "printer");
|
||||
renumberlist(Network, spacing * 4, "client");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void renumberlist(NB_IPAddress Network, int Base, string filter)
|
||||
{
|
||||
int count = Base;
|
||||
for (int i = 0; i < ListOfItems.Count; i++)
|
||||
{
|
||||
if (ListOfItems[i].SuggestedIP != "") continue;
|
||||
if (filter == "" || ListOfItems[i].TypeString() == filter || filter == "Gateway" && ListOfItems[i].isTheGateway)
|
||||
{
|
||||
NB_IPAddress next = new NB_IPAddress(Network);
|
||||
next._ip += (UInt32)count;
|
||||
ListOfItems[i].SuggestedIP = next.GetIPString;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DoRenumbering(NB_IPAddress Network, NB_IPAddress Gateway, int vlanID)
|
||||
{
|
||||
if (!renumbered) TryRenumbering(Network, Gateway);
|
||||
|
||||
//loop through and set all the IPs and the gateway IP if not DHCPS
|
||||
for(int i = 0; i < ListOfItems.Count; i++)
|
||||
{
|
||||
ListOfItems[i].Device.RenumberIP(ListOfItems[i].SuggestedIP, Gateway, vlanID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class NBRenumberData
|
||||
{
|
||||
public string Hostname = "";
|
||||
public NetworkDevice Device {
|
||||
get {
|
||||
Network myNet = NB.GetNetwork();
|
||||
if (myNet == null) return null;
|
||||
return myNet.DeviceFromName(Hostname);
|
||||
}
|
||||
}
|
||||
public int ActiveCount=0;
|
||||
public string nicname;
|
||||
public string SuggestedIP;
|
||||
public int sortorder = 0;
|
||||
private int _index = 0;
|
||||
public NetworkComponentType mytype = NetworkComponentType.none;
|
||||
|
||||
public bool isTheGateway = false;
|
||||
|
||||
private bool _isRouter = false;
|
||||
/// <summary>
|
||||
/// Return true if the Device specified by hostname does routing.
|
||||
/// </summary>
|
||||
public bool IsRouter {
|
||||
get {
|
||||
if (_isRouter) return true;
|
||||
NetworkDevice ND = Device;
|
||||
if(ND.RoutesPackets())
|
||||
{
|
||||
_isRouter = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public NBRenumberData(string hostname, int index)
|
||||
{
|
||||
Hostname = hostname;
|
||||
NetworkDevice nd = Device;
|
||||
mytype = nd.myType;
|
||||
_index = index;
|
||||
UpdateSortOrder();
|
||||
}
|
||||
|
||||
public void UpdateSortOrder()
|
||||
{
|
||||
switch (TypeString())
|
||||
{
|
||||
case "client":
|
||||
sortorder=5000;
|
||||
break;
|
||||
|
||||
case "printer":
|
||||
sortorder = 4000;
|
||||
break;
|
||||
|
||||
case "switch":
|
||||
sortorder=2000;
|
||||
break;
|
||||
|
||||
case "server":
|
||||
sortorder=1000;
|
||||
break;
|
||||
case "wireless":
|
||||
sortorder=3000;
|
||||
break;
|
||||
}
|
||||
sortorder = sortorder + _index;
|
||||
if (isTheGateway) sortorder = 0;
|
||||
}
|
||||
|
||||
public string TypeString()
|
||||
{
|
||||
string what = "";
|
||||
switch (mytype)
|
||||
{
|
||||
case NetworkComponentType.cellphone:
|
||||
case NetworkComponentType.ip_phone:
|
||||
case NetworkComponentType.laptop:
|
||||
case NetworkComponentType.pc:
|
||||
case NetworkComponentType.tablet:
|
||||
what = "client";
|
||||
break;
|
||||
|
||||
case NetworkComponentType.printer:
|
||||
case NetworkComponentType.copier:
|
||||
what = "printer";
|
||||
break;
|
||||
|
||||
case NetworkComponentType.net_hub:
|
||||
case NetworkComponentType.net_switch:
|
||||
what = "switch";
|
||||
break;
|
||||
|
||||
case NetworkComponentType.firewall:
|
||||
case NetworkComponentType.router:
|
||||
case NetworkComponentType.server:
|
||||
what = "server";
|
||||
break;
|
||||
case NetworkComponentType.wap:
|
||||
case NetworkComponentType.wbridge:
|
||||
case NetworkComponentType.wrepeater:
|
||||
case NetworkComponentType.wrouter:
|
||||
what = "wireless";
|
||||
break;
|
||||
}
|
||||
return what;
|
||||
}
|
||||
}
|
||||
}
|
@ -919,6 +919,12 @@ namespace EduNetworkBuilder
|
||||
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("_Delete"));
|
||||
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Delete_Click;
|
||||
|
||||
if(!myNetwork.LoadedFromResource)
|
||||
{
|
||||
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_Renumber"));
|
||||
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkRenumber;
|
||||
}
|
||||
|
||||
//We can color-code multiple items
|
||||
if (myNetwork.VLANsEnabled)
|
||||
{
|
||||
@ -1129,6 +1135,150 @@ namespace EduNetworkBuilder
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Try to renumber a chunk of a network
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void pbNetworkRenumber(object sender, EventArgs e)
|
||||
{
|
||||
//come up with a plan
|
||||
// sort items by type
|
||||
// loop through the items
|
||||
// come up with the numbers we want to use
|
||||
// Decide which nics to change
|
||||
// On a router, find the nic that is connected to other items in the list
|
||||
// On other devices, find first nic that is connected that is not DHCP
|
||||
// track hostname, nicname, ip_address
|
||||
//print out a list of what we are going to do
|
||||
//Ask if we want to do it. Yes/No
|
||||
//do it
|
||||
if (ItemsSelected.Count > 0)
|
||||
{
|
||||
//This next entry should never happen.
|
||||
if (ItemsSelected.Count < 2)
|
||||
{
|
||||
MessageBox.Show("You need to have more items selected");
|
||||
return;
|
||||
}
|
||||
|
||||
int ChosenVlanID = 1;
|
||||
if(myNetwork != null && myNetwork.VLANsEnabled)
|
||||
{
|
||||
List<string> vnames = new List<string>();
|
||||
foreach(VLANName vn in myNetwork.VlanNames)
|
||||
{
|
||||
vnames.Add(vn.Name);
|
||||
}
|
||||
string ChosenVlanName = "";
|
||||
if (vnames.Count > 0) ChosenVlanName = vnames[0]; //Usually "Default"
|
||||
if (vnames.Count > 1)
|
||||
{
|
||||
//we need to prompt
|
||||
ChosenVlanName = NB.ComboBoxPromptBox(NB.Translate("NB_ChooseVLANRenumberTitle"), NB.Translate("NB_ChooseVLANRenumber"), vnames, vnames[0]);
|
||||
}
|
||||
ChosenVlanID = myNetwork.VLANIDFromName(ChosenVlanName);
|
||||
}
|
||||
|
||||
NB_IPAddress prompted = new NB_IPAddress("192.168.1.0","255.255.255.0","192.168.1.1");
|
||||
|
||||
IPAddressEntry IPE = new IPAddressEntry(prompted, null, this, false);
|
||||
|
||||
//Read in the settings we will use
|
||||
IPE.ShowAsSubnetGateway();
|
||||
|
||||
//pull out the gateway address
|
||||
NB_IPAddress gw = new NB_IPAddress(prompted.GetGateway.ToIpString(), prompted._mask.ToIpString(),IPAddressType.gw);
|
||||
|
||||
//pull out the network address
|
||||
NB_IPAddress network = new NB_IPAddress(prompted.NetworkAddress.ToIpString(), prompted._mask.ToIpString(), IPAddressType.gw);
|
||||
|
||||
//We need to find the gateway device. If no such device exists, find the most likely candidate
|
||||
string gateway_name = myNetwork.ReverseDNSLookup(ItemsSelected[0],gw);
|
||||
|
||||
NetworkDevice gwDevice = myNetwork.DeviceFromName(gateway_name);
|
||||
if(gwDevice == null)
|
||||
{
|
||||
//Make a list of possibilities
|
||||
//Prompt user to select one of them
|
||||
List<NetworkDevice> gwdevices = new List<NetworkDevice>();
|
||||
for (int i = ItemsSelected.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (ItemsSelected[i].RoutesPackets()) gwdevices.Add(ItemsSelected[i]);
|
||||
}
|
||||
if (gwdevices.Count == 1) gwDevice = gwdevices[0];
|
||||
else
|
||||
{
|
||||
//We need to prompt which device
|
||||
List<string> names = new List<string>();
|
||||
foreach(NetworkDevice one in gwdevices)
|
||||
{
|
||||
names.Add(one.hostname);
|
||||
}
|
||||
names.Sort();
|
||||
gateway_name = NB.ComboBoxPromptBox(NB.Translate("_Gateway"), NB.Translate("NB_ChooseGateway"), names, names[0]);
|
||||
gwDevice = myNetwork.DeviceFromName(gateway_name);
|
||||
}
|
||||
}
|
||||
if (gwDevice == null) return; //No gateway device selected
|
||||
|
||||
|
||||
NBRenumberer Renumberer = new NBRenumberer();
|
||||
|
||||
//If we get here, we have a gateway and a list of items to renumber.
|
||||
//Loop through all the items
|
||||
//Find find all connected items
|
||||
//loop through all connected items & count them (excluding them if they are not selected)
|
||||
//set the gateway.
|
||||
//count them and exclude items that are not within the threshhold.
|
||||
|
||||
foreach(NetworkDevice one in ItemsSelected)
|
||||
{
|
||||
List<NetworkDevice> alreadydone = new List<NetworkDevice>();
|
||||
List<NetworkDevice> connections = one.ConnectedTo();
|
||||
|
||||
for(int i=0; i< connections.Count; i++)
|
||||
{
|
||||
NetworkDevice connection = connections[i];
|
||||
//If we have not done it yet
|
||||
if (!ItemsSelected.Contains(connection))
|
||||
continue;
|
||||
if (myNetwork.VLANsEnabled && (ChosenVlanID != connection.PrimaryVLAN() && connection.myType != NetworkComponentType.net_switch))
|
||||
continue; //Skip the device if it is not on the primary vlan, and is not a switch (asuming switches are taggexd)
|
||||
if (!alreadydone.Contains(connection))
|
||||
{
|
||||
alreadydone.Add(connection);
|
||||
|
||||
if(!connection.RoutesPackets() || connection.myType == NetworkComponentType.wrouter)
|
||||
connections.AddRange(connection.ConnectedTo(true));
|
||||
Renumberer.Count(connection.hostname);
|
||||
}
|
||||
}
|
||||
}
|
||||
Renumberer.SetAsGateway(gwDevice.hostname);
|
||||
|
||||
Renumberer.TryRenumbering(network, gw);
|
||||
|
||||
if (Renumberer.ListOfItems.Count > network.NumberOfHosts)
|
||||
{
|
||||
//Not enough room in the subnet for the various items.
|
||||
MessageBox.Show("There are not enough IP addresses in the subnet you specified for the number of items we need to renumber.");
|
||||
return;
|
||||
}
|
||||
|
||||
//We should print off the things we are hoping to do.
|
||||
string message = "What we are trying to do:\n";
|
||||
foreach(NBRenumberData NBRD in Renumberer.ListOfItems)
|
||||
{
|
||||
message += NBRD.Hostname + " " + NBRD.TypeString() + " -> " + NBRD.SuggestedIP + "\n";
|
||||
}
|
||||
DialogResult answer = MessageBox.Show(message,"Renumber?",MessageBoxButtons.OKCancel);
|
||||
if (answer == DialogResult.OK)
|
||||
Renumberer.DoRenumbering(network, gw, ChosenVlanID);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void pbNetworkView_Hide_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ItemClickedOn != null)
|
||||
|
@ -35,7 +35,7 @@ namespace EduNetworkBuilder
|
||||
public bool IsBurned = false;
|
||||
public Color BackgroundColor = Color.Empty;
|
||||
protected Color MorphColor = Color.Empty;
|
||||
public List<FirewallRule> FirewallRules = new List<FirewallRule>();
|
||||
public List<FirewallRule> FirewallRules = new List<FirewallRule>();
|
||||
public bool PowerOff = false;
|
||||
private List<string> tracertmessages = new List<string>();
|
||||
public int BadSprayCount = 0;
|
||||
@ -49,7 +49,7 @@ namespace EduNetworkBuilder
|
||||
myType = what;
|
||||
|
||||
SetImageFromType(what);
|
||||
NetworkCard tnic = new NetworkCard(0,GetUniqueIdentifier,hostname,NicType.lo);
|
||||
NetworkCard tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.lo);
|
||||
NICs.Add(tnic);
|
||||
if (what == NetworkComponentType.net_switch || what == NetworkComponentType.net_hub)
|
||||
{
|
||||
@ -58,7 +58,7 @@ namespace EduNetworkBuilder
|
||||
tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.management_interface);
|
||||
NICs.Add(tnic);
|
||||
}
|
||||
for(int looper=1; looper < 8; looper++)
|
||||
for (int looper = 1; looper < 8; looper++)
|
||||
{
|
||||
tnic = new NetworkCard(looper, GetUniqueIdentifier, hostname, NicType.port);
|
||||
NICs.Add(tnic);
|
||||
@ -71,16 +71,16 @@ namespace EduNetworkBuilder
|
||||
tnic = new NetworkCard(0, GetUniqueIdentifier, hostname);
|
||||
NICs.Add(tnic);
|
||||
}
|
||||
if(what == NetworkComponentType.router)
|
||||
if (what == NetworkComponentType.router)
|
||||
{
|
||||
tnic = new NetworkCard(1, GetUniqueIdentifier, hostname);
|
||||
NICs.Add(tnic);
|
||||
}
|
||||
//**********Wireless***********
|
||||
//Add a wireless network card to laptops, wireless bridge and wireless repeater
|
||||
if (what == NetworkComponentType.laptop )
|
||||
if (what == NetworkComponentType.laptop)
|
||||
{
|
||||
tnic = new NetworkCard(NICs.Count(), GetUniqueIdentifier, hostname,NicType.wlan); //Add a wireless nic
|
||||
tnic = new NetworkCard(NICs.Count(), GetUniqueIdentifier, hostname, NicType.wlan); //Add a wireless nic
|
||||
tnic.UsesDHCP = true;
|
||||
NICs.Add(tnic);
|
||||
}
|
||||
@ -161,7 +161,7 @@ namespace EduNetworkBuilder
|
||||
NICs.Add(tnic);
|
||||
//Add one wan port
|
||||
tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.wan);
|
||||
NICs.Insert(1,tnic); //Make this first in the list
|
||||
NICs.Insert(1, tnic); //Make this first in the list
|
||||
}
|
||||
if (what == NetworkComponentType.cellphone || what == NetworkComponentType.tablet)
|
||||
{
|
||||
@ -179,9 +179,9 @@ namespace EduNetworkBuilder
|
||||
public int CountNics(NicType TheType)
|
||||
{
|
||||
int count = 0;
|
||||
foreach(NetworkCard nic in NICs)
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
if(nic.GetNicType == TheType)
|
||||
if (nic.GetNicType == TheType)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
@ -197,7 +197,7 @@ namespace EduNetworkBuilder
|
||||
string tname = TheType.ToString() + count.ToString();
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
if(nic.NicName() == tname)
|
||||
if (nic.NicName() == tname)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@ -276,7 +276,7 @@ namespace EduNetworkBuilder
|
||||
|
||||
private void setNicsCanUseDHCP(bool CanUse)
|
||||
{
|
||||
foreach(NetworkCard nic in NICs)
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
//if the device must use DHCP. we set it here.
|
||||
if (MustUseDHCP && nic.CanUseDHCP)
|
||||
@ -355,37 +355,37 @@ namespace EduNetworkBuilder
|
||||
NetworkLink nl;
|
||||
if (myNet != null)
|
||||
{
|
||||
foreach(NetworkCard nic in NICs)
|
||||
{
|
||||
if(nic.ConnectedLink != -1)
|
||||
{
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
if (nic.ConnectedLink != -1)
|
||||
{
|
||||
nl = myNet.GetLinkFromID(nic.ConnectedLink);
|
||||
if(nl != null)
|
||||
if (nl != null)
|
||||
{
|
||||
myNet.RemoveComponent(nl);
|
||||
nl.Destroy();
|
||||
}
|
||||
nic.ConnectedLink = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void EditGateway(Form ParentForm)
|
||||
{
|
||||
DefaultGW.Edit(this,ParentForm,NB.Translate("ND_EdtGteway"));
|
||||
DefaultGW.Edit(this, ParentForm, NB.Translate("ND_EdtGteway"));
|
||||
}
|
||||
|
||||
public NB_IPAddress GetGateway()
|
||||
{
|
||||
if(!HasNonDHCPConnected() && CanUseDHCP)
|
||||
if (!HasNonDHCPConnected() && CanUseDHCP)
|
||||
{
|
||||
foreach(NetworkCard nic in NICs)
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
if(nic.UsesDHCP)
|
||||
if (nic.UsesDHCP)
|
||||
{
|
||||
List<NB_IPAddress> tlist = nic.IPAddressList();
|
||||
if(tlist.Count > 0)
|
||||
if (tlist.Count > 0)
|
||||
{
|
||||
NB_IPAddress newIP = new NB_IPAddress(tlist[0].GetGateway.ToIpString());
|
||||
return newIP;
|
||||
@ -422,7 +422,7 @@ namespace EduNetworkBuilder
|
||||
XmlNodeType myNodetype = Individual.NodeType;
|
||||
if (myNodetype == XmlNodeType.Element)
|
||||
{
|
||||
switch(Individual.Name.ToLower())
|
||||
switch (Individual.Name.ToLower())
|
||||
{
|
||||
case "location":
|
||||
string[] pointstr = Individual.InnerText.Split(',');
|
||||
@ -450,13 +450,13 @@ namespace EduNetworkBuilder
|
||||
newNic = new NetworkCard(Individual);
|
||||
//if (myType == NetworkComponentType.wap && newNic.GetNicType == NicType.eth)
|
||||
//{
|
||||
// //This happened once upon a time. Waps did not have management interfaces.
|
||||
// //Make a management interface for the wap and move the IP from the eth to that.
|
||||
// //Then, change the nic to a port instead of an eth.
|
||||
// NetworkCard tNic = new NetworkCard(newNic);
|
||||
// tNic.ChangeType(NicType.management_interface);
|
||||
// NICs.Add(tNic);
|
||||
// newNic.ChangeType(NicType.port);
|
||||
// //This happened once upon a time. Waps did not have management interfaces.
|
||||
// //Make a management interface for the wap and move the IP from the eth to that.
|
||||
// //Then, change the nic to a port instead of an eth.
|
||||
// NetworkCard tNic = new NetworkCard(newNic);
|
||||
// tNic.ChangeType(NicType.management_interface);
|
||||
// NICs.Add(tNic);
|
||||
// newNic.ChangeType(NicType.port);
|
||||
//}
|
||||
NICs.Add(newNic);
|
||||
break;
|
||||
@ -474,7 +474,7 @@ namespace EduNetworkBuilder
|
||||
bool.TryParse(Individual.InnerText, out isDHCPServer);
|
||||
break;
|
||||
case "dhcprange":
|
||||
NB_IPAddress dhcpip = new NB_IPAddress(Individual);
|
||||
NB_IPAddress dhcpip = new NB_IPAddress(Individual);
|
||||
DHCPRanges.Add(dhcpip);
|
||||
break;
|
||||
case "hasadvfirewall":
|
||||
@ -510,13 +510,13 @@ namespace EduNetworkBuilder
|
||||
writer.WriteElementString("mytype", myType.ToString());
|
||||
writer.WriteElementString("isdns", isDNSServer.ToString());
|
||||
writer.WriteElementString("isdhcp", isDHCPServer.ToString());
|
||||
if(IsBurned)
|
||||
if (IsBurned)
|
||||
writer.WriteElementString("isburned", IsBurned.ToString());
|
||||
if (HasAdvFirewall)
|
||||
writer.WriteElementString("hasadvfirewall", HasAdvFirewall.ToString());
|
||||
if (MorphColor != Color.Empty)
|
||||
writer.WriteElementString("morphcolor", MorphColor.Name);
|
||||
if(PowerOff == true)
|
||||
if (PowerOff == true)
|
||||
writer.WriteElementString("poweroff", PowerOff.ToString());
|
||||
if (isInvisible == true)
|
||||
writer.WriteElementString("isinvisible", isInvisible.ToString());
|
||||
@ -586,12 +586,12 @@ namespace EduNetworkBuilder
|
||||
{
|
||||
if (nic.GetNicType == NicType.wport || nic.GetNicType == NicType.port)
|
||||
continue;
|
||||
foreach(string addr in nic.IPAddresses())
|
||||
foreach (string addr in nic.IPAddresses())
|
||||
{
|
||||
answer += System.Environment.NewLine + addr;
|
||||
}
|
||||
}
|
||||
if(BackgroundColor != Color.Empty)
|
||||
if (BackgroundColor != Color.Empty)
|
||||
{
|
||||
//There is something wrong with it?
|
||||
Network myNet = NB.GetNetwork();
|
||||
@ -607,18 +607,18 @@ namespace EduNetworkBuilder
|
||||
public List<string> ListOfConnectedHosts()
|
||||
{
|
||||
List<string> thelist = new List<string>();
|
||||
foreach(NetworkCard nic in NICs)
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
if(nic.ConnectedLink != -1)
|
||||
if (nic.ConnectedLink != -1)
|
||||
{
|
||||
Network myNet = NB.GetNetwork();
|
||||
NetworkLink Link = myNet.GetLinkFromID(nic.ConnectedLink);
|
||||
if(Link != null)
|
||||
if (Link != null)
|
||||
{
|
||||
NetworkDevice tmp = myNet.GetDeviceFromID(Link.Src);
|
||||
if (tmp == null) continue;
|
||||
if (tmp.hostname != hostname) thelist.Add(tmp.hostname);
|
||||
tmp = myNet.GetDeviceFromID(Link.Dst);
|
||||
tmp = myNet.GetDeviceFromID(Link.Dst);
|
||||
if (tmp.hostname != hostname) thelist.Add(tmp.hostname);
|
||||
}
|
||||
}
|
||||
@ -655,6 +655,196 @@ namespace EduNetworkBuilder
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the list of devices connected to this device
|
||||
/// </summary>
|
||||
/// <param name="skipwan">For routers, do not show things connected on the WAN</param>
|
||||
/// <returns>A list of devices</returns>
|
||||
public List<NetworkDevice> ConnectedTo(bool skipwan= false)
|
||||
{
|
||||
List<NetworkDevice> connected = new List<NetworkDevice>();
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
//We want to skip connections through the wan when searching a broadcast network
|
||||
if (!(myType == NetworkComponentType.wrouter && skipwan && nic.GetNicType == NicType.wan))
|
||||
{
|
||||
NetworkDevice nd = ConnectedTo(nic);
|
||||
if (nd != null) connected.Add(nd);
|
||||
}
|
||||
}
|
||||
return connected;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// return the device this nic is attached to
|
||||
/// </summary>
|
||||
/// <param name="NIC"></param>
|
||||
/// <returns></returns>
|
||||
public NetworkDevice ConnectedTo(NetworkCard NIC)
|
||||
{
|
||||
return NIC.ConnectedTo();
|
||||
}
|
||||
/// <summary>
|
||||
/// return the device this nic is attached to
|
||||
/// </summary>
|
||||
/// <param name="NIC">the network card ID</param>
|
||||
/// <returns></returns>
|
||||
public NetworkDevice ConnectedTo(HostNicID NIC)
|
||||
{
|
||||
NetworkCard nic = NicFromID(NIC);
|
||||
if (nic == null) return null;
|
||||
return nic.ConnectedTo();
|
||||
}
|
||||
/// <summary>
|
||||
/// return the device this nic is attached to
|
||||
/// </summary>
|
||||
/// <param name="nicname">The network card name</param>
|
||||
/// <returns></returns>
|
||||
public NetworkDevice ConnectedTo(string nicname)
|
||||
{
|
||||
NetworkCard nic = NicFromName(nicname);
|
||||
if (nic == null) return null;
|
||||
return nic.ConnectedTo();
|
||||
}
|
||||
|
||||
public int VLANFromNIF(NetworkInterface nif, int level = 0)
|
||||
{
|
||||
level++;
|
||||
if (DoesVLANs())
|
||||
{
|
||||
//This device itself does vlans
|
||||
int vlan = nif.GetUntaggedVLAN();
|
||||
if (vlan != NB.InvalidVLAN)
|
||||
{
|
||||
return vlan;
|
||||
}
|
||||
}
|
||||
if (nif == null) return NB.InvalidVLAN;
|
||||
NetworkCard nic = NicFromID(nif.AttachedToHostNic);
|
||||
if (nic == null) return NB.InvalidVLAN; //Nothing
|
||||
if (level > 5) return NB.InvalidVLAN;
|
||||
return VLANFromNIC(nic, level);
|
||||
}
|
||||
|
||||
public int VLANFromNIC(NetworkCard nic, int level=0)
|
||||
{
|
||||
level++;
|
||||
int vlan = NB.InvalidVLAN;
|
||||
if (DoesVLANs())
|
||||
{
|
||||
foreach (NetworkInterface nif in nic.interfaces)
|
||||
{
|
||||
int tvlan = NB.InvalidVLAN;
|
||||
if(DoesVLANs())
|
||||
tvlan = VLANFromNIF(nif, level);
|
||||
if (tvlan != NB.InvalidVLAN)
|
||||
{
|
||||
if (vlan != NB.InvalidVLAN && vlan != tvlan)
|
||||
return NB.InvalidVLAN; //We have multiple VLANs defined on this nic. Cannot determine it from the nic. Need to look using nif
|
||||
vlan = tvlan;
|
||||
}
|
||||
}
|
||||
return vlan;
|
||||
}
|
||||
//If the device does not do vlans, we need to trace the wire to the device.
|
||||
NetworkDevice FarEnd = ConnectedTo(nic);
|
||||
if (FarEnd == null) return NB.InvalidVLAN; //Nothing connected to this link
|
||||
|
||||
//if it is a switch or wrouter(does vlans), return vlan for the device
|
||||
if (FarEnd.myType == NetworkComponentType.net_switch || FarEnd.myType == NetworkComponentType.wrouter)
|
||||
return FarEnd.VLANFromSwitchPort(hostname);
|
||||
//if it is a hub, return invalid
|
||||
if (FarEnd.myType == NetworkComponentType.net_hub)
|
||||
return NB.InvalidVLAN;
|
||||
//if it is a wireless device, find the vlan the device is attached to.
|
||||
if (FarEnd.IsWirelessForwarder())
|
||||
{
|
||||
return FarEnd.PrimaryVLAN();
|
||||
}
|
||||
return NB.InvalidVLAN;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used by PrimaryVLAN
|
||||
/// </summary>
|
||||
/// <param name="tList"></param>
|
||||
/// <returns></returns>
|
||||
private int ProcessVLANlist(List<NetworkCard> tList)
|
||||
{
|
||||
int VLAN = NB.InvalidVLAN;
|
||||
int tvlan = NB.InvalidVLAN;
|
||||
foreach(NetworkCard nic in tList)
|
||||
{
|
||||
tvlan = VLANFromNIC(nic);
|
||||
if(VLAN != NB.InvalidVLAN && tvlan != VLAN)
|
||||
{
|
||||
//We have multiple VLANs defined on these nics. We do not know what is primary
|
||||
return NB.InvalidVLAN;
|
||||
}
|
||||
VLAN = tvlan;
|
||||
}
|
||||
return VLAN;
|
||||
}
|
||||
/// <summary>
|
||||
/// Return the primary vlan of the device.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int PrimaryVLAN()
|
||||
{
|
||||
int tVLAN;
|
||||
List<NetworkCard> Connections;
|
||||
|
||||
Connections = NICsFromTypeNic(NicType.management_interface);
|
||||
tVLAN = ProcessVLANlist(Connections);
|
||||
if (tVLAN != NB.InvalidVLAN) return tVLAN;
|
||||
|
||||
//Connections = NICsFromTypeNic(NicType.wan); //If the device has a wan vlan defined
|
||||
//tVLAN = ProcessVLANlist(Connections);
|
||||
//if (tVLAN != NB.InvalidVLAN) return tVLAN;
|
||||
|
||||
Connections = NICsFromTypeNic(NicType.eth);
|
||||
tVLAN = ProcessVLANlist(Connections);
|
||||
if (tVLAN != NB.InvalidVLAN) return tVLAN;
|
||||
|
||||
Connections = NICsFromTypeNic(NicType.wlan);
|
||||
tVLAN = ProcessVLANlist(Connections);
|
||||
if (tVLAN != NB.InvalidVLAN) return tVLAN;
|
||||
|
||||
return NB.InvalidVLAN;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On a switch, return the vlan that hostname is attached to. Returns invalid if not found on this switch
|
||||
/// </summary>
|
||||
/// <param name="hostname">the hostname of the device</param>
|
||||
/// <returns>nb.invalid if it is not attached to this switch, or if this is not a switch</returns>
|
||||
public int VLANFromSwitchPort(string hostname)
|
||||
{
|
||||
if (myType == NetworkComponentType.net_hub) return NB.InvalidVLAN; //Hubs do not know what vlan they are on
|
||||
if(myType == NetworkComponentType.net_switch || myType == NetworkComponentType.wrouter)
|
||||
{
|
||||
//We want to find the port the hostname is on.
|
||||
foreach(NetworkCard nic in NICs)
|
||||
{
|
||||
NetworkDevice FarEnd = ConnectedTo(nic); //Get the device at the far end
|
||||
if (FarEnd == null) continue;
|
||||
if(FarEnd.hostname == hostname)
|
||||
{
|
||||
//This is the port the host is on
|
||||
return VLANFromNIC(nic);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NB.InvalidVLAN;
|
||||
}
|
||||
|
||||
public int VLANFromIP(string ip)
|
||||
{
|
||||
NetworkInterface nif = InterfaceFromIP(ip);
|
||||
if (nif == null) return NB.InvalidVLAN; //Nothing
|
||||
return VLANFromNIF(nif);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check to see if the device has a link to the specified host
|
||||
/// </summary>
|
||||
@ -1164,6 +1354,73 @@ namespace EduNetworkBuilder
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public NetworkInterface InterfaceFromIP(string IP)
|
||||
{
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
foreach (NetworkInterface nif in nic.interfaces)
|
||||
{
|
||||
if (nif.myIP.GetIPString == IP)
|
||||
return nif;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool RenumberIP(string newip, NB_IPAddress gateway, int vlanID)
|
||||
{
|
||||
DefaultGW = new NB_IPAddress(gateway);
|
||||
//figure out which interface to change.
|
||||
|
||||
if (!RenumberIP(newip, gateway, NicType.management_interface, vlanID))
|
||||
if (!RenumberIP(newip, gateway, NicType.eth, vlanID))
|
||||
return RenumberIP(newip, gateway, NicType.wlan, vlanID);
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool RenumberIP(string newip, NB_IPAddress gateway, NicType what, int vlan)
|
||||
{
|
||||
List<NetworkCard> smalllist = NICsFromTypeNic(what);
|
||||
smalllist.Sort((p, q) => p._nic_name.CompareTo(q._nic_name));
|
||||
foreach (NetworkCard nic in smalllist)
|
||||
{
|
||||
//see if we can renumber this one
|
||||
//It cannot be dhcp, and must be connected.
|
||||
if((!nic.UsesDHCP && nic.isConnected(false)) || nic.GetNicType == NicType.management_interface)
|
||||
{
|
||||
//If we are doing vlans, the vlan should match the interface if eth
|
||||
//If we are doing vlans, the vlan should match if we are doing management interface
|
||||
//
|
||||
//right now, just do it.
|
||||
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;
|
||||
}
|
||||
|
||||
public NetworkCard NicFromIP(string IP)
|
||||
{
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
foreach(NetworkInterface nif in nic.interfaces)
|
||||
{
|
||||
if (nif.myIP.GetIPString == IP)
|
||||
return nic;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public NetworkCard NicFromID(HostNicID ID)
|
||||
{
|
||||
return NicFromID(ID.NicID);
|
||||
@ -1431,7 +1688,12 @@ namespace EduNetworkBuilder
|
||||
public bool HasBroadcastAddress(NB_IPAddress dest)
|
||||
{
|
||||
if (dest.BroadcastAddress == dest.GetIP) return true;
|
||||
foreach(NetworkCard nic in NICs)
|
||||
|
||||
//This "fixes" a strange fringe case of when we configure a subnet such that
|
||||
//a packet that is traversing the network suddenly is a broadcast packet on the
|
||||
//target network. Gotta have odd subnetting for this to happen
|
||||
if (NB.BroadcastIPString == dest.GetIPString) return true;
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
if (nic.HasBroadcastAddresses(dest))
|
||||
return true;
|
||||
@ -1544,6 +1806,24 @@ namespace EduNetworkBuilder
|
||||
RouteTable.AddRange(ndCopyFrom.RouteTable);
|
||||
DHCPRanges.Clear();
|
||||
DHCPRanges.AddRange(ndCopyFrom.DHCPRanges);
|
||||
//if the IP address has changed, also update the corresponding address in DHCP rules
|
||||
foreach (NB_IPAddress dhcpIP in DHCPRanges)
|
||||
{
|
||||
foreach (NetworkCard nic in NICs)
|
||||
{
|
||||
NetworkInterface matchingIF = nic.LocalInterface(dhcpIP, null);
|
||||
if (matchingIF != null && !matchingIF.myIP.Equals(dhcpIP.GetIP) && !matchingIF.myIP.Equals(0))
|
||||
{
|
||||
//only validate the entry if the new address doesn't conflict with the DHCP range.
|
||||
UInt32 nStartingDHCP = dhcpIP.GetMask;
|
||||
UInt32 nEndingDHCP = dhcpIP.GetGateway;
|
||||
if (matchingIF.myIP.GetIP < nStartingDHCP || matchingIF.myIP.GetIP > nEndingDHCP)
|
||||
{
|
||||
dhcpIP.SetIP(matchingIF.myIP.GetIP);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DHCPLeases.Clear();
|
||||
DHCPLeases.AddRange(ndCopyFrom.DHCPLeases);
|
||||
|
||||
@ -1823,7 +2103,7 @@ namespace EduNetworkBuilder
|
||||
//Change this. Need a new ProcessArrival
|
||||
if (tPacket.MyType != PacketType.dhcp_answer) //If it is a match, it should be handled elsewhere
|
||||
ProcessArrival(tPacket);
|
||||
if (ExactMatch && tPacket.isFinshed())
|
||||
if (ExactMatch && tPacket.isFinished())
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1870,7 +2150,7 @@ namespace EduNetworkBuilder
|
||||
|
||||
}
|
||||
|
||||
if (tPacket.isFinshed() && !BroadcastMatch) return;
|
||||
if (tPacket.isFinished() && !BroadcastMatch) return;
|
||||
|
||||
NetworkCard dNic = null;
|
||||
NetworkCard sNic = null;
|
||||
@ -2552,7 +2832,12 @@ namespace EduNetworkBuilder
|
||||
NetworkCard tCard = null;
|
||||
NB_IPAddress DestAddr;
|
||||
string DHCPGW = "";
|
||||
foreach( NB_IPAddress ip in RouteTable)
|
||||
|
||||
//Do not ping the zero string. Should not go anywhere
|
||||
if (dest != null && dest.GetIPString == NB.ZeroIPString)
|
||||
return new NB_IPAddress(NB.ZeroIPString);
|
||||
|
||||
foreach ( NB_IPAddress ip in RouteTable)
|
||||
{
|
||||
if (ip.IsLocal(dest))
|
||||
return new NB_IPAddress(ip.GetGateway.ToIpString());//We return the gateway
|
||||
@ -2785,6 +3070,19 @@ namespace EduNetworkBuilder
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<NetworkCard> NICsFromTypeNic(NicType What)
|
||||
{
|
||||
List<NetworkCard> tList = new List<NetworkCard>();
|
||||
foreach (NetworkCard nic in NB.Randomize(NICs).ToList())
|
||||
{
|
||||
if (nic.GetNicType == What)
|
||||
{
|
||||
tList.Add(nic);
|
||||
}
|
||||
}
|
||||
return tList;
|
||||
}
|
||||
|
||||
public NB_IPAddress BestIPForThis(NetworkDevice Source=null)
|
||||
{
|
||||
NB_IPAddress answer=null;
|
||||
@ -2912,14 +3210,16 @@ namespace EduNetworkBuilder
|
||||
}
|
||||
}
|
||||
|
||||
if (!ForwardsPackets())
|
||||
if (!ForwardsPackets() || HasIPAddress(tPacket.destIP))
|
||||
{
|
||||
//Traceroute bounce-back
|
||||
if(tPacket.MyType == PacketType.tracert_request)
|
||||
if (tPacket.MyType == PacketType.tracert_request)
|
||||
{
|
||||
if (ProcessTracertPacket(tPacket)) return; //the packet stops if it gets bounced.
|
||||
}
|
||||
|
||||
}
|
||||
if (!ForwardsPackets())
|
||||
{
|
||||
if (tPacket.MyType == PacketType.dhcp_request && !isDHCPServer)
|
||||
{
|
||||
tPacket.AddMessage(DebugLevel.debug, NB.LeftPad(hostname) + " " +string.Format(NB.Translate("ND_DoInFromLnkDeaf")));
|
||||
@ -2990,7 +3290,12 @@ namespace EduNetworkBuilder
|
||||
//Console.WriteLine(" Tracert bounce: " + tPacket.OrigTTL + " " + hostname + " " + tPacket.payloadData);
|
||||
|
||||
//Finish setting up the new packet - sending it back
|
||||
nPacket.sourceIP = new NB_IPAddress(NB.ZeroIPString);
|
||||
// respond from requested address, not outgoing address: important for routers.
|
||||
if (HasIPAddress(tPacket.destIP))
|
||||
nPacket.sourceIP = tPacket.destIP;
|
||||
else
|
||||
nPacket.sourceIP = new NB_IPAddress(NB.ZeroIPString);
|
||||
|
||||
nPacket.TsourceIP = new NB_IPAddress(NB.ZeroIPString);
|
||||
myNet.addPacket(nPacket);
|
||||
//Console.WriteLine(" Tracert bounce pkt:" + nPacket.OrigTTL + nPacket.payloadData);
|
||||
|
@ -123,6 +123,16 @@ namespace EduNetworkBuilder
|
||||
return VLANTagType.Forbidden; //if not defined, it is forbidden
|
||||
}
|
||||
|
||||
public int GetUntaggedVLAN()
|
||||
{
|
||||
foreach (VLANInfo vin in VLANs)
|
||||
{
|
||||
if (vin.Tag == VLANTagType.Untagged)
|
||||
return vin.ID;
|
||||
}
|
||||
return NB.InvalidVLAN;
|
||||
}
|
||||
|
||||
public int GetNonForbiddenVLANID()
|
||||
{
|
||||
foreach(VLANInfo vin in VLANs)
|
||||
@ -130,7 +140,7 @@ namespace EduNetworkBuilder
|
||||
if (vin.Tag != VLANTagType.Forbidden)
|
||||
return vin.ID;
|
||||
}
|
||||
return -999;
|
||||
return NB.InvalidVLAN;
|
||||
}
|
||||
|
||||
public void SetVLANTag(int id, VLANTagType Tag)
|
||||
|
@ -489,7 +489,7 @@ namespace EduNetworkBuilder
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool isFinshed()
|
||||
public bool isFinished()
|
||||
{
|
||||
if (_MyStatus == PacketStatus.finished_ok) return true;
|
||||
if (_MyStatus == PacketStatus.finished_failed) return true;
|
||||
|
@ -70,7 +70,7 @@
|
||||
<interface>
|
||||
<nicname>management_interface0</nicname>
|
||||
<myip>
|
||||
<ip>102.168.1.4</ip>
|
||||
<ip>192.168.1.4</ip>
|
||||
<mask>255.255.255.0</mask>
|
||||
<gateway>0.0.0.0</gateway>
|
||||
<type>ip</type>
|
||||
|
@ -2,8 +2,8 @@
|
||||
<EduNetworkBuilder>
|
||||
<!--This is a network file for EduNetworkBuilder.-->
|
||||
<Network>
|
||||
<en_message>The one router got replaced and needs the correct IP-Addresses given to it.</en_message>
|
||||
<fr_message>Le routeur a été remplacé et a besoin des adresses IP correctes qui lui ont été attribuées.</fr_message>
|
||||
<en_message>The one router got replaced and needs the correct IP-Addresses and routes given to it.</en_message>
|
||||
<fr_message>Le routeur a été remplacé et a besoin des adresses IP correctes qui lui ont été attribuées et des itinéraires.</fr_message>
|
||||
<en_title>Router Replacement</en_title>
|
||||
<height>1024</height>
|
||||
<width>1024</width>
|
||||
@ -1205,18 +1205,6 @@
|
||||
ID="1">Untagged</VLAN>
|
||||
</interface>
|
||||
</nic>
|
||||
<route>
|
||||
<ip>172.16.1.2</ip>
|
||||
<mask>255.255.255.252</mask>
|
||||
<gateway>172.16.1.9</gateway>
|
||||
<type>route</type>
|
||||
</route>
|
||||
<route>
|
||||
<ip>172.16.1.18</ip>
|
||||
<mask>255.255.255.252</mask>
|
||||
<gateway>172.16.1.14</gateway>
|
||||
<type>route</type>
|
||||
</route>
|
||||
</device>
|
||||
<device>
|
||||
<hostname>router4</hostname>
|
||||
|
@ -1478,6 +1478,11 @@ Someone is complaining that they cannot access the servers on the other side of
|
||||
<dhost>pc3</dhost>
|
||||
<thetest>SuccessfullyPings</thetest>
|
||||
</nettest>
|
||||
<nettest>
|
||||
<shost>laptop0</shost>
|
||||
<dhost>server0</dhost>
|
||||
<thetest>NeedsLocalIPTo</thetest>
|
||||
</nettest>
|
||||
<VLANName
|
||||
ID="1"
|
||||
Color="Blue">Default</VLANName>
|
||||
|
@ -1102,6 +1102,6 @@ Ce puzzle a un interrupteur que vous avez été bloqué. Réinitialisez-le (clic
|
||||
Color="Blue">Default</VLANName>
|
||||
<VLANName
|
||||
ID="2"
|
||||
Color="Blue">Sttaff</VLANName>
|
||||
Color="Blue">Staff</VLANName>
|
||||
</Network>
|
||||
</EduNetworkBuilder>
|
@ -3,7 +3,7 @@
|
||||
<!--This is a network file for EduNetworkBuilder.-->
|
||||
<Network>
|
||||
<en_message>Switch Ports can have three states:
|
||||
Unagged
|
||||
UnTagged
|
||||
Tagged
|
||||
Forbidden
|
||||
When you are connecting switch-to-switch, they should be "Tagged." This makes a "Trunk", or a backbone link that can pass any VLAN. This allows packets to go to all the switches, and let the switches determine what devices they can go to from there.
|
||||
@ -1124,6 +1124,6 @@ Pour compléter ce puzzle, vérifiez les deux commutateurs. L'un d'eux n'a pas l
|
||||
Color="Blue">Default</VLANName>
|
||||
<VLANName
|
||||
ID="2"
|
||||
Color="Blue">Sttaff</VLANName>
|
||||
Color="Blue">Staff</VLANName>
|
||||
</Network>
|
||||
</EduNetworkBuilder>
|
@ -2,7 +2,7 @@
|
||||
<EduNetworkBuilder>
|
||||
<!--This is a network file for EduNetworkBuilder.-->
|
||||
<Network>
|
||||
<en_message>A staff memner brought in a laptop and they have problems. As always, they want you to fix it.
|
||||
<en_message>A staff member brought in a laptop and they have problems. As always, they want you to fix it.
|
||||
Some vlan issues are a lot simpler than they originally look.</en_message>
|
||||
<fr_message>Un membre du personnel a apporté un ordinateur portable et ils ont des problèmes. Comme toujours, ils veulent que vous le répariez.
|
||||
Certains problèmes de vlan sont beaucoup plus simples qu'ils ne le paraissent à l'origine.</fr_message>
|
||||
|
@ -1204,6 +1204,6 @@
|
||||
Color="Blue">Default</VLANName>
|
||||
<VLANName
|
||||
ID="2"
|
||||
Color="Blue">Sttaff</VLANName>
|
||||
Color="Blue">Staff</VLANName>
|
||||
</Network>
|
||||
</EduNetworkBuilder>
|
@ -1214,6 +1214,6 @@ Pour que cela fonctionne, nous avons besoin de deux VLAN différents sur le seul
|
||||
Color="Blue">Default</VLANName>
|
||||
<VLANName
|
||||
ID="2"
|
||||
Color="Blue">Sttaff</VLANName>
|
||||
Color="Blue">Staff</VLANName>
|
||||
</Network>
|
||||
</EduNetworkBuilder>
|
@ -1121,6 +1121,6 @@ Faites un ping sur un certain nombre d'ordinateurs et faites des pings de diffus
|
||||
Color="Blue">Default</VLANName>
|
||||
<VLANName
|
||||
ID="2"
|
||||
Color="Blue">Sttaff</VLANName>
|
||||
Color="Blue">Staff</VLANName>
|
||||
</Network>
|
||||
</EduNetworkBuilder>
|
@ -42,6 +42,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>101</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -66,6 +68,8 @@
|
||||
<nictype>wan</nictype>
|
||||
<uniqueidentifier>104</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>wan0</nicname>
|
||||
<myip>
|
||||
@ -90,6 +94,8 @@
|
||||
<nictype>eth</nictype>
|
||||
<uniqueidentifier>102</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>eth0</nicname>
|
||||
<myip>
|
||||
@ -153,6 +159,8 @@
|
||||
<nictype>eth</nictype>
|
||||
<uniqueidentifier>103</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>eth1</nicname>
|
||||
<myip>
|
||||
@ -202,6 +210,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>106</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -226,6 +236,8 @@
|
||||
<nictype>management_interface</nictype>
|
||||
<uniqueidentifier>107</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>management_interface0</nicname>
|
||||
<myip>
|
||||
@ -250,6 +262,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>108</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port1</nicname>
|
||||
<myip>
|
||||
@ -276,6 +290,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>109</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port2</nicname>
|
||||
<myip>
|
||||
@ -302,6 +318,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>110</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port3</nicname>
|
||||
<myip>
|
||||
@ -328,6 +346,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>111</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port4</nicname>
|
||||
<myip>
|
||||
@ -354,6 +374,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>112</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port5</nicname>
|
||||
<myip>
|
||||
@ -380,6 +402,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>113</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port6</nicname>
|
||||
<myip>
|
||||
@ -410,6 +434,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>114</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port7</nicname>
|
||||
<myip>
|
||||
@ -455,6 +481,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>116</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -479,6 +507,8 @@
|
||||
<nictype>management_interface</nictype>
|
||||
<uniqueidentifier>117</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>management_interface0</nicname>
|
||||
<myip>
|
||||
@ -505,6 +535,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>118</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port1</nicname>
|
||||
<myip>
|
||||
@ -533,6 +565,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>119</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port2</nicname>
|
||||
<myip>
|
||||
@ -542,11 +576,11 @@
|
||||
<type>ip</type>
|
||||
</myip>
|
||||
<VLAN
|
||||
ID="1">Untagged</VLAN>
|
||||
ID="1">Forbidden</VLAN>
|
||||
<VLAN
|
||||
ID="2">Forbidden</VLAN>
|
||||
<VLAN
|
||||
ID="3">Forbidden</VLAN>
|
||||
ID="3">Untagged</VLAN>
|
||||
</interface>
|
||||
</nic>
|
||||
<nic>
|
||||
@ -561,6 +595,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>120</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port3</nicname>
|
||||
<myip>
|
||||
@ -589,6 +625,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>121</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port4</nicname>
|
||||
<myip>
|
||||
@ -617,6 +655,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>122</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port5</nicname>
|
||||
<myip>
|
||||
@ -645,6 +685,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>123</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port6</nicname>
|
||||
<myip>
|
||||
@ -675,6 +717,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>124</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port7</nicname>
|
||||
<myip>
|
||||
@ -720,6 +764,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>126</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -744,6 +790,8 @@
|
||||
<nictype>management_interface</nictype>
|
||||
<uniqueidentifier>127</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>management_interface0</nicname>
|
||||
<myip>
|
||||
@ -770,6 +818,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>128</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port1</nicname>
|
||||
<myip>
|
||||
@ -798,6 +848,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>129</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port2</nicname>
|
||||
<myip>
|
||||
@ -826,6 +878,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>130</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port3</nicname>
|
||||
<myip>
|
||||
@ -852,6 +906,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>131</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port4</nicname>
|
||||
<myip>
|
||||
@ -878,6 +934,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>132</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port5</nicname>
|
||||
<myip>
|
||||
@ -904,6 +962,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>133</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port6</nicname>
|
||||
<myip>
|
||||
@ -934,6 +994,8 @@
|
||||
<nictype>port</nictype>
|
||||
<uniqueidentifier>134</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>port7</nicname>
|
||||
<myip>
|
||||
@ -980,6 +1042,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>136</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -1004,6 +1068,8 @@
|
||||
<nictype>eth</nictype>
|
||||
<uniqueidentifier>137</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>eth0</nicname>
|
||||
<myip>
|
||||
@ -1044,6 +1110,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>139</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -1068,6 +1136,8 @@
|
||||
<nictype>eth</nictype>
|
||||
<uniqueidentifier>140</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>eth0</nicname>
|
||||
<myip>
|
||||
@ -1108,6 +1178,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>142</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -1132,6 +1204,8 @@
|
||||
<nictype>eth</nictype>
|
||||
<uniqueidentifier>143</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>eth0</nicname>
|
||||
<myip>
|
||||
@ -1172,6 +1246,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>145</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -1196,6 +1272,8 @@
|
||||
<nictype>eth</nictype>
|
||||
<uniqueidentifier>146</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>eth0</nicname>
|
||||
<myip>
|
||||
@ -1236,6 +1314,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>148</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -1260,6 +1340,8 @@
|
||||
<nictype>eth</nictype>
|
||||
<uniqueidentifier>149</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>eth0</nicname>
|
||||
<myip>
|
||||
@ -1300,6 +1382,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>151</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -1324,6 +1408,8 @@
|
||||
<nictype>eth</nictype>
|
||||
<uniqueidentifier>152</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>eth0</nicname>
|
||||
<myip>
|
||||
@ -1364,6 +1450,8 @@
|
||||
<nictype>lo</nictype>
|
||||
<uniqueidentifier>154</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>lo0</nicname>
|
||||
<myip>
|
||||
@ -1388,6 +1476,8 @@
|
||||
<nictype>eth</nictype>
|
||||
<uniqueidentifier>155</uniqueidentifier>
|
||||
<usesdhcp>False</usesdhcp>
|
||||
<encryptionkey />
|
||||
<ssid />
|
||||
<interface>
|
||||
<nicname>eth0</nicname>
|
||||
<myip>
|
||||
|
@ -2129,4 +2129,40 @@
|
||||
<value>Regression testing</value>
|
||||
<comment>LBW_Regression_Testing = Regression testing</comment>
|
||||
</data>
|
||||
<data name="IPE_GatewayTooltip" xml:space="preserve">
|
||||
<value>This is the gateway to use on this network. If a device exists with this IP, that device will be set up as the gateway.</value>
|
||||
<comment>IPE_GatewayTooltip = This is the gateway to use on this network. If a device exists with this IP, that device will be set up as the gateway.</comment>
|
||||
</data>
|
||||
<data name="IPE_NetmaskTooltip" xml:space="preserve">
|
||||
<value>This is the netmask we are using when renumbering the subnet.</value>
|
||||
<comment>IPE_NetmaskTooltip = This is the netmask we are using when renumbering the subnet.</comment>
|
||||
</data>
|
||||
<data name="IPE_Network" xml:space="preserve">
|
||||
<value>Network</value>
|
||||
<comment>IPE_Network = Network</comment>
|
||||
</data>
|
||||
<data name="IPE_NetworkTooltip" xml:space="preserve">
|
||||
<value>This is the network address to use. The gateway should be part of this network.</value>
|
||||
<comment>IPE_NetworkTooltip = This is the network address to use. The gateway should be part of this network.</comment>
|
||||
</data>
|
||||
<data name="NB_ChooseGateway" xml:space="preserve">
|
||||
<value>Choose a gateway device</value>
|
||||
<comment>NB_ChooseGateway = Choose a gateway device</comment>
|
||||
</data>
|
||||
<data name="NB_Renumber" xml:space="preserve">
|
||||
<value>Renumber IPs</value>
|
||||
<comment>NB_Renumber = Renumber IPs</comment>
|
||||
</data>
|
||||
<data name="NB_Subnet" xml:space="preserve">
|
||||
<value>New Subnet</value>
|
||||
<comment>NB_Subnet = New Subnet</comment>
|
||||
</data>
|
||||
<data name="NB_ChooseVLANRenumber" xml:space="preserve">
|
||||
<value>What VLAN to renumber?</value>
|
||||
<comment>NB_ChooseVLANRenumber = What VLAN to renumber?</comment>
|
||||
</data>
|
||||
<data name="NB_ChooseVLANRenumberTitle" xml:space="preserve">
|
||||
<value>VLAN to renumber</value>
|
||||
<comment>NB_ChooseVLANRenumberTitle = VLAN to renumber</comment>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user