From owner-freebsd-questions Tue May 15 12:40:23 2001 Delivered-To: freebsd-questions@freebsd.org Received: from grumpy.dyndns.org (user-24-214-76-217.knology.net [24.214.76.217]) by hub.freebsd.org (Postfix) with ESMTP id 9849637B422 for ; Tue, 15 May 2001 12:39:59 -0700 (PDT) (envelope-from dkelly@grumpy.dyndns.org) Received: from localhost (localhost [127.0.0.1]) by grumpy.dyndns.org (8.11.3/8.11.3) with ESMTP id f4FJdl548367; Tue, 15 May 2001 14:39:47 -0500 (CDT) (envelope-from dkelly@grumpy.dyndns.org) Message-Id: <200105151939.f4FJdl548367@grumpy.dyndns.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Chip Wiegand Cc: freebsd-questions@FreeBSD.ORG Subject: Re: ISP is forcing a change from static to dynamic IP Addresses. :-( In-Reply-To: Message from Chip Wiegand of "Mon, 14 May 2001 16:55:20 PDT." <20010514165520.1f0ee839.chip@wiegand.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 15 May 2001 14:39:47 -0500 From: David Kelly Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Chip Wiegand writes: > My ISP recently informed all their customers they have reorganized their > system, received new ipaddress ranges and are requiring everyone to go > to dynamic ip addresses. They say the dynaminc address given will be > staticly mapped, so in essence it will be 'perminant'. I have a machine > setup with fbsd4.2, it is my router/firewall, running IPFW/NATD. > I have had a static ip address for a couple years, now I have to change. > I'm not sure what I have to do to make the change. > Any suggestions would be appreciated. (Including changing ISP's). This is all it takes in /etc/rc.conf for me: ifconfig_fxp0="DHCP" Now, its much harder to deal with the firewall rules on change of IP address (happens every couple of months) but I do it like this in /etc/dhclient-exit-hooks: #!/bin/sh ( date echo ${reason:-NO_REASON_GIVEN} case ${reason} in BOUND|REBIND) # May or may not be a new address. # adds $old_ip_address to working variables # use :-number to force behavior if variables are missing if [ ${old_ip_address:-0} != ${new_ip_address:-1} ] then if [ X${new_ip_address%\.[0-9]*\.[0-9]*} = "X192.168" ] then echo "do nothing: darned modem IP address ${new_ip_address}" else . /etc/dmk.firewall # if one is using DynDNS: echo /usr/local/sbin/ddup --host grumpy.dyndns.org --static /usr/local/sbin/ddup --host grumpy.dyndns.org --static # set fi else echo "addresses did not change (${reason})" fi ;; REBOOT) echo "reboot" # echo "re-init firewall" # /bin/sh /etc/dmk.firewall 2>&1 echo `date` ;; *) echo "nothing needed (${reason:-NOT_SPECIFIED})" ;; esac if [ X${old_ip_address} != "X" ] then echo "old_ip_address = " ${old_ip_address} fi if [ X${new_ip_address} != "X" ] then echo "new_ip_address = " ${new_ip_address} fi ) 2>&1 >> /home/dkelly/dhclient.debug -- David Kelly N4HHE, dkelly@hiwaay.net ===================================================================== The human mind ordinarily operates at only ten percent of its capacity -- the rest is overhead for the operating system. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message