Skip site navigation (1)Skip section navigation (2)
Date:      07 Sep 2005 10:06:46 -0400
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        Ihsan Dogan <ihsan@dogan.ch>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: dhcrelay is setting the relay ip address wrong
Message-ID:  <44fyshnf9l.fsf@be-well.ilk.org>
In-Reply-To: <20050905214641.GA28018@dogan.ch>
References:  <20050905214641.GA28018@dogan.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
Ihsan Dogan <ihsan@dogan.ch> 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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         options=b<RXCSUM,TXCSUM,VLAN_MTU>
>         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 <full-duplex>)
>         status: active
> hme1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         options=b<RXCSUM,TXCSUM,VLAN_MTU>
>         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 <full-duplex>)
>         status: active
> hme2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         options=b<RXCSUM,TXCSUM,VLAN_MTU>
>         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 <full-duplex>)
>         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?  



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