On 30/04/14 20:54, Chris Green wrote:
How is one supposed to use a LAN with a mixed collection of 'things' on it such that you can actually connect to them without simply guessing their addresses?
I have just arrived on our boat in France where we have a TP-link WA5210 WiFi box connection to the local WiFi hotspot, on the 'local' side it uses 192.168.13.x. Then there's a standard domestic WiFi router whose WAN is 192.168.13.x hard-wired to the WA5210 that provides WiFi and wire ethernet within the boat.
On the boat there's the following:- My Acer Aspire netbook Seimens C475IP 'gigiaset' VOIP phones A Beaglebone Black computer nmiontoring various things An Android tablet (or two) Sometimes an HP printer
So it all works from the 'client' point of view in that I can use the iternet from my netbook, the phones work, my wife can read and send E-Mail from her tablet, etc.
However it's a total disaster if I want to connect from one system to another. How am I suppsed to find the address of, for example, the Beaglebone Black? Why do routers seem to have forgotten the ability to register names when DHCP clients come along? OK, with just four or five systems I can just try them all but it's a bit crude and painful. Once you get to ten or more it's hopeless.
It's why I run dnsmasq on a server on my LAN at home, all my systems (well, nearly all, one insists on being anonymous) have 'names', what an amazing concept!
Well....
A DHCP server (Dynamic Host Configuration Protocol) basically just doles out IP addresses and maintains a list of who asked for it when. This is tied up with MAC addresses.
A DNS (Domain Name System) server is the thing that works out what things are called within your LAN. If your devices are named, then it will associate names with IP addresses and allow you to connect by name rather than IP address.
(I think in a Windows system, WINS is used to work out naming as well, but we're not windows here are we...)
Your WIFI router will be running a DHCP server, but is almost certainly NOT running a DNS server for your LAN. This is why your devices aren't visible by name. [However, DNS will be working for things outside your network, so you can access BBC.CO.UK for instance]
How to arrange so that you know IP addresses or Names? Several ways.
Static IP addresses. Probably not a good idea as these would probably only work on your boat - Dynamic addressing is good for devices that move between networks or locations. But if you do go for static, you can edit your hosts file on devices. Include names and IP addresses of devices. Might not won't work for phones though, and probably no end of hassle to maintain - e.g. if you change an IP address for a device, you'll have to update all the hosts files.
Investigate if your router can run a DNS server. If it can, you may be sorted. If it can't you might be able to install a new BIOS (or operating system) to a version that does - either a new one from the manufacturer, or something like DDWRT (or similar). DDWRT can run dnsmasq.
If you can't get internal DNS on your router, you need to run a DNS server somewhere. For this you need a device that's on all the time. Presumably your Beaglebone Black is. Hopefully there's a version of dnsmasq for whichever OS it's running. Either 1) configure dnsmasq to work without issuing dhcp addresses, DNS only. or 2) Set up the router with a static IP address (it probably has one already) Turn off DHCP on the router Set the Beaglebone Black to have a static IP address Install dnsmasq to do dhcp and dns. Investigate the DNSMASQ config file. Look for the examples in the file that lets you fill in MAC addresses and specify an IP address. This is how I do it e.g.
#WIFI Router dhcp-host=00:11:22:33:44:01,MyRouterName,192.168.1.1
#Printer dhcp-host=00:11:22:33:44:02,MyPrinterName,192.168.1.2
#Beaglebone Black dhcp-host=00:11:22:33:44:03,Beaglebone,192.168.1.3
#Phones dhcp-host=00:11:22:33:44:04,Phone1Name,192.168.1.10 dhcp-host=00:11:22:33:44:05,Phone2Name,192.168.1.11
If you do this, then you should have names working correctly.
Also, you should be able to use this approach to name the anonymous device on your other network.
Hope that helps. Steve