[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Error in DHCPd in 2 networks sharing the same phisical network



I have found an error when configuring DHCPd in a 2-ethernet PC sharing the same phisical network. Both eth0 and eth1 became active, when only eth1 sould be. It lead to errors: see /var/log/

Jan 30 02:12:16 alcudia dhcpd: DHCPDISCOVER from 00:0d:54:9f:99:c5 via eth1
Jan 30 02:12:16 alcudia dhcpd: DHCPOFFER on 192.168.11.64 to 00:0d:54:9f:99:c5 via eth1 Jan 30 02:12:16 alcudia dhcpd: DHCPREQUEST for 192.168.11.64 from 00:0d:54:9f:99:c5 via eth0 Jan 30 02:12:16 alcudia dhcpd: DHCPNAK on 192.168.11.64 to 00:0d:54:9f:99:c5 via eth0 Jan 30 02:12:16 alcudia dhcpd: DHCPREQUEST for 192.168.11.64 from 00:0d:54:9f:99:c5 via eth1 Jan 30 02:12:16 alcudia dhcpd: DHCPACK on 192.168.11.64 to 00:0d:54:9f:99:c5 via eth1
Jan 30 02:12:17 alcudia dhcpd: DHCPDISCOVER from 00:0d:54:9f:99:c5 via eth0
Jan 30 02:12:17 alcudia dhcpd: no free leases on subnet 192.168.10.0

I have solved it modifying the file /etc/init.d/dhcp:

#!/bin/sh
#
# $Id: dhcp.init.d,v 1.3.2.2 2002/08/11 22:11:54 peloy Exp $
#

test -x /usr/sbin/dhcpd || exit 0

# Defaults
#INTERFACES="eth0"
#Changing the interface to eth1 does not work
INTERFACES=eth1

# Reads config file (will override defaults above)
[ -r /etc/default/dhcp ] && . /etc/default/dhcp

DHCPDPID=/var/run/dhcpd.pid

case "$1" in
   start)
       echo -n "Starting DHCP server: "
       start-stop-daemon --start --quiet --pidfile $DHCPDPID \
           --exec /usr/sbin/dhcpd eth1
# This does not work, listens for eth0 and eth1
#            --exec /usr/sbin/dhcpd -- -q $INTERFACES
       sleep 2




Reply to: