Date: Tue, 15 May 2001 14:39:47 -0500 From: David Kelly <dkelly@grumpy.dyndns.org> To: Chip Wiegand <chip@wiegand.org> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: ISP is forcing a change from static to dynamic IP Addresses. :-( Message-ID: <200105151939.f4FJdl548367@grumpy.dyndns.org> In-Reply-To: Message from Chip Wiegand <chip@wiegand.org> of "Mon, 14 May 2001 16:55:20 PDT." <20010514165520.1f0ee839.chip@wiegand.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105151939.f4FJdl548367>
