Fix IP address based on the Option 82 info
Luke.Orehawa at controltechniques.com
Luke.Orehawa at controltechniques.com
Wed Apr 12 09:12:02 UTC 2006
Hello,
I too am trying to provide a fixed IP address to a client based upon the
option 82 agent relay information. I have read the previous posts regarding
the patch, which seems a useful tool, but I would like to get it working
without the patch first. I have written a dhcpd.conf file which provides
options parameters based upon which port on the switch a client is located,
and I can get this part to work. The problem I am having is allocating the
IP address. In the conf file below I have tried allocating a range, this I
did just for testing, I would ideally like to allocate a fixed address.
#
# START OF DHCPD.CONF
#
option domain-name "ethernet.org";
option broadcast-address 192.168.1.255;
default-lease-time 100;
max-lease-time 200;
authoritative;
class "port1"{
match pick-first-value (concat(option agent.remote-id,option
agent.circuit-id));
option host-name "port1";
option root-path "192.168.1.200:/usr/ethernet/";
filename "port1.xml";
}
class "port2"{
match pick-first-value (concat(option agent.remote-id,option
agent.circuit-id));
option host-name "port2";
option root-path "192.168.1.200:/usr/ethernet/";
filename "port2.xml";
}
class "port3"{
match pick-first-value (concat(option agent.remote-id,option
agent.circuit-id));
option host-name "port3";
option root-path "192.168.1.200:/usr/ethernet/";
filename "port3.xml";
}
class "port4"{
match pick-first-value (concat(option agent.remote-id,option
agent.circuit-id));
option host-name "port4";
option root-path "192.168.1.200:/usr/ethernet/";
filename "port4.xml";
}
subclass "port1" xx:xx:xx:xx:xx:xx:xx:xx:b3:06:00:00:01:00:01:01;
subclass "port2" xx:xx:xx:xx:xx:xx:xx:xx:b3:06:00:00:01:00:01:02;
subclass "port3" xx:xx:xx:xx:xx:xx:xx:xx:b3:06:00:00:01:00:01:03;
subclass "port4" xx:xx:xx:xx:xx:xx:xx:xx:b3:06:00:00:01:00:01:04;
# Internal Subnet.
#
subnet 192.168.1.0 netmask 255.255.255.0 {
pool{
allow members of "port1";
range 192.168.1.69 192.168.1.73;
}
pool{
allow members of "port2";
range 192.168.1.74 192.168.1.78;
}
pool{
allow members of "port3";
range 192.168.1.79 192.168.1.83;
}
pool{
allow members of "port4";
range 192.168.1.84 192.168.1.88;
}
}
#
# END OF DHCPD.CONF
#
In testing with the above file I found the client was not obtaining a
lease, the Ethereal capture for the process is shown below:-
Ethereal Capture
No. Time Source Destination Protocol
Info
1 0.000000 0.0.0.0 255.255.255.255 DHCP
DHCP Discover - Transaction ID 0xb6b27336
2 0.013368 192.168.1.40 192.168.1.200 DHCP
DHCP Discover - Transaction ID 0xb6b27336
3 0.314180 192.168.1.200 192.168.1.40 DHCP
DHCP Offer - Transaction ID 0xb6b27336
4 0.325114 192.168.1.40 255.255.255.255 DHCP
DHCP Offer - Transaction ID 0xb6b27336
5 0.342137 0.0.0.0 255.255.255.255 DHCP
DHCP Request - Transaction ID 0xb6b27336
6 0.355299 192.168.1.40 192.168.1.200 DHCP
DHCP Request - Transaction ID 0xb6b27336
7 0.529781 192.168.1.200 255.255.255.255 DHCP
DHCP NAK - Transaction ID 0xb6b27336
8 0.715433 192.168.1.200 192.168.1.40 DHCP
DHCP ACK - Transaction ID 0xb6b27336
9 0.735796 192.168.1.40 255.255.255.255 DHCP
DHCP ACK - Transaction ID 0xb6b27336
10 1.556621 0.0.0.0 255.255.255.255 DHCP
DHCP Discover - Transaction ID 0x70a2c707
11 1.573633 192.168.1.40 192.168.1.200 DHCP
DHCP Discover - Transaction ID 0x70a2c707
12 1.894111 192.168.1.200 192.168.1.40 DHCP
DHCP Offer - Transaction ID 0x70a2c707
13 1.903817 192.168.1.40 255.255.255.255 DHCP
DHCP Offer - Transaction ID 0x70a2c707
14 1.918436 0.0.0.0 255.255.255.255 DHCP
DHCP Request - Transaction ID 0x70a2c707
15 1.937718 192.168.1.40 192.168.1.200 DHCP
DHCP Request - Transaction ID 0x70a2c707
16 2.026213 192.168.1.200 255.255.255.255 DHCP
DHCP NAK - Transaction ID 0x70a2c707
17 2.148132 192.168.1.200 192.168.1.40 DHCP
DHCP ACK - Transaction ID 0x70a2c707
18 2.156951 192.168.1.40 255.255.255.255 DHCP
DHCP ACK - Transaction ID 0x70a2c707
The server offers a valid IP depending upon the port location, the client
then requests that IP, then the server refuses the lease. The dhcp server is
running on ubuntu on VMWare, which is running on Windows XP Pro. The machine
has a separate ethernet card for the VM.
Any help regarding my problems would be most appreciated.
Regards,
Luke Orehawa
Development Engineer
More information about the dhcp-users
mailing list