News: This forum is now permanently frozen.
Pages: [1]
Topic: DHCP Relay Problem  (Read 6143 times)
« on: January 21, 2008, 15:13:15 »
markb ****
Posts: 331

Hi.  I hesitate to post this as I have never experienced a bug in Monowall before, but here goes.

I am using V1.232 on a generic PC.  I have 3 interfaces configured.  It is an internal router, so Advanced NAT is enabled removing automatic NAT rules.  The WAN interface is configured with a static IP address on the corporate LAN.  I want to have DHCP relay on the LAN interface so that the leases will be registered in the company  DNS servers.  The OPT1 interface is using the DHCP server.

When first built, this appears to work correctly, but then the DHCP relay fails.  I found the following in the system log.

Code: (System Log)
Jan 18 14:23:46 m0n0wall dhcrelay: Internet Systems Consortium DHCP Relay Agent V3.0.5
Jan 18 14:23:46 m0n0wall dhcrelay: Copyright 2004-2006 Internet Systems Consortium.
Jan 18 14:23:46 m0n0wall dhcrelay: All rights reserved.
Jan 18 14:23:46 m0n0wall dhcrelay: For info, please visit http://www.isc.org/sw/dhcp/
Jan 18 14:23:46 m0n0wall dhcrelay: Listening on BPF/fxp1/00:02:a5:30:05:ad
Jan 18 14:23:46 m0n0wall dhcrelay: Sending on   BPF/fxp1/00:02:a5:30:05:ad
Jan 18 14:23:46 m0n0wall dhcrelay: Listening on BPF/fxp2/00:02:b3:41:d7:e4
Jan 18 14:23:46 m0n0wall dhcrelay: Sending on   BPF/fxp2/00:02:b3:41:d7:e4
Jan 18 14:23:46 m0n0wall dhcrelay: Can't bind to dhcp address: Address already in use
Jan 18 14:23:46 m0n0wall dhcrelay: Can't bind to dhcp address: Address already in use
Jan 18 14:23:46 m0n0wall dhcrelay: Please make sure there is no other dhcp server
Jan 18 14:23:46 m0n0wall dhcrelay: Please make sure there is no other dhcp server
Jan 18 14:23:46 m0n0wall dhcrelay: running and that there's no entry for dhcp or
Jan 18 14:23:46 m0n0wall dhcrelay: running and that there's no entry for dhcp or
Jan 18 14:23:46 m0n0wall dhcrelay: bootp in /etc/inetd.conf.   Also make sure you
Jan 18 14:23:46 m0n0wall dhcrelay: bootp in /etc/inetd.conf.   Also make sure you
Jan 18 14:23:46 m0n0wall dhcrelay: are not running HP JetAdmin software, which
Jan 18 14:23:46 m0n0wall dhcrelay: are not running HP JetAdmin software, which
Jan 18 14:23:46 m0n0wall dhcrelay: includes a bootp server.
Jan 18 14:23:46 m0n0wall dhcrelay: includes a bootp server.

The xml config for the DHCP relay shows

Code: (XML Config)
    <dhcrelay>
        <server>192.168.56.35</server>
        <lan>
            <enable/>
        </lan>
        <opt1/>
    </dhcrelay>



This shows that it is attempting to bind the DHCP relay affecting fxp1 (WAN) and fxp2 (LAN) which I assume to be correct. The configuration is definitely correct.  However, if I turn off the DHCP server on the OPT1 interface and his save on the DHCP Relay page to restart the service I get

Code: (System Log)
Jan 21 14:05:06 m0n0wall dhcrelay: Internet Systems Consortium DHCP Relay Agent V3.0.5
Jan 21 14:05:06 m0n0wall dhcrelay: Copyright 2004-2006 Internet Systems Consortium.
Jan 21 14:05:06 m0n0wall dhcrelay: All rights reserved.
Jan 21 14:05:06 m0n0wall dhcrelay: For info, please visit http://www.isc.org/sw/dhcp/
Jan 21 14:05:06 m0n0wall dhcrelay: Listening on BPF/fxp1/00:02:a5:30:05:ad
Jan 21 14:05:06 m0n0wall dhcrelay: Sending on   BPF/fxp1/00:02:a5:30:05:ad
Jan 21 14:05:06 m0n0wall dhcrelay: Listening on BPF/fxp2/00:02:b3:41:d7:e4
Jan 21 14:05:06 m0n0wall dhcrelay: Sending on   BPF/fxp2/00:02:b3:41:d7:e4
Jan 21 14:05:06 m0n0wall dhcrelay: Sending on   Socket/fallback

If I then start the DHCP server on the OPT1 interface it will all work, but then fails after a reboot as I presume the DHCP server comes up before the DHCP relay service.

Any ideas?
« Reply #1 on: March 03, 2008, 03:37:08 »
cmb *****
Posts: 851

Getting DHCP relay and DHCP server to work together on the same box is a difficult scenario at best. The logic required to make it work with no bugs for any situation is difficult if not impossible to achieve. In pfSense, you can't enable the DHCP server if DHCP relay is enabled on any interface and vice versa to avoid these issues. It's overzealous, because this can work in some circumstances, but it's a heck of a lot easier than trying to put together something bug free that allows the two to properly interact.

I would suggest never running DHCP relay and server simultaneously on the same box. If you're using DHCP relay, you have another DHCP server available anyway, so might as well use it for all interfaces.
 
Pages: [1]
 
 
Powered by SMF 1.1.20 | SMF © 2013, Simple Machines