I would appreciate it if any Dachstein users using dhclient would do
the following experiment and tell us the result. I guess I would be
equally interested in pre-Dachstein LEAF versions of dhclient, or
other leaf users with dhclient.lrp similar to Charles'.
In the file /etc/dhclient-exit-hooks, add the lines just before the
comment #Reload networking to see new address:
#Begin instrumentation
date >> /var/log/dhclient.txt
echo old_ip_address = $old_ip_address >> /var/log/dhclient.txt
echo new_ip_address = $new_ip_address >> /var/log/dhclient.txt
echo reason = $reason >> /var/log/dhclient.txt
#End instrumentation
See below where to add the lines.
Then after the lease is renewed, or at least that particular code
executes, post to the list the results. In my case I get this:
Mon Feb 18 16:24:52 UTC 2002
old_ip_address =
new_ip_address = 208.191.181.169
reason = BOUND
The variable old_ip_address never has a value.
I would like to know if other users's dhclient behaves like mine.
Thanks,
Tim Wegner
My instrumented copy of /etc/dhclient-exit-hooks, so you can see
where the lines go:
#!/bin/sh
# dhclient-exit-hooks script for LRP
# Charles Steinkuehler, January 2000
# Updated June 27, 2000 to restart dnscache, if present
# Notes:
# 0. This script restarts the following when a new address is aquired
# a: Firewall filter rules
reload_all() {
svi network ipfilter reload
}
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
# If our IP address changed, or we just got a new address,
# restart the IP filters, using the new address
if [ x$old_ip_address = x ] || [ x$old_ip_address !=
x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
#Begin instrumentation
date >> /var/log/dhclient.txt
echo old_ip_address = $old_ip_address >> /var/log/dhclient.txt
echo new_ip_address = $new_ip_address >> /var/log/dhclient.txt
echo reason = $reason >> /var/log/dhclient.txt
#End instrumentation
# Reload networking to see new address
reload_all
fi
fi
if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
# No dhcp lease - Shutdown packet forwarding
/etc/init.d/network ipfilter flush
fi
if [ x$reason = xTIMEOUT ]; then
if [ x$timeout_using_old_lease = xTRUE ]; then
# Succsfully using an old lease, even though we can't talk to the
# dhcp server, so reload network to configure with 'new' address
reload_all
else
# Couldn't find the dhcp server, and can't ping the last default
router
# so let's just give up and stop forwarding packets
/etc/init.d/network ipfilter flush
fi
fi
_______________________________________________
Leaf-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user