Question

I am programming an embedded device (at91sam7x, using FreeRTOS and lwIP), which has LAN. When it appears on the router's device list, it has no name. How can I provide one? What protocol do routers use for it?

Était-ce utile?

La solution

DHCP can provide the name of the requesting computer to the server which can then record that against the IP address it gives out. Many (most?) self-contained router/WiFi boxes will do this and, if not, DD-WRT or OpenWRT will.

Note that the requesting computer must send its hostname in the DHCP request, an optional thing, for this to work. I don't know if FreeRTOS does this but even it's not an option you could certainly update it to do so.

Some DHCP systems (like the Linux DHCP server) also have the ability to communicate with a DNS server that supports dynamic updates (like Linux "bind") to push the host->ip mapping table to it and thus make the mapping available any device using that DNS server for lookups.

Autres conseils

DNS :)

The hostname of this device should be registered on your DNS server. Which may be your router, otherwise I assume you don't have one yet.

In this case you could for instance set up a Bind server in your network. Each other device must then use this server as primary DNS server. The more comfortable solution would be to (also) setup a DHCP server then telling its clients the DNS server's IP. In fact your router might have a DHCP integrated and allow you to specify a custom DNS server.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top