Date: Mon, 27 Sep 1999 17:54:35 -0700 (PDT) From: Doug <Doug@gorean.org> To: Michael9 <mfq@carolina.rr.com> Cc: freebsd-questions@freebsd.org Subject: Re: dhclient (was: Network Interface Trouble.) Message-ID: <Pine.BSF.4.10.9909271751280.10952-200000@dt014n8c.san.rr.com> In-Reply-To: <Pine.BSF.4.10.9909272020260.550-100000@gwazi.quigley.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Mon, 27 Sep 1999, Michael9 wrote:
> The reason for the kernel messages was an incorrect route. The route was
> added by the /sbin/dhclient-script script, which is invoked from dhclient.
> Apparently dhclient-script tries to be smart and add a bunch of static
> routes.
The attached diff should help. I'm working on a more complete and
freebsd-like replacement for the dhclient-script, but this version at
least fixes the particular problem you experienced, and has been well
tested by myself and others.
HTH,
Doug
--
"Stop it, I'm gettin' misty."
- Mel Gibson as Porter, "Payback"
[-- Attachment #2 --]
--- /usr/src/contrib/isc-dhcp/client/scripts/freebsd Sat Sep 4 15:34:53 1999
+++ /etc/dhclient-script Sun Aug 8 01:54:36 1999
@@ -1,10 +1,6 @@
#!/bin/sh
-if [ -x /usr/bin/logger ]; then
- LOGGER="/usr/bin/logger -s -p user.notice -t dhclient"
-else
- LOGGER=echo
-fi
+LOGGER="/usr/bin/logger -s -p user.notice -t dhclient"
make_resolv_conf() {
echo search $new_domain_name >/etc/resolv.conf
@@ -66,7 +62,7 @@
if [ x$reason = xPREINIT ]; then
if [ x$alias_ip_address != x ]; then
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
- route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+# route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
broadcast 255.255.255.255 up
@@ -83,18 +79,23 @@
if [ x$current_hostname = x ] || \
[ x$current_hostname = x$old_host_name ]; then
if [ x$new_host_name != x$old_host_name ]; then
- $LOGGER New Hostname: $new_host_name
- hostname $new_host_name
+ if [ x$new_domain_name != x ]; then
+ complete_hostname=$new_host_name.$new_domain_name
+ else
+ complete_hostname=$new_host_name
+ fi
+ $LOGGER New Hostname: $complete_hostname
+ hostname $complete_hostname
fi
fi
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
[ x$alias_ip_address != x$old_ip_address ]; then
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
- route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+# route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
ifconfig $interface inet -alias $old_ip_address $medium
- route delete $old_ip_address 127.1 >/dev/null 2>&1
+# route delete $old_ip_address 127.1 >/dev/null 2>&1
for router in $old_routers; do
route delete default $router >/dev/null 2>&1
done
@@ -111,8 +112,9 @@
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
ifconfig $interface inet $new_ip_address $new_netmask_arg \
$new_broadcast_arg $medium
- route add $new_ip_address 127.1 >/dev/null 2>&1
+# route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
+ $LOGGER New Default Router: $router
route add default $router >/dev/null 2>&1
done
if [ "$new_static_routes" != "" ]; then
@@ -127,7 +129,7 @@
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
then
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
- route add $alias_ip_address 127.0.0.1
+# route add $alias_ip_address 127.0.0.1
fi
echo search $new_domain_name >/etc/resolv.conf
for nameserver in $new_domain_name_servers; do
@@ -139,11 +141,11 @@
if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
if [ x$alias_ip_address != x ]; then
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
- route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+# route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
if [ x$old_ip_address != x ]; then
ifconfig $interface inet -alias $old_ip_address $medium
- route delete $old_ip_address 127.1 >/dev/null 2>&1
+# route delete $old_ip_address 127.1 >/dev/null 2>&1
for router in $old_routers; do
route delete default $router >/dev/null 2>&1
done
@@ -159,7 +161,7 @@
fi
if [ x$alias_ip_address != x ]; then
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
- route add $alias_ip_address 127.0.0.1
+# route add $alias_ip_address 127.0.0.1
fi
exit_with_hooks 0
fi
@@ -167,7 +169,7 @@
if [ x$reason = xTIMEOUT ]; then
if [ x$alias_ip_address != x ]; then
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
- route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+# route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
ifconfig $interface inet $new_ip_address $new_netmask_arg \
$new_broadcast_arg $medium
@@ -179,9 +181,9 @@
if [ x$new_ip_address != x$alias_ip_address ] && \
[ x$alias_ip_address != x ]; then
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
- route add $alias_ip_address 127.0.0.1
+# route add $alias_ip_address 127.0.0.1
fi
- route add $new_ip_address 127.1 >/dev/null 2>&1
+# route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router >/dev/null 2>&1
done
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9909271751280.10952-200000>
