Looking for simple way to assign IP for ad-hoc network

I have a group of embedded devices that work with both static IP and DHCP (as client). For one user case, the user will connect these devices to a switch, then to a PC running Windows 7 via ethernet directly, with no router or DHCP server in the network. To free the user off the task to assign static IPs manually, I think the easiest way is to enable DHCP server at the PC running Windows 7, thus alll device will be assigned to dynamic IP addres. Is it feasible to install/enable DHCP server on Windows 7 PC? What is the easiest way to install/enable DHCP server on Windows 7 PC? Can I enable/disable the DHCP server with an application software (by calling API inside etc.)?

If the DHCP server can be installed on Windows 7, can I install it on Windows XP or Windows Vista? I don't want to buy Windows server 2003 or 2008 for my PC since they are more expensive and less popular than Windows 7/Vista/XP.

BTW, I don't want to use discovery protocols such as zeroconf or its implementation since it typically requires more engineering effort and more vulnerable to IP issues.

Any thought could you please share?

Thank you in advance!

Reply to
Like2Learn
Loading thread data ...

Win7 doesn't have a DHCP server. Thats only part of Windows Server class OSes. Conceivably, you could write or use a 3rd party DHCP server. DHCP server is pretty basic, if you don't need much, it wouldn't take much code.

Do you know that IP has a link-local self-assigned IP address option? RFC3927 describes its algorithm.

formatting link

You don't need DHCP, or co-ordination at all then. Win7 supports RFC3927.

What's vulnerable to IP issues? Having an IP address?

Reply to
Doug McIntyre

A DHCP server must also route traffics to the assigned IPs. Otherwise, there is no point in assigning them.

They do not have routing/DHCP features.

All FREE Linux distributions come with FREE DHCP/NAT routing.

Reply to
linnix

I don't run W7 but I don't think any of the "non-server" Windows offerings support a *native* DHCP service. Of course, you can get or write one (or other equivalent functionality)

See above.

You haven't said what your device *does* (i.e., what sort of IP traffic it handles/responds to).

If you don't want to install *anything* on the Windows host (i.e., not even a network discovery tool), then you can either use a

0xA9FEXXXX address, *pick* a "default" address in the RFC1918 block and let your users override it later (if only one of your devices will be connected to the PC at any time, then you have no risk of conflict between *your* devices -- a bit of a chore if you pick an "unfortunate" address that something else happens to use :-/ ) *or* make your device look like an SMB share (with a name that is tied to it's MAC address -- which is visible on a label affixed to the device).

Options 1 and 3 take work on your part. Option 2 is the easy way out -- with the caveat that users have to be wary of any other nodes on their subnet.

Reply to
D Yuniskis

tftpd32

formatting link
contains a DHCP server. It can be run as a standalone executable or be installed as a service.

A word of caution: If you bring a DHCP server into someone else's network, the network administrator will NOT be happy.

--
RoRo
Reply to
Robert Roland

I think link-locl, or Automatic Private IP Addressing (APIPA), is the solution. Thank you for sharing!

Reply to
Like2Learn

Thank you. I knew linux distribution comes with DHCP, however,most of the users report they are using Windows CP/Vista/7.

Reply to
Like2Learn

I need to digest th info. Thanks.

Reply to
Like2Learn

I agree with the network administrator will NOT be happy, since it is not an easy task to deal with multiple DHCP servers. Any simple solution?

Reply to
Like2Learn

Run your DHCP server on a non-standard port; one which is unlikely to be in use on the network (many standard protocols have a specific port number reserved for both TCP and UDP but never use UDP).

Or use a separate ethernet interface for your devices and have the DHCP server bind to that interface.

Apart from the network admin not being happy, your devices may not be happy if they issue a DHCP request and get multiple, conflicting responses.

Reply to
Nobody

r

s.

There is no way to assure non-conflict with IP somewhere upstream. DHCP without NAT sub-net is just asking for troubles.

Reply to
linnix

You can't ensure you won't get conflicting IPs, but you can minimise the risk - all (I think) DHCP servers make some effort to check if an IP address is in use before assigning it. A DHCP server never assumes it has full control of the network - there may be conflicting static assignments, or perhaps the server was restarted while clients still have addresses.

The most common method AFAIK is to broadcast "arping" packets to the IP address the server wants to hand out - if it gets a reply, it will pick a different address from the pool. Older DHCP servers used normal "ping" packets, which are often stopped by badly configured firewalls (such as windows "firewalls"). This used to cause us hard-to-track problems on our network if the DHCP server was restarted for some reason. The fix, of course, was a newer and better DHCP server.

Reply to
David Brown

Do not enough money to buy a house? Don't worry, because this is achievable to receive the home loans to work out such problems. Thence get a college loan to buy all you need.

Reply to
Witt25Candy

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.