[Freebsd] 查看dhcp客戶端

URL Link //n.sfs.tw/11079

2017-05-16 00:26:44 By 張○○

1. 重取 DHCP 租約

dhclient <介面名稱>

# dhclient bge1

2. 查看目前租約

# cat /var/db/dhclient.leases.if_name

lease {

  interface "bge1";

  fixed-address 123.110.1.2;

  option subnet-mask 255.255.255.0;

  option routers 123.110.1.254;

  option domain-name-servers 211.78.130.3,8.8.8.8,168.95.1.1;

  option log-servers 210.202.63.230;

  option domain-name "example.net.tw";

  option dhcp-lease-time 86400;

  option dhcp-message-type 5;

  option dhcp-server-identifier 10.10.0.33;

  option dhcp-renewal-time 43200;

  option dhcp-rebinding-time 75600;

  renew 3 2013/5/8 23:27:19;

  rebind 4 2013/5/9 08:27:19;

  expire 4 2013/5/9 11:27:19;

}

說明[2]
  如有多個lease{} 以最後的為準
  14-16行 格式為 週(0sunday-6saturday) 年/月/日 時:分:秒
  14行 T1,50%租約,unicast
  15行 T2,85%租約,broadcast,請見[3]

3. 釋放目前租約

# dhclient -r if_name

參考資料

[1] DHCP Terminology http://www.onlamp.com/pub/a/bsd/2003/04/17/FreeBSD_Basics.html?page=2

[2] DHCP Lease Renewal and Rebinding Processes

FIGURE from http://www.tcpipguide.com/free/t_DHCPLeaseRenewalandRebindingProcesses-2.htm


原文 2013-05-08 19:12:33