Date: 01 Jul 2003 08:45:54 -0400 From: Dan Pelleg <daniel+bsd@pelleg.org> To: lewiz <purple@lewiz.info> Cc: FreeBSD-questions <freebsd-questions@freebsd.org> Subject: Re: Variable NFS mounts / firewall rules. Message-ID: <u2sptkuifel.fsf@gs166.sp.cs.cmu.edu> In-Reply-To: <20030701063248.GA904@lewiz.org> References: <20030701063248.GA904@lewiz.org>
next in thread | previous in thread | raw e-mail | index | archive | help
lewiz <purple@lewiz.info> 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.<INTERFACE NAME> (for example /etc/start_if.fxp0 ). -- Dan Pelleg
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?u2sptkuifel.fsf>