I know we've been here before but now I actually have everything working pretty well I'd like to decide how I *should* be doing this, i.e. the most elegant way of doing it.
Our home network has a number of machines and devices on it:-
My desktop machine - xubuntu 8.10 The TV/Lounge machine - xubuntu 8.10 The garage backup machine - Ubuntu server (8.10 too I think) An HP7310 printer A Siemens DECT VOIP box My wife's Windows XP machine plus occasional 'visiting' machines and devices
These are all on the same 192.168.1.xxx subnet and a Draytek Vigor 2820n router connects them to the internet. There is a second backup ADSL connection provided by a BT "Business Hub" (2Wire) router on a different subnet. The Draytek Vigor shares its own ADSL and that of the BT router between users.
I want to be able to refer to machines on the network by name, e.g. they are called isbd, lounge, garage, hp7310 etc. The methods I know about are:-
Static IPs plus dnsmasq: Currently I do this by giving them fixed IP addresses which I put in the /etc/hosts file on my desktop machine (which runs all the time) and run dnsmasq in that machine to provide the other local machines with access to the names.
Static IPs I used to set up /etc/hosts in all machines (well, all the Linux machines) separately before I used dnsmasq but although very simple it gets annoying to do this when a something is added or removed. It also means that one has to set up DNS host addresses everywhere.
Dynamic IP This is where I get a bit lost. If I let everything go the the default then all IPs are assigned by DHCP. I.e. an ubuntu machine 'as installed' will ask for DHCP on the LAN, similarly the printer and the VOIP box will do so. The Draytek Vigor 2820n provides (as do nearly all routers) a DHCP service. If left like this though nothing wil have a name (as far as I know) and I will have no easy way to ssh to the garage machine for example. People keep telling me that this should be easy to resolve using (if I understand it correctly) the router but at the moment I don't really see how.
If I *could* get names for everything using dynamic IP (i.e. DHCP provided by the router) then it would make for a simpler life as, at present, I have to change the Ubuntu default networking to give machines static IP and I also have to do slightly more configuration on the printer etc.
There's a section in the router set-up called "Bind IP to MAC" which will allow the router to always give the same IP to each device/system but I don't see how I can get names in there.
Am I missing something obvious somewhere? I don't think I've seen the ability to attach names to MAC addresses in any of the routers I've used over the past few years (Zyxel, Speedtouch). The BT 2Wire router allows you to manually give names to the MAC addresses but I'm not sure that it will let you use them to refer to them.
On Thu, 22 Jan 2009 16:05:47 +0000 Chris G cl@isbd.net allegedly wrote:
Am I missing something obvious somewhere? I don't think I've seen the ability to attach names to MAC addresses in any of the routers I've used over the past few years (Zyxel, Speedtouch). The BT 2Wire router allows you to manually give names to the MAC addresses but I'm not sure that it will let you use them to refer to them.
DNSMasq will do all of that - read the manual - it is quite helpful.
Turn off DHCP on your router and use DNSMasq to issue dhcp leases. Map the MAC addresses to IP addresses in /etc/ethers. Map IP addresses to names in /etc/hosts on the DNSMasq server
Mick
---------------------------------------------------------------------
The text file for RFC 854 contains exactly 854 lines. Do you think there is any cosmic significance in this?
Douglas E Comer - Internetworking with TCP/IP Volume 1
http://www.ietf.org/rfc/rfc854.txt ---------------------------------------------------------------------
On Thu, Jan 22, 2009 at 09:08:53PM +0000, mbm wrote:
On Thu, 22 Jan 2009 16:05:47 +0000 Chris G cl@isbd.net allegedly wrote:
Am I missing something obvious somewhere? I don't think I've seen the ability to attach names to MAC addresses in any of the routers I've used over the past few years (Zyxel, Speedtouch). The BT 2Wire router allows you to manually give names to the MAC addresses but I'm not sure that it will let you use them to refer to them.
DNSMasq will do all of that - read the manual - it is quite helpful.
Turn off DHCP on your router and use DNSMasq to issue dhcp leases. Map the MAC addresses to IP addresses in /etc/ethers. Map IP addresses to names in /etc/hosts on the DNSMasq server
That's something I hadn't even thought of - excellent, it at least gets all the configuration into one place. Thank you!
On Thu, Jan 22, 2009 at 09:22:39PM +0000, Chris G wrote:
On Thu, Jan 22, 2009 at 09:08:53PM +0000, mbm wrote:
On Thu, 22 Jan 2009 16:05:47 +0000 Chris G cl@isbd.net allegedly wrote:
Am I missing something obvious somewhere? I don't think I've seen the ability to attach names to MAC addresses in any of the routers I've used over the past few years (Zyxel, Speedtouch). The BT 2Wire router allows you to manually give names to the MAC addresses but I'm not sure that it will let you use them to refer to them.
DNSMasq will do all of that - read the manual - it is quite helpful.
Turn off DHCP on your router and use DNSMasq to issue dhcp leases. Map the MAC addresses to IP addresses in /etc/ethers. Map IP addresses to names in /etc/hosts on the DNSMasq server
That's something I hadn't even thought of - excellent, it at least gets all the configuration into one place. Thank you!
It's actually even easier, dnsmasq gets the names of the DHCP clients when they ask for their IP addresses. Thus *removing* all reference to a remote system that gets its IP address by DHCP means that dnsmasq will know its name and IP address. So for all my 'computer' DHCP clients I'm now sorted.
However there is one minor issue remaining. For non-computer DHCP clients how do I know what they call themselves? I.e. when my HP 7310 printer starts up and gets its IP address using DHCP what is its name?
On Fri, 23 Jan 2009 14:50:39 +0000 Chris G cl@isbd.net allegedly wrote:
However there is one minor issue remaining. For non-computer DHCP clients how do I know what they call themselves? I.e. when my HP 7310 printer starts up and gets its IP address using DHCP what is its name?
Whatever you want to call it. I recommend "printer".
M
---------------------------------------------------------------------
The text file for RFC 854 contains exactly 854 lines. Do you think there is any cosmic significance in this?
Douglas E Comer - Internetworking with TCP/IP Volume 1
http://www.ietf.org/rfc/rfc854.txt ---------------------------------------------------------------------
On Fri, Jan 23, 2009 at 09:27:47PM +0000, mick wrote:
On Fri, 23 Jan 2009 14:50:39 +0000 Chris G cl@isbd.net allegedly wrote:
However there is one minor issue remaining. For non-computer DHCP clients how do I know what they call themselves? I.e. when my HP 7310 printer starts up and gets its IP address using DHCP what is its name?
Whatever you want to call it. I recommend "printer".
I've got two. :-)