Multihomed pc

Simon Hobson dhcp1 at thehobsons.co.uk
Sun Nov 12 12:33:27 UTC 2006


Please learn to trim your quoting, and stop top posting.

Crisfalusi Dan wrote:
>From the point of view of the dhcp server they are all on the eth1 interface
>...

That doesn't make it a shared network

>I putted the "shared network" because other ways the server sad to me I have
>an error ...

Then it might be constructive to pick up on those errors ! Was it by 
any chance something like "No subnet declaration for xxxxx." (where 
xxxxx is your servers local subnet) ?

>To give you the big picture I have a lot of networks that receive ip's
>through dhcp relay on the routers ... unfortunately many of them don't know
>how to set a circuit-id ...

The routers do not need to set circuit-id. For details of how DHCP 
works I recommend "The DHCP Handbook" by Ralph Droms and Ted Lemon, 
now in 2nd edition.

Taking a 'typical' network layout :

  DHCP
Server
192.168.0.1
    |
    |
    |
    +-- 192.168.0.2-Router-192.168.1.1/24 --- clients
    |
    +-- 192.168.0.3-Router-192.168.2.1/24 --- clients

Is this a fair approximation to your network ?

What happens is that when a client in the 192.168.1.0/24 subnet 
broadcasts a dhcp-discover or dhcp-request, the broadcast is picked 
up by the routers relay agent and forwarded to the server. The 
forwarded packet is unicast, not broadcast*, to 192.168.0.1. However, 
the packet is not just forwarded, it is modified first by the 
inclusion of the routers IP address ON THE CLIENTS SUBNET (ie 
192.168.1.1) in the Gateway Interface Address (GIAddr) field of the 
packet. ALL dhcp relays do this.

When the server receives this packet, it see the GIAddr filled in, 
and therefore knows that the packet has been forwarded from the 
192.168.1.0/24 subnet. It will select an appropriate address for the 
subnet (or if the client is requesting renewal of a specific address, 
verify that it is appropriate) and select all the relevant options 
that go with it.

The replay packet is then unicast back to the router at 192.168.1.1 
where the relay agent will pick it up and broadcast it out on the 
clients network.

All this happens without you doing anything but define the subnets 
CORRECTLY - you DO NOT have to do any work to make it happen.

When the client comes to renew an existing lease, it will unicast 
it's request directly to the server and will not use the relay agent 
at all.

* Being pedantic, you can relay requests to a broadcast address, but 
it's generally considered better to unicast.




The skeleton of a suitable dhcpd.conf for the above network is :

# Specify default options - we can override them in a subnet if required
option domain-name-servers 192.168.0.1 ;
option subnet-mask 255.255.255.0 ;
option domain-name              "electricabanat.ro";
option time-offset              -18000; # Eastern Standard Time
default-lease-time 72000; # 20 de ore
max-lease-time 72000; # 20 de ore
use-host-decl-names on;

# Servers subnet - MUST be defined, but in this case has no clients
subnet 192.168.0.0 subnet-mask 255.255.255.0 {
}

subnet 192.168.1.0 subnet-mask 255.255.255.0 {
   option routers 192.168.1.1 ;
   range 192.168.1.100 192.168.1.199 ;
}

subnet 192.168.2.0 subnet-mask 255.255.255.0 {
   option routers 192.168.2.1 ;
   # Example of overriding an option for this subnet only
   option domain-name-servers 192.168.2.17, 192.168.0.1 ;
   range 192.168.2.100 192.168.2.199 ;
}

# Now some hosts - note that these are NOT inside any subnet declaration
host pc1 {
   hardware ethernet aa:bb:cc:dd:ee:ff ;
   fixed-address 192.168.1.27, 192.168.2.57 ;
}
# Note that fixed addresses are NOT inside any range statement



More information about the dhcp-users mailing list