networking - fedora, dhcpd fails to start

29
2013-07
  • drahnr

    History: I got a tiny shiny plugserver which I want to plug to my ADSL router (or however you want to call it) on one end (eth0), and the other end (eth1) I want to run a dhcp server for my LAN. ATM I am stuck with getting LAN to work. OS is fedora 12. I configured my /etc/dhcp/dhcpd.conf like this:

    #
    # DHCP Server Configuration file.
    #   see /usr/share/doc/dhcp*/dhcpd.conf.sample
    #   see 'man 5 dhcpd.conf'
    #
    
    option domain-name "unknown.org";
    option domain-name-servers 192.168.44.1;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.44.255;
    
    default-lease-time 86400;
    max-lease-time 172800;
    
    subnet 192.168.44.0 netmask 255.255.255.0
    {
    host fedorabigbox
    {
            hardware ethernet 00:19:66:8E:61:74;
            fixed-address 192.168.44.21;
    }
    
    #host mobile
    #{
    #       hardware ethernet ***;
    #       fixed-address 192.168.44.22;
    #}
    
            range 192.168.44.100 192.168.44.110;
            option routers 192.168.44.1;
    }
    
    # this is just dummy, as read many howtos, some suggesting to add a subnet blah netmask blah for each interface
    subnet 192.168.33.0 netmask 255.255.255.0
    {
            range 192.168.33.100 192.168.33.110;
            option routers 192.168.33.1;
    }
    

    But the server fails to start when trying to start it via /etc/init.d/dhcpd start

    In general it would be nice if someone can point me to a in detail explanation of how network works, I am pretty new to this stuff.

    More concrete question: How to point the subnets to eth1 and the other to eth0, how can this be achieved?

    Does someone see any errors or flaws? Syntax should be correct, allready checked that with the dhcpd syntax check.

    Thanks for any help

    Appendix:

    The Error:

    Internet Systems Consortium DHCP Server 4.1.0p1
    Copyright 2004-2009 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.
    Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
    Wrote 0 deleted host decls to leases file.
    Wrote 0 new dynamic host decls to leases file.
    Wrote 0 leases to leases file.
    
    No subnet declaration for eth0 (no IPv4 addresses).
    ** 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. **
    
    
    Not configured to listen on any interfaces!
    
    This version of ISC DHCP is based on the release available
    on ftp.isc.org.  Features have been added and other changes
    have been made to the base software release in order to make
    it work better with this distribution.
    
    Please report for this software via the Red Hat Bugzilla site:
        http://bugzilla.redhat.com
    
    exiting.
    
  • Answers
  • pablaasmo

    I can show you the config I have for my Fedora "router"/firewall. I am running Fedora 14 (recently upgraded from Fedora 13) It has 2 ether net cards (eth0 and eth1). eth0 is internal network (10.0.0.x) eth1 is external network connected to my cable operator. My "router" has internal address 10.0.0.3 I have replace names and made some info generic. Replace with your particular info where needed.

    option domain-name-servers 10.0.0.3, <external-dns1-ip>, <external-dns2-ip>;
    # Sample /etc/dhcpd.conf
    # (add your comments here) 
    
    option domain-name "net.home";
    
    group {
    host pc1 {
        fixed-address 10.0.0.2;
        hardware ethernet xx:xx:xx:xx:xx:xx;
        }
    host pc2 {
        fixed-address 10.0.0.4;
        hardware ethernet yy:yy:yy:yy:yy:yy;
        }
    # Canon Pixma iP5200R
    host printer1 {
        hardware ethernet zz:zz:zz:zz:zz:zz;
        fixed-address 10.0.0.12;
        }
    # Wireless IP camera
    host ipcamera {
        hardware ethernet ww:ww:ww:ww:ww:ww;
        fixed-address 10.0.0.15;
        }
    }
    
    
     # home.net
     subnet 10.0.0.0 netmask 255.255.255.0 {
    authoritative;
    range 10.0.0.20 10.0.0.100;
    default-lease-time 86400;
    max-lease-time 86400;
    option subnet-mask 255.255.255.0;
    option broadcast-address 10.0.0.255;
    option routers 10.0.0.3;
    }
    


  • view all most popular Amazon Coupons
    .

    Related Question

    linux - Dhcpd Daemon is trying to lease itself?
  • t0mm13b

    I have a Slackware Linux 13.0 box with two interfaces, eth0 and eth1. I have set this box up to be on the 192.168.1.0/24 network, with subnet mask of 255.255.255.0.

    I am trying to run a dhcpd server on this box to service two interfaces above, so I subnetted the 192.168.1.0/24 network into two subnets.

    • For eth0 192.168.1.1, subnet mask 255.255.255.128, broadcast mask 192.168.1.127.
    • For eth1 192.168.1.129, subnet mask 255.255.255.128, broadcast mask 192.168.1.255.

    Both the interfaces are assigned manually.

    eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:00
              inet addr:192.168.1.1  Bcast:192.168.1.127  Mask:255.255.255.128
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:1404 (1.3 KiB)
              Interrupt:11 Base address:0x8000 Memory:faffc000-faffcfff
    
    eth1      Link encap:Ethernet  HWaddr 00:00:00:00:00:00
              inet addr:192.168.1.128  Bcast:192.168.1.255  Mask:255.255.255.128
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:10003 errors:0 dropped:0 overruns:0 frame:0
              TX packets:13286 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:1589229 (1.5 MiB)  TX bytes:9900005 (9.4 MiB)
              Interrupt:11
    

    Here is the dhcpd.conf set up

    authoritative;
    ddns-update-style interim;
    ignore client-updates;
    
    subnet 192.168.1.0 netmask 255.255.255.128 {
    
         range 192.168.1.2 192.168.1.126;
         default-lease-time 86400;
         max-lease-time 86400;
    
         option routers 192.168.1.1;
    
         option ip-forwarding off;
    
         option domain-name-servers 208.67.222.222, 208.67.220.220;
    
         option broadcast-address 192.168.1.127;
         option subnet-mask 255.255.255.128;
    }
    
    subnet 192.168.1.128 netmask 255.255.255.128 {
    
         range 192.168.1.129 192.168.1.254;
         default-lease-time 86400;
         max-lease-time 86400;
    
         option routers 192.168.1.1;
    
         option ip-forwarding off;
    
         option domain-name-servers 208.67.222.222, 208.67.220.220;
    
         option broadcast-address 192.168.1.255;
         option subnet-mask 255.255.255.128;
    }
    

    This is what is showing in the log

    Apr 10 18:09:58 inspiron8600 dhcpd: DHCPDISCOVER from 00:00:00:00:00:00 (inspiron8600) via eth1
    Apr 10 18:09:58 inspiron8600 dhcpd: DHCPOFFER on 192.168.1.131 to 00:00:00:00:00:00 (inspiron8600) via eth1
    Apr 10 18:10:01 inspiron8600 dhcpcd[3832]: eth1: adding IP address 169.254.153.6/16
    

    This is happening spuriously, and the log gets filled up with nonsense..it should be noted that 'inspiron8600' is the linux box that is running the dhcpd server. So my question is this:

    How do I stop this from happening? And why would it be trying to give itself a lease?

    I am sure I have missed something but cannot see it and would appreciate a pair of eyes from the community to spot the obvious flaw!

    To mention, the MAC's have been filtered out and replaced with 0's to protect the guilty!!!


  • Related Answers
  • mmv-ru

    Its strange behavior.

    1. Its not answer but HWaddr 00:00:00:00:00:00 look wery strange!
    2. Not strange that the dhcp server gives the address for self host. It give address for everybody who ask. Strange why dhcp client ask!
    3. If dhcp clien functionality not necessry dhcpcd (DHCP Client Daemon) can be stopped and disabled.
  • Niten

    I hope this isn't a dumb question, but have you checked to make sure you don't have dhclient or dhcpcd (I don't know which one Slackware uses) still running on the system? In Slackware you may still have to disable the DHCP client daemon manually, depending on how you assigned the system's static IP addresses.

    Does the following command show anything running?

    ps -C dhcpcd,dhclient