dhclient ant policy based routing

richard lucassen mailinglists at lucassen.org
Fri Jan 24 08:44:16 UTC 2014

On Thu, 23 Jan 2014 13:08:01 -0800
"Kalnozols, Andris" <andris at hpl.hp.com> wrote:

> I'm in the midst of writing a single hook script to perform dynamic
> DNS updates and discovered that is insufficient to rely solely on the
> "$reason" variable.  To generalize, the "BOUND|RENEW|REBIND|REBOOT"
> is important to the dhclient-exit-hooks context; the client's
> "$interface" is operational with the "$new_*" DHCP variables.
> Conversely, "RELEASE|EXPIRE|FAIL|STOP" is important in the
> dhclient-enter-hooks context because the client's "$interface"
> may be about to stop using the "$old_*" DHCP variables.  Again,
> this is a broad generalization.
> Here is a Bash function that can be used to determine if your
> script has been sourced in the "enter" context or the "exit"
> context.

Ok, I already found out that the ip address was not assigned yet at the
"enter-hooks", that's why I added the rules at the "exit-hooks". I
added the "clear rules" to the "enter-hooks", but I was wondering if
the selected $reason's are ok for adding rules:


but OTOH, are these selectors ok for clearing the rules?:


STOP, RELEASE and EXPIRE seem to be ok to me, but should I clear the
rules upon a FAIL, NBI and a TIMEOUT as well?


It is better to remain silent and be thought a fool, than to speak
aloud and remove all doubt.

| Richard Lucassen, Utrecht                                        |

More information about the dhcp-users mailing list