DHCP Configuration Question
-
Quick and simple (I hope) question on DHCP for FOG. I’m trying to set up a dedicated imaging network with a switch, imaging server, and clients. There is no existing DHCP (or anything else) attached to the imaging network. I’d like to use FOG as the DHCP server (which I did last year very easily) and I’m having trouble getting it to answer DHCP discover requests.
I’m not sure why it’s not working, so I thought I’d ask here and see if I’ve missed something simple.
Info: I’m using the most recent trunk version of FOG, Ubuntu 15 VM, static IP on FOG server, bridged connection to switch and physical client machine.
When I PXE boot the client, it searches for DHCP and nobody answers (confirmed in Wireshark). When I installed FOG, I told it to act as DHCP so I expected it to be fine. I’m not sure what to check next. It’s just not answering. If someone with more experience can help me I’d appreciate it!
Thanks!
-
@arduinoAndMore Check your cables first.
Check iptables second.iptables -v -L
also, can you connect a laptop or something to the network and see if you get DHCP via the laptop’s OS?
-
@Wayne-Workman Thanks for your quick response. I tested those things you recommended and here’s what I found.
Iptables comes back with 0 packets 0 bytes on INPUT, FORWARD, and OUTPUT.
Cables are fine/tested.
Windows laptop isn’t receiving an IP.
-
@arduinoAndMore Check the status of dhcp.
service dhcpd status
Also, your dhcp configuration file can be found here:
/etc/dhcp/dhcpd.conf
If it’s failing due to errors in the config, we can get them sorted out very quickly if you post the config here, along with the output of
ip addr show
-
@Wayne-Workman Ah…it’s saying “unrecognized service” I’m not sure why the service wouldn’t be installed/running. Installation of FOG went smoothly and I had the DHCP selected. That’s curious
-
@arduinoAndMore try to install it.
sudo apt-get install dhcp
-
@Wayne-Workman It’s saying “no installation candidate” I tried installing and configuring dhcp3 before, but this didn’t seem to work either. That’s when I decided to try a re-installation of FOG (which also didn’t do it). I do have an up-to-date installation of isc-dhcp-server according to apt. Apparently it’s not running or something. If I try to run
sudo service isc-dhcp-server start
It says “Job failed to start.” I’m going to go check my config. -
Upon restoring the config to the original file, I’m now able to run
sudo service isc-dhcp-server restart
successfully. I’m still not able to boot that machine however. No IP was handed out.Here is my dhcpd.conf file. It’s pretty much the basic configuration as far as I can tell.
# # Sample configuration file for ISC dhcpd for Debian # # Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as # configuration file instead of this file. # # # The ddns-updates-style parameter controls whether or not the server will # attempt to do a DNS update when a lease is confirmed. We default to the # behavior of the version 2 packages ('none', since DHCP v2 didn't # have support for DDNS.) ddns-update-style none; # option definitions common to all supported networks... option domain-name "example.org"; option domain-name-servers ns1.example.org, ns2.example.org; default-lease-time 600; max-lease-time 7200; # If this DHCP server is the official DHCP server for the local # network, the authoritative directive should be uncommented. #authoritative; # Use this to send dhcp log messages to a different log file (you also # have to hack syslog.conf to complete the redirection). log-facility local7; # No service will be given on this subnet, but declaring it helps the # DHCP server to understand the network topology. option broadcast-address 192.168.3.255 subnet 192.168.2.0 netmask 255.255.254.0 { range 192.168.2.1 192.168.2.254 range 192.168.3.3 192.168.3.254 } # This is a very basic subnet declaration. #subnet 10.254.239.0 netmask 255.255.255.224 { # range 10.254.239.10 10.254.239.20; # option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; #} # This declaration allows BOOTP clients to get dynamic addresses, # which we don't really recommend. #subnet 10.254.239.32 netmask 255.255.255.224 { # range dynamic-bootp 10.254.239.40 10.254.239.60; # option broadcast-address 10.254.239.31; # option routers rtr-239-32-1.example.org; #} # A slightly different configuration for an internal subnet. #subnet 10.5.5.0 netmask 255.255.255.224 { # range 10.5.5.26 10.5.5.30; # option domain-name-servers ns1.internal.example.org; # option domain-name "internal.example.org"; # option routers 10.5.5.1; # option broadcast-address 10.5.5.31; # default-lease-time 600; # max-lease-time 7200; #} # Hosts which require special configuration options can be listed in # host statements. If no address is specified, the address will be # allocated dynamically (if possible), but the host-specific information # will still come from the host declaration. #host passacaglia { # hardware ethernet 0:0:c0:5d:bd:95; # filename "vmunix.passacaglia"; # server-name "toccata.fugue.com"; #} # Fixed IP addresses can also be specified for hosts. These addresses # should not also be listed as being available for dynamic assignment. # Hosts for which fixed IP addresses have been specified can boot using # BOOTP or DHCP. Hosts for which no fixed address is specified can only # be booted with DHCP, unless there is an address range on the subnet # to which a BOOTP client is connected which has the dynamic-bootp flag # set. #host fantasia { # hardware ethernet 08:00:07:26:c0:a5; # fixed-address fantasia.fugue.com; #} # You can declare a class of clients and then do address allocation # based on that. The example below shows a case where all clients # in a certain class get addresses on the 10.17.224/24 subnet, and all # other clients get addresses on the 10.0.29/24 subnet. #class "foo" { # match if substring (option vendor-class-identifier, 0, 4) = "SUNW"; #} #shared-network 224-29 { # subnet 10.17.224.0 netmask 255.255.255.0 { # option routers rtr-224.example.org; # } # subnet 10.0.29.0 netmask 255.255.255.0 { # option routers rtr-29.example.org; # } # pool { # allow members of "foo"; # range 10.17.224.10 10.17.224.250; # } # pool { # deny members of "foo"; # range 10.0.29.10 10.0.29.230; # } #}
-
@arduinoAndMore Ok… before we go further, we need to know your FOG version, and the output of
ip addr show
-
@Wayne-Workman I’m on build 7581 (downloaded today) my ip addr show output is below.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0c:29:38:d4:b1 brd ff:ff:ff:ff:ff:ff inet 192.168.3.1/23 brd 192.168.3.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe38:d4b1/64 scope link valid_lft forever preferred_lft forever
-
@arduinoAndMore try this config - I think I did it right.
Since this is an isolated network, i left out the router and dns options.
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 arch code 93 = unsigned integer 16; # RFC4578 use-host-decl-names on; ddns-update-style interim; ignore client-updates; next-server 192.168.3.1; authoritative; subnet 192.168.2.0 netmask 255.255.254.0 { option subnet-mask 255.255.254.0; range dynamic-bootp 192.168.2.1 192.168.3.254; default-lease-time 21600; max-lease-time 43200; class "UEFI-32-1" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00006"; filename "i386-efi/ipxe.efi"; } class "UEFI-32-2" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00002"; filename "i386-efi/ipxe.efi"; } class "UEFI-64-1" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00007"; filename "ipxe.efi"; } class "UEFI-64-2" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00008"; filename "ipxe.efi"; } class "UEFI-64-3" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00009"; filename "ipxe.efi"; } class "Legacy" { match if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00000"; filename "undionly.kkpxe"; } }
-
@Wayne-Workman That did the trick. It said something about “file not found” but I know it got its address. I’ll get all the files worked out later. Thank you for your help!!