DHClient覆盖更新时间
DHClient override renewal time
我的 ubuntu 机器从 DNS 服务器接收到 7000 秒的更新时间。我想通过 dhclient.conf 在 ubuntu 机器上将其更改为更长的时间。我无法更改 dhcp 服务器。
但是我尝试的所有示例似乎都不是正确的语法。例如,如果我在 .conf 的顶部添加以请求 6000 的租用时间,我不会得到任何改变。我也试过
min-lease-time infinite;
max-lease-time infinite;
作为全局变量。
#send host-name "andare.fugue.com";
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
send dhcp-lease-time 6000;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/etc/dhcp3/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;
任何想法,看起来应该很容易做到?
TIA
客户端文档says
option dhcp-lease-time uint32;
This option is used in a client request (DHCPDISCOVER or DHCPREQUEST)
to allow the client to request a lease time for the IP address. In a
server reply (DHCPOFFER), a DHCP server uses this option to specify
the lease time it is willing to offer.
在我的例子中,解决方案是添加 dhclient.conf
:
supersede dhcp-lease-time the_value_i_want;
这会覆盖服务器给定的租用时间。
顺便说一句,这里设置了到期时间,续订(T1)和重新绑定(T2)时间由客户端计算(大约是租用时间的 1/2 和 7/8)。
我从路由器设置中更改了租约期限
LAN 接口 -> DHCP 服务器 -> 租期
我的 ubuntu 机器从 DNS 服务器接收到 7000 秒的更新时间。我想通过 dhclient.conf 在 ubuntu 机器上将其更改为更长的时间。我无法更改 dhcp 服务器。
但是我尝试的所有示例似乎都不是正确的语法。例如,如果我在 .conf 的顶部添加以请求 6000 的租用时间,我不会得到任何改变。我也试过
min-lease-time infinite;
max-lease-time infinite;
作为全局变量。
#send host-name "andare.fugue.com";
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
send dhcp-lease-time 6000;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/etc/dhcp3/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;
任何想法,看起来应该很容易做到?
TIA
客户端文档says
option dhcp-lease-time uint32;
This option is used in a client request (DHCPDISCOVER or DHCPREQUEST) to allow the client to request a lease time for the IP address. In a server reply (DHCPOFFER), a DHCP server uses this option to specify the lease time it is willing to offer.
在我的例子中,解决方案是添加 dhclient.conf
:
supersede dhcp-lease-time the_value_i_want;
这会覆盖服务器给定的租用时间。
顺便说一句,这里设置了到期时间,续订(T1)和重新绑定(T2)时间由客户端计算(大约是租用时间的 1/2 和 7/8)。
我从路由器设置中更改了租约期限
LAN 接口 -> DHCP 服务器 -> 租期