Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/695f6baf-a8c0-8011-ab6c-15ca5129ef57
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===== 表現方式 ===== * GUI 可能顯示: - 86400 days - 或換算成「數十年」 * 封包裡: ``<code>text Option 51 (IP Address Lease Time): 0xFFFFFFFF <syntaxhighlight> ===== 為什麼? ===== dnsmasq 對「無限」的標準做法就是: </syntaxhighlight>c lease_time = UINT32_MAX; <syntaxhighlight> ➡ 和 TP-Link 本質一模一樣。 ==== NETGEAR ==== ===== 家用 / SOHO 路由器 ===== * GUI 常寫: - Never - 或 Forever ===== 實際送出的 DHCP ===== * 還是 最大秒數 </syntaxhighlight> 4294967295 秒 ≈ 136 年 <syntaxhighlight> ===== 為什麼不用 0? ===== 因為: * DHCP 規範中 0 不是「永久」 * 有些 client 會直接判定為錯誤 ==== CISCO(這裡要分清楚) ==== ===== Cisco IOS / IOS-XE(企業設備) ===== CLI: </syntaxhighlight>text ip dhcp pool LAN lease infinite <syntaxhighlight> ===== 實際 DHCP 封包 ===== * 不是魔法 * 還是: </syntaxhighlight>text Option 51: 0xFFFFFFFF <syntaxhighlight> Cisco 只是把這件事包裝成「infinite」這個關鍵字。 ==== D-LINK ==== ===== 家用路由器 ===== * 介面常顯示: - 36500 天 - 或非常大的年數 ===== 封包層級 ===== * 幾乎清一色: </syntaxhighlight> 2³²−1 秒 <syntaxhighlight> ===== 舊型韌體 ===== * 偶爾用: - 100 年 - 50 年 * 但新韌體已幾乎統一用最大值 ==== ZYXEL ==== ===== 家用 / 中小企業設備 ===== * GUI 有時會寫: - 36500 days - 或「Permanent」 ===== 實際實作 ===== * 兩種常見: 1. 直接 </code>0xFFFFFFFF<code> 2. 內部寫死「100 年」,再轉秒數(仍在 32-bit 安全範圍內) ➡ 結果對 client 來說 完全一樣 ==== HUAWEI(差異最大的一家) ==== ===== Enterprise(路由器 / 防火牆 / OLT) ===== * CLI: </syntaxhighlight>text lease infinite <syntaxhighlight>- 實際封包: </syntaxhighlight> 0xFFFFFFFF <syntaxhighlight> ===== 家用 CPE / 光世代數據機 ===== * 常見值: - 10 年 - 20 年 - 50 年 - 或 136 年 原因是: * 某些 ISP 有內部政策 * 避免「永久」在管理系統裡看起來怪怪的 ==== 為什麼大家都用同一個數值? ==== ===== 因為 DHCP 規範 沒有「∞」 ===== RFC 2131 只定義: * 租期 = 秒數(uint32) * 沒有「永久」這種型別 ===== 所以業界約定俗成: ===== </syntaxhighlight>text ∞ = UINT32_MAX = 0xFFFFFFFF </code>`` 這不是 TP-Link 發明的,是 整個網路業界的默契。
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)