Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jul 2006 00:05:54 -0700
From:      Serban Giuroiu <glists@comcast.net>
To:        freebsd-questions@freebsd.org
Subject:   DHCPd Will Not Listen on the Correct Interface
Message-ID:  <200607220005.54412.glists@comcast.net>

next in thread | raw e-mail | index | archive | help
Hello, everybody.

I have a fresh install of FreeBSD 6.1-RELEASE on a machine with several NICs, 
and I need to run different DHCP servers for different subnets on different 
NICs. I installed isc-dhcp3-server-3.0.4_2 from ports with the default 
options enabled (of importance: DHCP_PARANOIA and DHCP_JAIL).

These are the interfaces I need to run DHCPd on:

fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=8<VLAN_MTU>
        inet6 fe80::2d0:b7ff:fee1:620f%fxp0 prefixlen 64 scopeid 0x1 
        inet 172.16.2.9 netmask 0xfffffc00 broadcast 172.16.3.255
        ether 00:d0:b7:e1:62:0f
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=8<VLAN_MTU>
        inet6 fe80::250:baff:fed1:a75a%rl0 prefixlen 64 scopeid 0x2 
        inet 10.0.0.1 netmask 0xfffffc00 broadcast 10.0.3.255
        ether 00:50:ba:d1:a7:5a
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active

According to the man page, dhcpd takes as a last argument the interface it 
should bind to. I run one dhcpd for the interface rl0 like so:

/usr/local/sbin/dhcpd -cf /usr/local/etc/dhcpd.conf.rl0.10.0.0.0 -lf /var/db/dhcpd.leases.rl0.10.0.0.0 -pf /var/run/dhcpd.pid.rl0.10.0.0.0 -user 
dhcpd -group dhcpd rl0

ps ax | grep dhcp shows it running:

20463  ??  Is     
0:00.00 /usr/local/sbin/dhcpd -cf /usr/local/etc/dhcpd.conf.rl0.10.0.0.0 -lf /var/db/dhcpd.leases.rl0.10.0.0.0 -pf /var/run/dhcpd.pid.rl0.10.0.0.0 -user 
dhcpd -group dhcpd rl0

However, it binds to all interfaces, not just rl0. netstat -nat | grep 67 
confirms this:

udp4       0      0  *.67                   *.*                    

Naturally, I cannot start any other DHCP servers on the other interface:

# /usr/local/sbin/dhcpd -cf /usr/local/etc/dhcpd.conf.fxp0.172.16.0.0 -lf /var/db/dhcpd.leases.fxp0.172.16.0.0 -pf /var/run/dhcpd.pid.fxp0.172.16.0.0 -user 
dhcpd -group dhcpd fxp0

Internet Systems Consortium DHCP Server V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
Listening on BPF/fxp0/00:d0:b7:e1:62:0f/172.16.0/22
Sending on   BPF/fxp0/00:d0:b7:e1:62:0f/172.16.0/22
Can't bind to dhcp address: Address already in use
Please make sure there is no other dhcp server
running and that there's no entry for dhcp or
bootp in /etc/inetd.conf.   Also make sure you
are not running HP JetAdmin software, which
includes a bootp server.

After searching through Google, forums, and mailing lists, I have not 
encountered a post describing a similar situation. Does anybody know what the 
problem might be?

Regards,
--Serban Giuroiu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607220005.54412.glists>