Click to See Complete Forum and Search --> : DHCP for Diskless (PXE) Boot - Server not responding


JohnnyXmas
01-07-2009, 06:42 PM
Hello all,

I'm attempting to set up a server for performing diskless boots here. I'm using Gentoo 2008, and have followed the instructions here:

http://www.gentoo.org/doc/en/diskless-howto.xml

I've gotten to the end of the basic DHCP setup, and I can not get the server to issue addresses. I've confirmed dhcpd loads up OK, and is running in top.

Here's the contents of /etc/dhcp/dhcpd:

# Disable dynamic DNS
ddns-update-style none;

# Assume one default gateway for IP traffic will do
option routers 192.168.0.1;

# Provide DNS info to clients
#option domain-name-servers 192.168.0.1;
#option domain-name "mydomain.com";

# Specify the TFTP server to be used
next-server 192.168.0.1;

# Declare a vendor-specific option buffer for PXE clients:
# Code 1: Multicast IP address of boot file server
# Code 2: UDP port that client should monitor for MTFTP responses
# Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests
# Code 4: Number of seconds a client must listen for activity before trying
# to start a new MTFTP transfer
# Code 5: Number of seconds a client must listen before trying to restart
# a MTFTP transfer

option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option PXE.discovery-control code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr code 7 = ip-address;

# Declare the subnet where our diskless nodes will live
subnet 192.168.0.0 netmask 255.255.0.0 {

# Provide PXE clients with appropriate information
class "pxeclient" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
vendor-option-space PXE;

# At least one of the vendor-specific PXE options must be set in
# order for the client boot ROMs to realize that we are a PXE-compliant
# server. We set the MCAST IP address to 0.0.0.0 to tell the boot ROM
# that we can't provide multicast TFTP.

option PXE.mtftp-ip 0.0.0.0;

# This is the name of the file the boot ROMs should download.
filename "pxelinux.0";
}

# Provide Etherboot clients with appropriate information
class "etherboot" {
match if substring(option vendor-class-identifier, 0, 9) = "Etherboot";
filename "vmlinuz_arch";
}

# Add one host declaration for each diskless host
host slave21 {
hardware ethernet 00:02:A5:04:3B:66;
fixed-address 192.168.0.21;
}
}

Note I commented out the DNS stuff, as I don't need it for this situation.

Here's the output when running dhpd:

Internet Systems Consortium DHCP Server V3.1.1-Gentoo
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
WARNING: Host declarations are global. They are not limited to the scope you declared them in.
Wrote 0 class decls to leases file.
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
Listening on LPF/eth1/00:0b:db:bd:68:af/192.168/16
Sending on LPF/eth1/00:0b:db:bd:68:af/192.168/16

No subnet declaration for eth0 (10.10.11.51).
** Ignoring requests on eth0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0 is attached. **

Sending on Socket/fallback/fallback-net

I'm don't want to serve on eth0, so that's fine.

Here's the output from tcpdump -i eth1 >&1 :

listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
16:31:15.995270 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1c:25:94:7a:fd (oui Unknown), length 548
16:31:20.032269 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1c:25:94:7a:fd (oui Unknown), length 548
16:31:28.106245 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1c:25:94:7a:fd (oui Unknown), length 548
16:31:44.199306 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:1c:25:94:7a:fd (oui Unknown), length 548


etc, until it times out.


Physically, I've just got a laptop directly connected to eth1 via crossover cable, so there's nothing in between that could be causing problems.

ideas?

TIA.

Satanic Atheist
01-07-2009, 09:37 PM
DHCP is a strange beast. You MUST have a range address setting for each any every domain that you are connected to (even though you may not offer addresses on that particular subnet/network). DHCP won't even run if it detects an IP address on an interface that it doesn't cover.

Still, I notice from your readouts that you are offering IPs on 192.168.x.y but your computer finds itself with the IP of 10.10.11.51 - this is not right and is where your problem seems to lie. I have a fully working DHCP system here and I can provide pointers if you cannot sort it.

My advice would be to set up one (and only one) connection first and then attempt to run DHCP to check if it gets the right address.

James

JohnnyXmas
01-07-2009, 11:13 PM
Thanks for the quick reply!

This server ison a network that already has a master and slave DHCP server, and can in no way be allowed to interfere with them. It has to be connected to that LAN via eth0 (hence the weird 10.x.x.x addy), then it also has to be creating its own LAN of diskless clients on eth1, which IT assigns addresses to. The eth1 clients can in no way be able to see/interact with the eth0 LAN and vice-versa. I understand I can do that via a firewall, routing, etc, but I'm also switching over from Windows on this server (which handles this situation with no complaints), so all of the (many) managed Cisco switches on the LAN already have addresses in that 192 range, and I don't want to have to go change everything. I don't see why Windows would do this with no problems, but Linux won't even look at it. Is there a way to declare it but set a null range, or something?

I note that the output says that's its ignoring eth0, but seems to like eth1 just fine. Is that last line a clue:

Sending on Socket/fallback/fallback-net ?

Satanic Atheist
01-08-2009, 03:48 AM
Yes, you can set a null range easily. Simply put the following into /etc/dhcpd.conf:


subnet 10.0.0.0 netmask 255.0.0.0 {
}


This will validate the network but obviously you have not assigned an IP address range for it to give out addresses and therefore it will not assign anything.

James

JohnnyXmas
01-08-2009, 10:28 AM
Tried that idea, here's the output:

Internet Systems Consortium DHCP Server V3.1.1-Gentoo
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
WARNING: Host declarations are global. They are not limited to the scope you declared them in.
Wrote 0 class decls to leases file.
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
Listening on LPF/eth1/00:0b:db:bd:68:af/192.168/16
Sending on LPF/eth1/00:0b:db:bd:68:af/192.168/16
Listening on LPF/eth0/00:0e:0c:37:79:72/10/8
Sending on LPF/eth0/00:0e:0c:37:79:72/10/8
Sending on Socket/fallback/fallback-net


But I still get the exact same situation. I noticed that this walkthrough does not have me specify an address range. Could that be an accidenta omission. I'm going to try adding that, and if it doesn't work, eliminate eth0 altogether as you recommended

JohnnyXmas
01-08-2009, 10:49 AM
Left your "blank" declaration idea for eth0 and added in the range I wanted to use for the 192. subnet, and it worked great. I removed the blank declaration completely, and it went back to ignoring eth0, but still serving on eth1.

So, the problem was that I had no range declared.

Also, I found this while googling:

http://www.linuxhomenetworking.com/forums/showthread.php?t=524

Shows how to run DHCP for 2 different subnets that share an interface. Didn't apply to me specifically, but it sortof came up in conversation. Thanks for leading me in the right direction!

Satanic Atheist
01-09-2009, 05:44 AM
Not a problem. My DHCP configuration will absolutely refuse to run unless I have a declaration for each and every subnet that it can "see" as being locally attached. I haven't got the message handy at the moment but I know it leaves a quite concise error message detailing the exact problem.

James