Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

controlling DHCP



On 4/27/06, Laura Conrad <lconrad at laymusic.org> wrote:
 
> I have a router with a dhcp server on my home network.  When I set it
> up, I told it to allow the ip address leases to last forever, thinking
> that would mean that my desktop computer would always be 192.168.2.2,
> and my laptop and printer would also have fixed addresses.  Then I let
> some ports through the firewall for apache and mail and such,
> specifying the desktop IP address as what to forward them to.  I also
> have hosts files on the computers, which let me refer to the other
> machines by name instead of number.

In DHCP terms "a lease that lasts forever" is an allocation in which the
system that received the address allocation never needs to contact the
DHCP server asking that the address be re-allocated.  If a lease was
configured to last 24 hours, for example, the system that was allocated
an ip address under that lease would have to send a new DHCP request to
the DHCP server at the end of those 24 hours (the least time) and then
may or may not be allocated a that same address (or an address at all).


> Unfortunately, these leases seem to last only until the next power
> outage, which has been a fairly short time in this neighborhood
> lately.  To compound the confusion, this morning when the router came
> up, it gave the former desktop IP to the printer, so when a friend
> tried to check some files we were working on, he got the printer
> configuration.
> 
> Does anyone know how to tell a dhcp server to use specific addresses?

It depends upon your specific router.  Most DHCP software based servers
allow you to configure MAC Address to IP associations.  Some of the 
higher end routers will also allow you to do this.  If your router
allows this, you just need to configure the pairings.

If you're using a small linksys router, like the one that I use at home,
or something similar your router probably doesn't have that
functionality.  However, it likely does allow you to adjust the IP range
that the DHCP server uses (the range of address that it is allowed to
hand out).

You can go into your router's configuration and change the allocated 
range from the full 192.168.2/24 to a sub-network or a range with in the
192.168.2/24 network.  My linksys, like most DHCP solutions, allows the
use of a range for configuration.  If your router also allows this, you
can specify, for example, that only 192.168.2.100 -> 192.168.2.254 is
used for DHCP.  This will leave the range 192.168.2.2-192.168.2.99
un-used.  You can then configure your linux server, and other hardware 
as allowed, to use static network addresses in the unused range.  Since
the devices will request those IP's and nothing else will be using them,
they will never need to be changed unless you reconfigure your router to
route a different network.


> I'd ideally like something like:
> 
>     Desktop machine (debian)            192.168.2.2
>     Laptop running windows              192.168.2.3
>     Laptop running linux (ubuntu)       192.168.2.4
>     Printer                             192.168.2.5

As long as your printer allows you to configure it with a static
address, like an HP JetDirect Card based printer for example, you should
have no problem setting that up.  If you're able to set up everything
statically, you can disable your DHCP server and thereby increase your
security.

If you're not able to set up everything statically, setting up all the
other system statically, then configuring the DHCP server's address
range from 192.168.2.5-192.168.2.x should almost always give the .5
address to the printer if no other DHCP devices are actively connected
to the router. 


> At the moment, even when it can remember the addresses it had before,
> it gives them out by Mac address, so the laptop is one address when
> it's hooked up to an ethernet cable and a different one when it's
> running wireless, regardless of operating system.

You can configure the laptop to use the same address on wireless and 
ethernet.  However if you bring up both interfaces at the same time, you
will cause ip address collision errors.

Good luck, I've wanted to smash my home router many, many, times. =)


     - VAB

V. Alex Brennen		      vab at mit.edu
 http://www.mit.edu/people/vab/home.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.blu.org/pipermail/discuss/attachments/20060427/e42572de/attachment.sig>



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org