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

Re: Error in DHCPd in 2 networks sharing the same phisical network



Jordi Ferrando wrote:
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:

you are supposed to edit /etc/defaults/dhcp
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/dhcp by the maintainer scripts

#
# This is a POSIX shell fragment
#

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1"



#!/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: