I am trying to configure DHCP on a second NIC, eth1, on CentOS 6.2. (I already have my first NIC, eth0, connected to a DSL modem which gets its IP address and DNS server[s] from the ISP.)

I have followed the contents of Ch.03 Linux Networking and Ch.08 Configuring the DHCP server – but I’m not quite there yet, though I suspect I am pretty close. Although I have read the material many times now, and looked at many other related articles, there are still some points that I’m not absolutely clear on. Some of the key settings include
Code:
/etc/sysconfig/network-scripts/ifcfg-eth1:
NM_CONTROLLED=no BOOTPROTO=none ONBOOT=yes # probably could be ‘no’ until I’ve got it working
I assume that I have to manually assign an IP address for eth1 – what I have read doesn’t make it absolutely clear to me whether this is the right thing to do, but lets go with it for now
Code:
ifconfig eth1 192.168.37.1 netmask 255.255.255.0 up
(Obviously I can add IPADDR=192.168.37.1 and NETMASK=255.255.255.0 into ifcfg-eth1 later but, again, lets go with this for now.)

When I say ‘service dhcpd start’ it fails and puts this message into /var/log/messages
Code:
dhcpd: No subnet declaration for eth1 (192.168.37.1)
Which would seem to be clear enough, yet I do have the following in /etc/dhcpd.conf
Code:
subnet 192.168.37.0 netmask 255.255.255.0 {
                range 192.168.37.8 192.168.37.127;
                option routers 192.168.37.1; # I put this here because it is the address of eth1
                option ip-forwarding off;
                option broadcast-address 192.168.37.255;
                option domain-name-servers 62.24.134.1; # taken from /etc/resolv.conf
}
Which I’m very happy to concede is probably wrong – I just don’t know what I am looking for. (For the record the file /var/lib/dhcpd/dhcpd.leases does exist.) I also have
Code:
/etc/sysconfig/network-scripts/route-eth1:
255.255.255.255/32 dev eth1
/etc/sysconfig/dhcpd:
DHCPDARGS=eth1
I’m reasonably convinced that the discussion of default gateways is going to be pretty important (though probably later on – I don't think it is the reason that dhcpd is failing to start now) but I am also quite baffled by it. Although it says that the server needs a single gateway it feels to me like I should interpret that to mean a single default gateway per NIC. In the section “How to Change Your Default Gateway” it says
DHCP servers will automatically assign a default gateway to DHCP configured NICs, but NICs with configured static IP addresses will need to have a manually configured default gateway.
eth0 is configured by DHCP so it is automatically assigned a default gateway. eth1 has a static IP address so I must manually configure its default gateway – but as what?

Questions

  1. Can anyone spot where I have gone wrong so far?
  2. Do we agree that I just leave ppp0/eth0 alone and let it sort itself out?
  3. How should I configure a default gateway for eth1?