DHCP 租用时间(DHCP lease time)是一项设置,用于控制 Windows 10 计算机以及智能手机或打印机等其他设备保留其动态分配的 IP 地址的时间。您想知道如何更改DHCP 租用时间(DHCP lease time),如何检查您的租用时间,或者如何更新您的网络适配器(network adapter)的DHCP 租用时间(DHCP lease time)?如果您对这些问题中的任何一个说“是”,请继续阅读并找到答案:
注意:(NOTE:)在阅读本指南之前,您应该了解什么是 IP 地址以及它们的作用。如果您对它们不清楚,请先阅读这篇文章:什么是 IP 地址、子网掩码,以及如何在Windows中更改它们?
DHCP 租用时间是多少?
连接到局域网(area network)( LAN )的计算机、笔记本电脑、智能手机、打印机和其他类似设备必须具有IP 地址(IP address)才能相互通信以及连接到 Internet。
如果您的网络使用DHCP(动态主机配置协议(Dynamic Host Configuration Protocol))自动分配 IP 地址,它们不会永久分配给您的设备。相反,DHCP仅在固定时间段内临时指定 IP 地址,具体取决于其配置方式。
DHCP 租用时间(DHCP lease time)表示从您的计算机或设备从路由器获得其 IP 地址到到期时间之间的时间(time between when your computer or device obtained its IP address from the router and the time when it expires)段。当DHCP 租用时间(DHCP lease time)到期时,您的计算机或设备(computer or device)会自动释放其IP 地址(IP address)并要求路由器为其提供新的 IP 地址。
动态主机配置协议 (DHCP)(Dynamic Host Configuration Protocol (DHCP))是在您的路由器上运行的一项服务,而不是在您的 Windows 10 计算机上,因此除非您访问路由器的配置界面,否则您无法更改 DHCP 租用时间(you cannot change the DHCP lease time unless you access your router's configuration interface)。阅读本指南的最后一部分,了解如何操作。但是,在您的 Windows 10 计算机上,您可以查看和续订 DHCP 租用时间(on your Windows 10 computer, you can both see and renew the DHCP lease time),如本文接下来两节所述。
如何查看Windows 10 PC的DHCP 租用(DHCP lease)时间
要查看 Windows 10 PC 上的DHCP 租用时间(DHCP lease time),请首先打开命令提示符(Command Prompt)或启动PowerShell。然后,运行命令ipconfig /all。
ipconfig /all网络适配器(network adapter)的详细信息,包括Wi-Fi 和以太网适配器(Wi-Fi and Ethernet adapters)。找到用于连接到本地network and/orInternet 的那个。例如,我们为此使用 Wi-Fi网络适配器(network adapter)。浏览您的适配器的详细信息,您应该会找到两个文本行,分别称为Lease Gained(Lease Obtained)和Lease Expires,然后是一些日期和时间,如下面的屏幕截图所示。
获得的租约(Lease Obtained)告诉您DHCP 租用时间(DHCP lease time)的开始时间。换句话说,它会告诉您 Windows 10计算机或设备何时使用(computer or device)DHCP从路由器获取其IP 地址(IP address)。
Lease Expires会告诉您 Windows 10 PC 或设备(PC or device)何时必须释放其当前IP 地址(IP address)并要求路由器提供新 IP 地址。
暂时不要关闭命令提示符(Command Prompt)或PowerShell:阅读下一部分以了解如何续订 Windows 10 PC 的DHCP 租用时间(DHCP lease time)。
如何更新Windows 10 PC的DHCP 租用(DHCP lease)时间
接下来,如果要更新 Windows 10 PC 的DHCP 租用时间,请在(DHCP lease time)命令提示符(Command Prompt)或PowerShell中运行以下命令:ipconfig /release | ipconfig /renew。
等待(Wait)命令完成它的工作,当它完成时,它应该显示一些关于你的网络适配器的信息。现在再次运行ipconfig /all检查您的网络适配器(network adapter)的Lease Gained(Lease Obtained)和Lease Expires文本行,您应该会看到它们都已更新。
现在,让我们看看如何将DHCP 租用时间(DHCP lease time)设置为您想要的任何时间:
注意:(NOTE:)为了说明接下来的步骤,我们使用ASUS ZenWiFi AX ( XT8 )。根据您的路由器制造商和型号(router maker and model),设置的视觉效果和名称可能与我们的不同。但是,它们应该相似,因此您应该能够找到自己的方式。
如何在Windows 10中更改(Windows 10)DHCP 租用(DHCP lease)时间
您可能已经从之前的屏幕截图中注意到,我们的DHCP 租用时间(DHCP lease time)设置为 24 小时。但是,其他路由器或网络设备可以使用不同的(network equipment)DHCP 租用时间(DHCP lease time)默认值,例如 8 小时或 12 小时。为了能够更改DHCP 租用时间(DHCP lease time),您需要调整路由器的DHCP设置。
首先(Start)在 Windows 10计算机或设备(computer or device)上打开Web 浏览器(web browser)。然后,输入路由器的地址。在大多数路由器上,这是 192.168.0.1 或 192.168.1.1,但它可能会有所不同。如果您不知道路由器的IP 地址(IP address),请查看本指南:查找无线路由器本地(wireless router)IP 地址(IP address)的5 种方法。输入路由器的管理员凭据并登录(router and sign)。
在路由器的 Web 界面上,查找名为LAN的高级设置类别,然后访问它。
在路由器的LAN配置页面上,选择DHCP 服务器(DHCP Server)选项卡(或部分)。
在DHCP 服务器(DHCP Server)设置中,查找名为Lease time的选项。这是您一直在寻找的路由器的DHCP 租用时间。(DHCP lease time)请注意,DHCP 租用时间(DHCP lease time)通常以秒为单位指定,而不是分钟、小时或天。正如您在下一个屏幕截图中看到的,我们路由器的DHCP 租用时间(DHCP lease time)设置为 86400 秒,相当于 24 小时或一天。
如果要更改路由器的DHCP 租用时间(DHCP lease time),请键入所需时间(以秒为单位)。例如,如果要将DHCP 租用时间(DHCP lease time)更改为一周而不是一天,请将其设置为 604800(604800 秒 = 7 天)。
确保通过单击(Make sure)应用(Apply)、保存(Save)或确定(OK)来保存新设置。请注意,当您这样做时,您的路由器可能需要重新启动以设置新的DHCP 租用时间(DHCP lease time)。
为什么要更改DHCP 租用(DHCP lease)时间?
是因为您的DHCP 租用时间(DHCP lease time)太短而破坏了您的下载或游戏会话吗?你(Did)还有其他原因吗?我们想知道你为什么要这样做,所以不要犹豫,在下面发表评论。
How to change the DHCP lease time in Windows 10
The DHCP lease time is a setting that controls how long your Windows 10 computers, as well as other devices such as smartphones or printers, keep their dynamically allocated IP addresses. Do you want to know how to change the DHCP lease time, how to check what yours is, or maybe how to renew your network adapter's DHCP lease time? If you said yes to any of these questions, read on and find the answers:
NOTE: Before you read this guide, you should have a grasp of what IP addresses are, and what they do. If you're unclear about them, read this article first: What are IP addresses, subnet masks, and how do you change them in Windows?
What is the DHCP lease time?
Computers, laptops, smartphones, printers, and other similar devices that are connected to a local area network (LAN) must have an IP address in order to be able to communicate with each other, as well as connect to the internet.
If your network uses the DHCP (Dynamic Host Configuration Protocol) to assign the IP addresses automatically, they are not assigned to your devices permanently. Instead, DHCP designates the IP addresses only temporarily for fixed periods of time, depending on how it's configured.
The DHCP lease time represents the period of time between when your computer or device obtained its IP address from the router and the time when it expires. When the DHCP lease time expires, your computer or device automatically releases its IP address and asks the router to give it a new one.
The Dynamic Host Configuration Protocol (DHCP) is a service that runs on your router, not on your Windows 10 computer, so you cannot change the DHCP lease time unless you access your router's configuration interface. Read the last section of this guide to see how. However, on your Windows 10 computer, you can both see and renew the DHCP lease time, as explained in the next two sections of this article.
How to see the DHCP lease time of a Windows 10 PC
To find what your DHCP lease time is on your Windows 10 PC, first open the Command Prompt or start PowerShell. Then, run the command ipconfig /all.
The ipconfig /all command shows you detailed information about all the network adapters installed on your Windows 10 PC, including both Wi-Fi and Ethernet adapters. Locate the one that you use to connect to your local network and/or to the internet. For example, we use a Wi-Fi network adapter for that. Go through your adapter's details, and you should find two text lines called Lease Obtained and Lease Expires, followed by some dates and times, just like in the screenshot below.
Lease Obtained tells you when the DHCP lease time began. In other words, it tells you when your Windows 10 computer or device got its IP address from the router using DHCP.
Lease Expires tells you when your Windows 10 PC or device must release its current IP address and ask the router for a new one.
Don't close Command Prompt or PowerShell just yet: read the next section to see how to renew the DHCP lease time of your Windows 10 PC.
How to renew the DHCP lease time of a Windows 10 PC
Next, if you want to renew the DHCP lease time of your Windows 10 PC, run the following command in Command Prompt or PowerShell: ipconfig /release | ipconfig /renew.
Wait for the command to do its job and, when it finishes, it should display some information about your network adapters. Now run the ipconfig /all command once more. Check your network adapter's Lease Obtained and Lease Expires text lines, and you should see that they have both been updated.
Now, let's see how to set the DHCP lease time to anything you want:
NOTE: To illustrate the next steps, we're using ASUS ZenWiFi AX (XT8). Depending on your router maker and model, the visuals and names of settings are likely not the same as ours. However, they should be similar, so you should be able to find your way.
How to change the DHCP lease time in Windows 10
As you've probably noticed from the previous screenshots, our DHCP lease time is set to 24 hours. However, other routers or network equipment can use different default values for the DHCP lease time, like 8 hours or 12 hours. To be able to change the DHCP lease time, you need to adjust the DHCP settings of your router.
Start by opening a web browser on your Windows 10 computer or device. Then, type the address of your router. On most routers out there, that's 192.168.0.1 or 192.168.1.1, but it can differ. If you don't know the IP address of your router, check this guide: 5 ways to find the local IP address of your wireless router. Enter the admin credentials of your router and sign in.
On your router's web interface, look for an advanced settings category called LAN, and access it.
On the router's LAN configuration page, select the DHCP Server tab (or section).
In the DHCP Server settings, look for an option called Lease time. This is the router's DHCP lease time that you've been searching for. Note that the DHCP lease time is usually specified in seconds, rather than minutes, hours, or days. As you can see in the next screenshot, our router's DHCP lease time is set to 86400 seconds, the equivalent of 24 hours or one day.
If you want to change the DHCP lease time of your router, type the time you want in seconds. For example, if you want to change the DHCP lease time to a week instead of a day, set it to 604800 (604800 seconds = 7 days).
Make sure to save your new settings by clicking Apply, Save, or OK. Note that, when you do that, your router might need to reboot to set the new DHCP lease time into motion.
Why did you want to change the DHCP lease time?
Was it because your DHCP lease time was too short and it broke your downloads or gaming sessions? Did you have other reasons? We'd like to know why you want to do that, so don't hesitate to comment below.