Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    dhcpd complains about a subgroup entry


    Internet cable via a Linksys AC1200 (EA6100) cable modem, then Tp-Link switch that supplies west side of the house. Off this same switch is a D-Link (D-615) router/wifi that supplies all devices on the east side of the home. Both of these routers originally handled their own internal dhcp. Now I've switched the DHCP over to my main computer and in trying to 'describe' the network to dhcpd, it seems to not like the D-Link subnet entry. This is the entry to describe the east side subnet that incorporates the D-Link router. The docs describe this and indicate that I should use 'subnet' that describes the subnet itself. The D-Link router is set to dhcp, so it get's it's address via the main machine (where I'm trying to configure). The address, on boot, of the router is 192.168.0.1, but goes out the WAN port with a dhcp request and recieves it. So I'm not clear about how to describe it. This is obvious as the error seems inconsistent with the entry. If I need to describe this by the 'other side' of the subnet, I'm lost on how to tell which device is there if I can't use a MAC address. I've tried the MAC address but it claims it's not legal there... It seems to work, albeit inconsistently without this statement. As wired devices on the east side get (a west side IP) through the D-Link router (it's set to 'dchp relay'), but have some problems with wifi Windows 10 devices getting a dynamic IP. Here is the subnet description.

    Code:
    #
    # Dlink D-615 Livingroom Router
    #
    	subnet 192.168.0.1 netmask 255.255.255.128 {
    	  range 192.168.0.100 192.168.0.133;
    #	  hardware ethernet 00:18:e7:c6:75:9b; ## dlinks MAC address
    	  option domain-name-servers kilo.kat;
    	  option routers jezabel;
    	}
    The hardware entry is commented out as it chokes as not available for this entry. I've checked out if 0 (that's zeso) is legal in the 'subn...0.1 netmas' entry, seems to be. The problem doesn't change if I change that address to anything else. Here is the output:

    Code:
    # dhcpd -d
    Internet Systems Consortium DHCP Server 4.2.4
    Copyright 2004-2012 Internet Systems Consortium.
    All rights reserved.
    For info, please visit https://www.isc.org/software/dhcp/
    /etc/dhcp/dhcpd.conf line 25: subnet 192.168.0.1 netmask 255.255.255.128: bad subnet number/mask combination.
    	subnet 192.168.0.1 netmask 255.255.255.128 
                                                   ^
    WARNING: Host declarations are global.  They are not limited to the scope you declared them in.
    Configuration file errors encountered -- exiting
    root@Kilo:/etc/dhcp#
    I've tried many address' for the IP after the subnet keyword (?) and netmask, and it ALWAYS says the same thing. I'm starting to think it's because I don't really understand the format or how it's evaluated or placed incorrectly within the dhcpd.conf file. I've tried it by itself and get the same error, yet the basic layout (with the linksys router) causes no complaint.

    If you're still with me, here is the complete dhcpd.conf. It is quite hacked, but many items are commented out... Here is comes...

    Code:
    root@Kilo:/etc/dhcp# cat dhcpd.conf
    option domain-name "kilo.kat";
    #option domain-name jezabel;
    option domain-name-servers kilo.kat, dreamplug.kat;
    #option subnet-mask 255.255.255.0;
    default-lease-time 120;   # 2 minutes (seconds)
    max-lease-time 604800;    # 7 days
    server-name "kilo";
    
    #
    #
    #
    shared-network kilo {
    
    #
    # Basic DHCP for 100 through 133 for base (Linksys - main router)
    #
            subnet 192.168.1.0 netmask 255.255.255.0 {
              range 192.168.1.100 192.168.1.133;
              option routers 192.168.1.1;
            }
    
    #
    # Dlink D-615 Livingroom Router
    #
    	subnet 192.168.0.1 netmask 255.255.255.128 {
    	  range 192.168.0.100 192.168.0.133;
    	  option routers jezabel;
    	}
    
    
    #
    # Configure Jana's laptop to be accessable via wifi and ethernet connection
    #
            host  gilligan {
    	   server-name "kilo";
    	   next-server kilo.kat;
    	   hardware ethernet 2c:33:7a:17:c4:2f; ## Jana's wifi mac address
    #	   hardware ethernet d0:bf:9c:0d:88:de; ## Jana's Ethernet mac address
    	   option domain-name "gilligan.kat";
    	   option broadcast-address 192.168.1.255;
            }
    #
    # Following entry for bootp of dreamplug
    #
    	class  "dreamplug" {
    	  filename "/tftpboot";
    # 	    hardware ethernet F0:AD:4E:00:00:01;  ## Dreamplug MAC eth1
    #	    fixed-address 192.168.1.99;		  ## Dreamplug Ethernet IP Addr
    	    server-name "kilo";
      	    next-server kilo.kat;
    	    option broadcast-address 192.168.1.255;
    	    option domain-name "dreamplug.kat";   ## it's actual name
    	}
    
    } # End kilo
    root@Kilo:/etc/dhcp#
    Thanks to all for at least reading. Appreciate the assistance.

    Jack

  2. #2
    Hi,

    it is stated in daemon output:

    "/etc/dhcp/dhcpd.conf line 25: subnet 192.168.0.1 netmask 255.255.255.128: bad subnet number/mask combination.
    subnet 192.168.0.1 netmask 255.255.255.128 "

    You can't use 192.168.0.133 IP address. It is out of range.

    Network address: 192.168.0.0
    Broadcast Address: 192.168.0.127
    Usable IP addresses: 192.168.0.1 - 192.168.0.126


    Zlatko

  3. #3
    -->
    I see your point, but the end point can be 254, which is 0 on the net mask, as I believe I was using 100 to 126 for the 128 portion of the mask. I think maybe I was just too tired and needed to quit. Thanks for pointing out the problem, as I should have seen it...

    Thanks

    Jack
    Last edited by jkwilborn; 11-10-2015 at 10:21 AM. Reason: missing info

$spacer_open
$spacer_close

Posting Permissions

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