broken dhclient-script in TIMEOUT case

David Xu davidxu at freebsd.org
Fri Sep 23 21:49:49 PDT 2005


It seems script /sbin/dhclient-script is broken in TIMEOUT case.
first, the command parameter is wrong for our ping program, it
passes -w parameter to ping, but our ping can only accept -t,

   if ping -q -c 1 -w 1 "$1"; then

second, the statement:
  eval "ifconfig $interface inet -alias $new_ip_address $medium"

immediately removes the address just configured, result is although
I have setup a lease section, but I can not set the static ip address
after dhcp server timeouts.

Patch is below:
-------------
timeout 5;
retry 60;
reboot 10;
select-timeout 5;
initial-interval 2;
#reject 192.33.137.209;
script "/sbin/dhclient-script";

interface "bge0" {
        send host-name "davidxu-t43.my.domain";
#       send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
        send dhcp-lease-time 3600;
#       supersede domain-name "netease.com";
        prepend domain-name-servers 127.0.0.1;
        request subnet-mask, broadcast-address, time-offset, routers,
                domain-name, domain-name-servers, host-name;
        require subnet-mask, domain-name-servers;
#       media "media 10baseT/UTP", "media 10base2/BNC";
}

lease {
        interface "bge0";
        fixed-address 192.168.1.16;
        option subnet-mask 255.255.255.0;
        option routers 192.168.1.6;
        renew 0 2006/1/1 12:00:00;
        rebind 0 2006/1/1 12:15:00;
        expire 0 2006/1/1 12:30:00;
}
---------------
my sample dhclient.conf:
timeout 5;
retry 60;
reboot 10;
select-timeout 5;
initial-interval 2;
#reject 192.33.137.209;
script "/sbin/dhclient-script";

interface "bge0" {
    send host-name "davidxu-t43.my.domain";
#    send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
    send dhcp-lease-time 3600;
#    supersede domain-name "netease.com";
    prepend domain-name-servers 127.0.0.1;
    request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, host-name;
    require subnet-mask, domain-name-servers;
#    media "media 10baseT/UTP", "media 10base2/BNC";
}

lease {
    interface "bge0";
    fixed-address 192.168.1.16;
    option subnet-mask 255.255.255.0;
    option routers 192.168.1.6;
    renew 0 2006/1/1 12:00:00;
    rebind 0 2006/1/1 12:15:00;
    expire 0 2006/1/1 12:30:00;
}



More information about the freebsd-current mailing list