Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
dhcpd fails to start
Results 1 to 3 of 3

Thread: dhcpd fails to start

  1. #1

    dhcpd fails to start

    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?

  2. #2
    Newbie
    Join Date
    May 2012
    Location
    India
    Posts
    1
    hello,
    you can try a couple of things here....

    1.

    /etc/sysconfig/network-scripts/ifcfg-eth1:
    BOOTPROTO=DHCP
    GATEWAY=ipaddress of dhcp server
    2.
    do not put ipaddress and netmask in ifcfg file

    3.
    in your dhcp server where you have specified the option dns try to put the ip of the dhcp server itself..

    ============

    hope this works..

    regards,
    Tapas

  3. #3
    Thanks for the reply Tapas. I wasn't ignoring you - just been completely run off my feet this week working on a new project, so haven't had time to try out your suggestion until now.

    I tried your first suggestion - here are the complete contents of the file now
    Code:
    /etc/sysconfig/network-scripts/ifcfg-eth1:
    DEVICE=eth1 BOOTPROTO=dhcp HWADDR=c8:3a:35:d5:76:9f GATEWAY=192.168.37.1 IPV6INIT=yes IPV6_AUTOCONF="yes" NM_CONTROLLED=no ON_BOOT=yes TYPE=Ethernet USERCTL=no
    After changing the file to look like above I did
    Code:
    ifconfig eth1 down
    ifconfig eth1 up
    service dhcpd start
    But I still get the same error in /var/log/messages. So, no observable change.

    It was less clear to me precisely what you meant by your second suggestion (item 3) but I tried this
    Code:
    option domain-name-servers 192.168.37.1;
    But again I still get the same error.

Similar Threads

  1. starting dhcpd: failed
    By lynntwin in forum Linux - Hardware, Networking & Security
    Replies: 6
    Last Post: 03-25-2008, 01:28 AM
  2. DHCPD problem.
    By CK in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 07-15-2003, 09:54 AM
  3. USB: insmod input.o fails, HID fails
    By x in forum Linux - General Topics
    Replies: 2
    Last Post: 02-18-2003, 08:15 AM
  4. dhcpd
    By friskydrifter in forum Linux - Software, Applications & Programming
    Replies: 6
    Last Post: 11-24-2002, 09:17 PM
  5. XMMS fails to start
    By Dizzybacon in forum Linux - Software, Applications & Programming
    Replies: 8
    Last Post: 11-02-2002, 06:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •