MAC to IP assignment not working - dhcprelay

Glenn Satchell Glenn.Satchell at uniq.com.au
Wed Apr 25 11:10:18 UTC 2007


>Date: Tue, 24 Apr 2007 12:34:51 -0400
>From: Edwin Whitelaw <Edwin.Whitelaw at nrvunwired.net>
>To: dhcp-users at isc.org
>Subject: MAC to IP assignment not working - dhcprelay
>
>I'm in the process of migrating some distributed DHCP servers from 
>standalone to a relay environment using a central DHCP host.
>
>I've successfully configured the central DHCP server to respond to the 
>relay request but the address issued is coming from the range settings 
>rather than the mapped assignment in an include file that matches the 
>MAC and issues specific IPs based thereon.  It works fine on the remote 
>box when in standalone mode but somehow isn't being used when included 
>on the central DHCP server.  the include file was copied directly from 
>the remote box.
>
>The central DHCP server restarts w/o errors or complaints as does the 
>remote unit when starting the relay process.
>
>Any ideas as to why the MAC--IP matching in the included file are not 
>controlling the IP assignment?
>
>Debian, dhcp3-server v3.0.4-13
>
>Thanks,
>
>Edwin
>
>----dhcpd.conf snippet----
>.
>.
>.
># Network for dhcprelay from Stanley
>subnet 172.17.20.0 netmask 255.255.255.0 {
>        range 172.17.20.201 172.17.20.250;
>        default-lease-time 3600;
>        max-lease-time 3600;
>        option routers  172.17.20.1;
>        option broadcast-address        172.17.20.255;
>        option subnet-mask    255.255.255.0;
>} # End of subnet 172.17.20.0
>
>subnet 172.16.20.0 netmask 255.255.255.0 { # Network devices
>        option routers  172.16.20.1;
>        default-lease-time 3600;
>        max-lease-time 3600;
>        option broadcast-address        172.16.20.255;
>        option subnet-mask    255.255.255.0;
>} # End of subnet 172.16.20.0
>
>        include "/etc/dhcp3/ap/stanley-ap.dhcp";        # 172.X.20
>.
>.
>.
>-----end dhcpd.conf snippet-----------
>
>-----stanley-ap.dhcp--------
>group stanley {
>        min-lease-time 604800 ; # 1 week
>        max-lease-time 604800 ; # 1 week
>        default-lease-time 604800 ; # 1 week
>
>        host west-cb3 {
>                hardware ethernet 00:02:6f:37:ba:7b;
>                fixed-address 172.16.20.11;
>        }
>
>        host west-linksys {
>                hardware ethernet 00:18:39:6b:7d:80;
>                fixed-address 172.17.20.11;
>        }
>
>        host obryan-cb3-15g {
>                hardware ethernet 00:02:6f:3a:af:53;
>                fixed-address 172.16.20.12;
>        }
>
>        host obryan-wrt54g {
>                hardware ethernet 00:11:95:25:9d:04;
>                fixed-address 172.17.20.12;
>        }
>
>        host kenley-cb3-16y {
>                hardware ethernet 00:02:6f:46:11:cd;
>                fixed-address 172.16.20.13;
>        }
>
>        host kenley-trendnet {
>                hardware ethernet 00:40:f4:e7:95:77;
>                fixed-address 172.17.20.13;
>        }
>
>} # End group
>---------end stanley-ap.dhcp----

Hi Edwin

You said the include file was copied directly from the standalone dhcp
server. Were the subnet definitions also copied exactly?

The dhcp server will ignore a fixed-address statement if that address
is not valid for the subnet where the request came from. So your hosts
with 172.17.20.x address will get an address from 172.16.20.20x if the
relay forwards a request stating that they are coming from 172.16.20.0
network.

Perhaps you need a shared-network statement around the two subnet
definitions if both are valid in the remote location?

You may also want to change the dynamic subnet defintion to explicitly
exclude the fixed hosts, eg:

subnet 172.17.20.0 netmask 255.255.255.0 {
	pool {
		deny known-clients;
        	range 172.17.20.201 172.17.20.250;
        }
        default-lease-time 3600;
        max-lease-time 3600;
        option routers  172.17.20.1;
        option broadcast-address        172.17.20.255;
        option subnet-mask    255.255.255.0;
} # End of subnet 172.17.20.0

regards,
-glenn


More information about the dhcp-users mailing list