Les Mikesell wrote:
But what puzzles me is, what defines the correspondence between interface and network, eg in my case eth1 -> 192.168.2.0/24
Surely this should be there independently of dhcpd ?
Dhcpd shouldn't care about the name of the interface, but if the request hasn't been forwarded by a router/relay agent it needs to figure out the subnet of the interface where the request is received so it uses the corresponding range and options for the response.
I'm not sure what router/relay agent is supposed to forward the request.
In my case, I am trying to run dhcpd on my CentOS-6 server, but I get the message ------------------------------------ alfred dhcpd: No subnet declaration for eth1 (no IPv4 addresses). alfred dhcpd: ** Ignoring requests on eth1. If this is not what alfred dhcpd: you want, please write a subnet declaration alfred dhcpd: in your dhcpd.conf file for the network segment alfred dhcpd: to which interface eth1 is attached. ** alfred dhcpd: alfred dhcpd: alfred dhcpd: Not configured to listen on any interfaces! ------------------------------------
My /etc/dhcpd.conf reads (after removing comments and several hosts) ------------------------------------- option domain-name "gayleard.com"; option domain-name-servers 208.67.222.222, 208.67.220.220;
default-lease-time 600; max-lease-time 7200;
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 { }
subnet 192.168.2.0 netmask 255.255.255.0 {
authoritative;
option routers 192.168.2.1; option subnet-mask 255.255.255.0;
option domain-name "gayleard.com"; option domain-name-servers 208.67.222.222,208.67.220.220;
range 192.168.2.100 192.168.2.250; range dynamic-bootp 192.168.2.128 192.168.2.254;
host alfred { hardware 00:1B:21:AB:C9:4C; fixed-address 192.168.2.2; }
host blanche { hardware ethernet 00:1B:77:04:00:12; fixed-address 192.168.2.7; }
host blanche-ether { hardware ethernet 00:36:6B:35:26:8E; fixed-address 192.168.2.27; }
host linksys { hardware ethernet 00:16:B6:DA:56:B3; fixed-address 192.168.2.1; }
# several hosts omitted
} -------------------------------------
In /etc/sysconfig/network-scripts/ I have ifcfg-eth0 ------------------------------------- # Broadcom Corporation NetXtreme BCM5723 Gigabit Ethernet PCIe DEVICE=eth0 HWADDR=3C:4A:92:77:B3:AE IPADDR=192.168.1.2 GATEWAY=192.168.1.254 NETMASK=255.255.255.0 NM_CONTROLLED=no ONBOOT=yes BOOTPROTO=none USERCTL=no ------------------------------------- ifcfg-eth1 ------------------------------------- # Intel Corporation 82574L Gigabit Network Connection DEVICE=eth1 TYPE=Ethernet HWADDR=00:1B:21:AB:C9:4C IPADDR=192.168.2.2 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 NM_CONTROLLED=yes ONBOOT=yes BOOTPROTO=dhcp IPV6INIT=no USERCTL=yes -------------------------------------
eth0 is connected to a Billion modem/router and thence to the ethernet; eth1 is connected to a Linksys WRT54GL router.
If anyone can point out the error of my ways I should be most grateful.