Same Host on two ip pool?

Simon Hobson dhcp1 at thehobsons.co.uk
Sun Oct 12 08:47:25 UTC 2008


Juan C. Crespo R. wrote:

>>Do you mean - you want a client to be able to get an address on any 
>>of several networks it can connect to ? Yes, it just works 
>>automagically as long as your network is set up right.
>>
>Could you send me an example of this one? Thanks :)

Still not clear what you need help with !

Dynamic or static ? Glenn has shown you how to define multiple fixed 
addresses for static addressing.

For dynamic clients, there really isn't any special config. For 
example, this would allow the DHCP server to support two different 
networks (obviously you'll need a few more options etc) :

subnet 192.168.1.0 netmask 255.255.255.0 {
   range 192.168.1.100 192.168.1.199 ;
}
subnet 192.168.2.0 netmask 255.255.255.0 {
   range 192.168.2.100 192.168.2.199 ;
}

The server will automatically take care of giving a client an address 
suitable for the network it is located on. How ? Well that depends on 
your network.

Simplest case is you have two network cards in your server, eg you 
type 'ifconfig' and see something like :

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:3E:35:F4:7D
           inet addr:192.168.1.1  Bcast:192.168.0.255  Mask:255.255.255.0
           ...
eth1      Link encap:Ethernet  HWaddr 00:16:3E:35:2D:3F
           inet addr:192.168.2.1  Bcast:192.168.0.255  Mask:255.255.255.0
           ...

The serevr knows which interface the request came in on, and 
therefore knows where the client is.


What if one of the networks isn't local ? Well then you need a DHCP 
Helper (aka BOOTP Helper, aka DHCP Relay Agent). This is often 
incorporated in a router, but can in fact be in ANY device on the 
remote network. It sits there listening for DHCP broadcasts from 
clients, and when it hears one, it modifies it slightly and sends it 
to the DHCP server - when the server replies, it does so to the relay 
agent which broadcasts it to it's local net for the client to pick up.

The modification the relay agent makes is to add a value for GI-Addr 
(Gateway Interface Address) which is the IP address of it's interface 
on the clients network. If it's present, the DHCP server uses this 
value to work out where the client is.


Hopefully you now know enough to either a) solve your problem, or b) 
express it in terms that allow us to work out what it is.


More information about the dhcp-users mailing list