From owner-freebsd-questions@FreeBSD.ORG Tue Mar 1 20:00:55 2005 Return-Path: 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 8EC2316A4CE for ; Tue, 1 Mar 2005 20:00:55 +0000 (GMT) Received: from pimout3-ext.prodigy.net (pimout3-ext.prodigy.net [207.115.63.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id 02EBE43D46 for ; Tue, 1 Mar 2005 20:00:55 +0000 (GMT) (envelope-from mark@antsclimbtree.com) Received: from lilbuddy.antsclimbtree.com (adsl-69-232-30-131.dsl.snfc21.pacbell.net [69.232.30.131]) j21K0lVl024274; Tue, 1 Mar 2005 15:00:52 -0500 Received: from adsl-66-122-112-170.dsl.snfc21.pacbell.net ([66.122.112.170] helo=[192.168.1.116]) by lilbuddy.antsclimbtree.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.44 (FreeBSD)) id 1D6DXs-000093-UL; Tue, 01 Mar 2005 12:00:46 -0800 In-Reply-To: <44vf8b41fq.fsf@be-well.ilk.org> References: <44vf8b41fq.fsf@be-well.ilk.org> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <81c57d2fd8cc8ed9cf5059593bf3da4a@antsclimbtree.com> Content-Transfer-Encoding: 7bit From: Mark Edwards Date: Tue, 1 Mar 2005 12:00:37 -0800 To: Lowell Gilbert X-Mailer: Apple Mail (2.619.2) X-Spam-Score: -5.8 (-----) cc: "'questions@freebsd.org'" Subject: Re: arplookup 192.168.1.254 failed: host is not on local network X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2005 20:00:55 -0000 On Mar 1, 2005, at 11:21 AM, Lowell Gilbert wrote: > Mark Edwards writes: > >> I've just put my server on a new connection that requires DHCP, even >> for a fixed IP. Anyway, the DHCP server gives a fixed public internet >> IP to my server, but it communicates on 192.168.1.254, which angers >> FreeBSD (4.11). I get a lot of the following: >> >> arplookup 192.168.1.254 failed: host is not on local network >> >> Which makes sense, because as far as FreeBSD is concerned, interface >> ep1 is on the internet not on a LAN. > > Exactly. > >> Looking on the net, I found the following suggestion, which does cure >> the errors: >> >> /sbin/route add -net 192.168.1.254 -netmask 255.255.255.0 -interface 1 >> >> My question is, is that the proper way to deal with this? > > It's not bad. I would use -host instead of -net and -netmask, and it > will fail if the DHCP server ever changes its address, but what you > are doing is is working and fairly likely to stay that way. How would you phrase the command? I just tried -host and couldn't get it to work. >> I have to >> issue this statement whenever the dhclient is restarted. I've >> currently placed it in my firewall script, but is there a proper or >> more elegant way to achieve this? > > If you want something more elegant, you could specify a script for one > of the dhclient-script(8) hooks, and put the route in there. You > would be able to refer to the interface and server address by > variables which dhclient-script provides... Great! I put the command in /etc/dhclient-exit-hooks and it works great on a reboot. I don't really see which variables I can use in the dhclient-script man page though. Do you know which variables would do this? Thanks! -- Mark Edwards mark@antsclimbtree.com