LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DHCPD: how to get deamon to respond to relay agents, but not locally (https://www.linuxquestions.org/questions/linux-networking-3/dhcpd-how-to-get-deamon-to-respond-to-relay-agents-but-not-locally-612662/)

Hewson 01-10-2008 02:21 PM

DHCPD: how to get deamon to respond to relay agents, but not locally
 
CentOS 5

Code:


 -----    -----
|DHCPD|  |DHCPD|
|  1  |  |  2  |
 -----    -----
  |        |      NETWORK A
--------------------------
        |
    ----------
    |RelayAgent|
    | \ Router |   
    ----------
        |        NETWORK B
------------------------
    |
  ------
 | DHCP |
 |client|
  ------

So here is my problem. I have a dhcp server (DHCPD 2) on one network (NETWORK A) that I need to respond to requests coming from the relay agent (RelayAgent \ Router), but I do not want it to respond to requests on its own network (NETWORK A). There is a separate dhcp server for this network (DHCPD 1). That dhcp server (DHCPD 1) needs to only serve its directly connected network (NETWORK A).

I only want the DHCPD 2 machine to hand out leases via the interface on NETWORK A, it has other interfaces on which it must not be handing out dhcp leases. I configured DHCPD 2 with the leases for subnet of NETWORK B and set /etc/sysconfig/dhcpd's 'DHCPDARGS' to the interface on NETWORK A.

When i start the dhcpd service on DHCPD 2, it fails. /var/log/messages says:
Code:

Jan 10 11:21:50 localhost Installed: dhcp.i386 12:3.0.5-7.el5
Jan 10 12:00:12 localhost dhcpd: Internet Systems Consortium DHCP Server V3.0.5-RedHat
Jan 10 12:00:12 localhost dhcpd: Copyright 2004-2006 Internet Systems Consortium.
Jan 10 12:00:12 localhost dhcpd: All rights reserved.
Jan 10 12:00:12 localhost dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Jan 10 12:00:12 localhost dhcpd: Wrote 0 leases to leases file.
Jan 10 12:00:12 localhost dhcpd:
Jan 10 12:00:12 localhost dhcpd: No subnet declaration for eth0 (192.168.14.1).
Jan 10 12:00:12 localhost dhcpd: ** Ignoring requests on eth0.  If this is not what
Jan 10 12:00:12 localhost dhcpd:    you want, please write a subnet declaration
Jan 10 12:00:12 localhost dhcpd:    in your dhcpd.conf file for the network segment
Jan 10 12:00:12 localhost dhcpd:    to which interface eth0 is attached. **
Jan 10 12:00:12 localhost dhcpd:
Jan 10 12:00:12 localhost dhcpd:
Jan 10 12:00:12 localhost dhcpd: Not configured to listen on any interfaces!
Jan 10 12:00:12 localhost dhcpd:
Jan 10 12:00:12 localhost dhcpd: If you did not get this software from ftp.isc.org, please
Jan 10 12:00:12 localhost dhcpd: get the latest from ftp.isc.org and install that before
Jan 10 12:00:12 localhost dhcpd: requesting help.
Jan 10 12:00:12 localhost dhcpd:
Jan 10 12:00:12 localhost dhcpd: If you did get this software from ftp.isc.org and have not
Jan 10 12:00:12 localhost dhcpd: yet read the README, please read it before requesting help.
Jan 10 12:00:12 localhost dhcpd: If you intend to request help from the dhcp-server@isc.org
Jan 10 12:00:12 localhost dhcpd: mailing list, please read the section on the README about
Jan 10 12:00:12 localhost dhcpd: submitting bug reports and requests for help.
Jan 10 12:00:12 localhost dhcpd:
Jan 10 12:00:12 localhost dhcpd: Please do not under any circumstances send requests for
Jan 10 12:00:12 localhost dhcpd: help directly to the authors of this software - please
Jan 10 12:00:12 localhost dhcpd: send them to the appropriate mailing list as described in
Jan 10 12:00:12 localhost dhcpd: the README file.
Jan 10 12:00:12 localhost dhcpd:
Jan 10 12:00:12 localhost dhcpd: exiting.
Jan 10 12:00:12 localhost dhcpd: dhcpd startup failed

How can I get this to work?

I can get it to start up if i add an empty lease for the local network a.k.a.
subnet 192.168.8.0 netmask 255.255.248.0 {
}

But will DHCPD start serving leases for 192.168.8.0/21 with some sort of default settings?

Hewson 01-10-2008 03:20 PM

Works!
 
putting the subnet in w/o any lease parameter results in no network response for DHCP DISCOVERs the server recieves. /var/log/messages says:

"Jan 10 13:08:27 localhost dhcpd: DHCPDISCOVER from 00:15:93:fe:00:f2 via eth0: network 192.168.8/21: no free leases"

yay.

rumbero 11-18-2008 11:04 AM

Hi Hewson

I have the same problem...

Server in network A (10.128.0.0/18) but should only response to network B (10.128.128.0/18) requests...

Quote:

#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
#

#option domain-name-servers 145.253.2.75, 193.174.32.18;

default-lease-time 86400;
max-lease-time 604800;

#ddns-update-style interim;
ddns-update-style none;
ignore client-updates;


authoritative;

subnet 10.128.128.0 netmask 255.255.192.0 {
range 10.128.161.101 10.128.161.101;
filename "/pxelinux.0";
option subnet-mask 255.255.192.0;
option broadcast-address 10.128.191.255;
option routers 10.128.128.1;
next-server 10.128.8.13;
#allow booting;
#allow bootp;
#option option-128 code 128 = string;
#option option-129 code 129 = text;
}

I cannot start "service dhcpd start"


/var/log/messages:

Quote:

Nov 18 16:47:32 pxe dhcpd: Internet Systems Consortium DHCP Server V3.0.5-RedHat
Nov 18 16:47:32 pxe dhcpd: Copyright 2004-2006 Internet Systems Consortium.
Nov 18 16:47:32 pxe dhcpd: All rights reserved.
Nov 18 16:47:32 pxe dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Nov 18 16:47:32 pxe dhcpd: Wrote 0 leases to leases file.
Nov 18 16:47:32 pxe dhcpd:
Nov 18 16:47:32 pxe dhcpd: No subnet declaration for eth1 (10.128.8.13).
Nov 18 16:47:32 pxe dhcpd: ** Ignoring requests on eth1. If this is not what
Nov 18 16:47:32 pxe dhcpd: you want, please write a subnet declaration
Nov 18 16:47:32 pxe dhcpd: in your dhcpd.conf file for the network segment
Nov 18 16:47:32 pxe dhcpd: to which interface eth1 is attached. **
Nov 18 16:47:32 pxe dhcpd:
Nov 18 16:47:32 pxe dhcpd:
Nov 18 16:47:32 pxe dhcpd: No subnet declaration for eth0 (10.130.10.12).
Nov 18 16:47:32 pxe dhcpd: ** Ignoring requests on eth0. If this is not what
Nov 18 16:47:32 pxe dhcpd: you want, please write a subnet declaration
Nov 18 16:47:32 pxe dhcpd: in your dhcpd.conf file for the network segment
Nov 18 16:47:32 pxe dhcpd: to which interface eth0 is attached. **
Nov 18 16:47:32 pxe dhcpd:
Nov 18 16:47:32 pxe dhcpd:
Nov 18 16:47:32 pxe dhcpd: Not configured to listen on any interfaces!
Nov 18 16:47:32 pxe dhcpd:
Nov 18 16:47:32 pxe dhcpd: If you did not get this software from ftp.isc.org, please
Nov 18 16:47:32 pxe dhcpd: get the latest from ftp.isc.org and install that before
Nov 18 16:47:32 pxe dhcpd: requesting help.
Nov 18 16:47:32 pxe dhcpd:
Nov 18 16:47:32 pxe dhcpd: If you did get this software from ftp.isc.org and have not
Nov 18 16:47:32 pxe dhcpd: yet read the README, please read it before requesting help.
Nov 18 16:47:32 pxe dhcpd: If you intend to request help from the dhcp-server@isc.org
Nov 18 16:47:32 pxe dhcpd: mailing list, please read the section on the README about
Nov 18 16:47:32 pxe dhcpd: submitting bug reports and requests for help.
Nov 18 16:47:32 pxe dhcpd:
Nov 18 16:47:32 pxe dhcpd: Please do not under any circumstances send requests for
Nov 18 16:47:32 pxe dhcpd: help directly to the authors of this software - please
Nov 18 16:47:32 pxe dhcpd: send them to the appropriate mailing list as described in
Nov 18 16:47:32 pxe dhcpd: the README file.
Nov 18 16:47:32 pxe dhcpd:
Nov 18 16:47:32 pxe dhcpd: exiting.

I don't know what I can do???

Thanx for helping me...

Hewson 11-19-2008 11:17 AM

add an empty declaration for the local network to your dhcpd.conf:

subnet 10.128.0.0 netmask 255.255.192.0 {}

rumbero 11-21-2008 04:57 AM

Quote:

Originally Posted by Hewson (Post 3347712)
add an empty declaration for the local network to your dhcpd.conf:

subnet 10.128.0.0 netmask 255.255.192.0 {}

It works now...


Thanx


All times are GMT -5. The time now is 09:22 AM.