Hi Everybody,
I am a newbie in C# and .NET development and
here is my problem:
I writing an application for a set of machines that will all be on the same
LAN.
Upon booting a machine doesn’t have an IP and
must configure its network interface using a list of [IP, Submask] couples -
which means a machine can use any IP of the list, provided it is not already
used.
For now my idea is to use the WMI class “Win32_NetworkAdapterConfiguration” with the functions “EnableStatic”.
I take the first IP of the list, try to configure my network interface with it;
check if there is a IP address conflict on the network, if yes try the next IP
on the list…..etc.
The only problem is that I don’t know
about to receive the system message that indicates there is a IP Address
conflict.
Can someone help me with that?
Is there an easier way to check if an
IP is already used when you don’t have any IP yourself (no ping possible) ?
I hope my question is clear enough J
guillaume bourdaPosted Aug 5, 2008, 8:24 AM
guillaume bourdaPosted Jul 28, 2008, 7:43 AM
Hi,
I didn't precise that I cannot access any DHCP service on my LAN, so indeed, one of the purposes o my program is to provide a valid IP address to the machine, when it can only used a pre-defined set of IP addresses.
Normally when you configure statically your network interface with an IP that is already used on the LAN, you soon receive a system message
"IP Address Conflict".
I would like to know how to get that message in my C# application.