From owner-freebsd-questions@FreeBSD.ORG Tue Jul 1 05:46:20 2003 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 27A1937B419 for ; Tue, 1 Jul 2003 05:46:20 -0700 (PDT) Received: from gs166.sp.cs.cmu.edu (GS166.SP.CS.CMU.EDU [128.2.205.169]) by mx1.FreeBSD.org (Postfix) with SMTP id 8568943FE3 for ; Tue, 1 Jul 2003 05:46:19 -0700 (PDT) (envelope-from dpelleg@gs166.sp.cs.cmu.edu) Sender: dpelleg@gs166.sp.cs.cmu.edu To: lewiz References: <20030701063248.GA904@lewiz.org> From: Dan Pelleg Date: 01 Jul 2003 08:45:54 -0400 In-Reply-To: <20030701063248.GA904@lewiz.org> Message-ID: Lines: 55 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: FreeBSD-questions Subject: Re: Variable NFS mounts / firewall rules. 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 Jul 2003 12:46:21 -0000 lewiz writes: > Hi, > > I have recently gotten around to setting up my laptop to play nicely > with dhclient (not as easy as it sounds). I have a number of questions > I should like to ask. I am going to provide a brief rundown of what I > would like to know, and more detail, for those interested. > > 1. Why does dhclient.conf ``ignore'' the media directive? > 2. Can I have /different/ NFS mounts, depending on the IP address > dhclient assigns to me? > 3. Can I have /different/ firewall rules, depending on the IP address > dhclient assigns to me? > [ .... ] No complete solution, just a few ideas to look into: 1. http://www.freebsd-support.de/misc/setnetparm/ I've never had the chance to use it myself, but it might help. 2. Use the automounter to mount NFS volumes on-demand. This way you will not have to worry about mounting until you actually need to access the volume. See amd(8). 3. ipfw supports the "me" keyword, to flexibly refer to your currently assigned IP address. 4. Just in case it might help you, here is my /etc/dhclient-exit-hooks: # nothing to do unless we're bound case ${reason} in BOUND | RENEW | REBIND | REBOOT ) if [ -n "${new_domain_name_servers}" ]; then if [ -z "${old_domain_name_servers}" ] || [ x${old_ip_address} != x{$new_ip_address} ]; then [ -x /etc/refresh-named ] && /etc/refresh-named ${new_domain_name_servers} [ -x /etc/set-time ] && /etc/set-time fi fi ;; esac You should be able to restart your firewall and pass it an argument for the ruleset in this way. 5. For more variables that are passed to dhclient-exit-hooks, see dhclient-script(8). 5. You can further run ifconfig commands in /etc/start_if. (for example /etc/start_if.fxp0 ). -- Dan Pelleg