On Tue, Jan 21, 2014 at 09:05:33AM -0800, John Jason Jordan wrote: > OK, I went into the D-Link with Firefox and found a place to reserve IP > addresses for various computers and devices. There is a convenient > drop-down where I can select the device (by name) and then reserve its > IP address. > > The only problem is that the router doesn't see any of the printers, > even though I turned them all on. Therefore, I can't see an easy way to > reserve addresses for them.
This is done with a linux router by fiddling with both DHCP configuration and NAMED configuration, and that is probably what is going on "under the hood" with your router. I'll describe the mechanism, then you figure out what that "helpful" router GUI is hiding from you, and how to interpret the connection. ------------------------------------------------------------------- NAMED and the name server: Somewhere on your network there should be a name server for the machines that have permanent IP addresses. This helps find machines and printers by name, which is helpful for printing, backups, file sharing, etc. This file names individual IP addresses; for example, your router might be 192.168.99.01 and called "gateway", and your server might be 192.168.99.12 and called "desky", and your printer might be 192.168.99.35 and called "desky". You can also use the NAMED name server to assign a range of addresses to a range of IP numbers, for example the names "a" through "z" can be assigned to the range 192.168.99.101 to 192.168.99.126 . Normally, the routing process only cares about IP addresses, not names, they are just there for your convenience. DHCPD and the IP address server: DHCP is a service for assigning an IP address to an ethernet device; it might run on your router, but it can run on any machine that is normally on. What it does is handle a DHCP request from an ethernet device and sends back a unique IP address, which that particular device will use as its IP address for a few minutes, hours, or days (the DHCP lease time). Some hardware can be programmed to know its IP address without DHCP - most computers and printers can be programmed "static" IP address. Which is dandy, except the DHCP server doesn't necessarily know about it, and can reassign that number to something else. All ethernet devices have a unique, assigned by the manufacturer, 48 bit MAC number, which identifies a particular instance of hardware, independently of the IP number(s) assigned to the device. The DHCP request includes that MAC number. The Linux DHCPD program, and hopefully what is buried in your router, has a user-constructed table that can assign a particular device NAME to a particular MAC address. When the device with that MAC address asks DHCP for an IP address, the DHCP server asks the NAMED server (on the same or other machine) for the IP address associated with the name, then sends that IP address out to the device with the MAC address. That sounds complicated, but this allows for hardware that cannot be programmed with a static IP address to have a name, and the names to be maintained from a single set of tables for the whole network. If your router doesn't have this, never fear, you can still run the name server on any always-connected Linux machine. And you can program the router to assign IP addresses out of a limited block of numbers (they often assign from 100 to 199), while the addresses you choose as fixed are assigned between 2 to 99 and 200 to 254. 0 and 255 are reserved for geeky stuff, and 1 is typically (but not always) the system acting as the gateway router. If you have more devices than that, you and use a 10.xxx.xxx.xxx IP adress range and assign millions of numbers, and no I am not helping you pay your power bill. Similar mechanisms apply for the 128 bit address space of IPV6; with that, you can assign IP addresses to every cell in every plant and animal on earth. And someone will probably figure out how to spam all of them. Sigh. And yes, this system is sounds complicated but it is about as simple as it can be to get all the jobs done (it is a lot simpler than the global postal service). There are some systems like Apple's Bonjour which attempt to simplify it further for people with all-Apple networks, but if you mix non-Apple hardware without programming it to interoperate ( possible, but more complication) things will go badly. BOTTOM LINE: Look at the IP address range used by your router for DHCP, and don't assign any static IP addresses to computers or printers within that range (the default is typically 100 to 199). Things will work better, though, if you understand what is going on. Keith -- Keith Lofstrom [email protected] _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
