From owner-freebsd-questions@FreeBSD.ORG Wed Sep 7 14:06:49 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 50EC516A420 for ; Wed, 7 Sep 2005 14:06:49 +0000 (GMT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail28.sea5.speakeasy.net (mail28.sea5.speakeasy.net [69.17.117.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66A3043D73 for ; Wed, 7 Sep 2005 14:06:48 +0000 (GMT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: (qmail 24656 invoked from network); 7 Sep 2005 14:06:47 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail28.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 7 Sep 2005 14:06:47 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id C9EE147; Wed, 7 Sep 2005 10:06:46 -0400 (EDT) Sender: lowell@be-well.ilk.org To: Ihsan Dogan References: <20050905214641.GA28018@dogan.ch> From: Lowell Gilbert Date: 07 Sep 2005 10:06:46 -0400 In-Reply-To: <20050905214641.GA28018@dogan.ch> Message-ID: <44fyshnf9l.fsf@be-well.ilk.org> Lines: 67 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: FreeBSD Questions Subject: Re: dhcrelay is setting the relay ip address wrong X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2005 14:06:49 -0000 Ihsan Dogan writes: > Hello, > > I'm running a small router/firewall on a FreeBSD 5.4 system. This > machine should also act as a DHCP gateway. For the dhcp relay, > I'm using ISC's dhcrelay (from Ports isc-dhcp3-relay-3.0.3). > > The Interfaca and network configuration: > hme0: flags=8843 mtu 1500 > options=b > inet 213.144.141.145 netmask 0xfffffff8 broadcast 213.144.141.151 > inet6 fe80::a00:20ff:feb4:42cc%hme0 prefixlen 64 scopeid 0x1 > inet6 2001:470:1f01:569::1 prefixlen 112 > ether 08:00:20:b4:42:cc > media: Ethernet autoselect (100baseTX ) > status: active > hme1: flags=8843 mtu 1500 > options=b > inet 192.168.23.1 netmask 0xffffff00 broadcast 192.168.23.255 > inet6 fe80::a00:20ff:feb4:42cd%hme1 prefixlen 64 scopeid 0x2 > ether 08:00:20:b4:42:cd > media: Ethernet autoselect (100baseTX ) > status: active > hme2: flags=8843 mtu 1500 > options=b > inet 192.168.42.1 netmask 0xffffff00 broadcast 192.168.42.255 > inet6 fe80::a00:20ff:feb4:42ce%hme2 prefixlen 64 scopeid 0x3 > ether 08:00:20:b4:42:ce > media: Ethernet autoselect (100baseTX ) > status: active > > The DHCP server is on the subnet of hme0; the DHCP clients are on > hme1 on hme2. > > netstat -rnf inet: > Destination Gateway Flags Refs Use Netif Expire > default 213.144.128.205 UGS 0 250630 tun0 > 127.0.0.1 127.0.0.1 UH 0 71 lo0 > 192.168.23 link#2 UC 0 0 hme1 > 192.168.23.2 00:c0:49:5a:1d:ca UHLW 0 2 hme1 823 > 192.168.42 link#3 UC 0 0 hme2 > 213.144.128.205 213.144.146.12 UH 1 0 tun0 > 213.144.141.144 ff:ff:ff:ff:ff:ff UHLWb 0 3 hme0 => > 213.144.141.144/29 link#1 UC 0 0 hme0 > 213.144.141.146 00:08:c7:3a:df:a9 UHLW 0 104123 hme0 233 > 213.144.141.147 00:07:e9:14:1a:a1 UHLW 0 38011 hme0 322 > 213.144.141.151 ff:ff:ff:ff:ff:ff UHLWb 0 1 hme0 > > The dhcrelay is started with the following options: > /usr/local/sbin/dhcrelay -i hme1 -i hme2 -d -a 213.144.141.146 > > The dhcrelay receives the request and passes them to the DHCP > server, but the forwarded package contains the "relay agent ip > address" of 192.168.23.1 and not 213.144.141.145 how it should > be. In that case, the DHCP server is sending the reply to > 192.168.23.1 and not to 213.144.141.145. > > Did I something wrong? A bug? The relay agent is acting exactly the way it should. When it gets a DHCP request in from a client, it uses its own address ON THE CLIENT'S NETWORK for the relay agent address. This way, the DHCP server can tell which network the client is on, and thus which set of addresses to use for assigning an address to the client. What is the problem?