你有没有想过如何在Windows 10中更改(Windows 10)IP 地址(IP address)?您想了解如何从Windows 10的设置(Settings)应用程序或控制面板(Control Panel)中进行操作吗?也许您是命令行迷,想了解如何使用CMD(命令提示符)(CMD (Command Prompt))或PowerShell在Windows 10中更改(Windows 10)IP 地址(IP address)?继续阅读并了解所有这些在Windows 10中是如何完成的:
注意:(NOTE:)为了能够在Windows 10中更改您的(Windows 10)IP 地址(IP address),您必须使用管理员帐户(administrator account)登录到Windows 10。此外,在学习如何更改您的IP 地址(IP address)之前,最好先知道IP 地址(IP address)和子网掩码(es and subnet masks)是什么,如何找到您的 IP,以及如何找到您的路由器的IP 地址(IP address)。
1. 如何在Windows 10中更改(Windows 10)IP 地址(IP address),使用设置应用程序(Settings app)
因为它依赖于操作系统(operating system)的可视化界面,所以这可能是更改Windows 10计算机或设备(computer or device)IP 地址(IP address)的最简单方法。这是您需要做的:
打开“设置”应用程序(Settings app):一种快速的方法是从“开始”菜单中按下“(Start Menu)设置”(Settings)按钮或同时按键盘上的Windows + I在“设置”(Settings)应用中,打开“网络和 Internet(Network & Internet) ”类别。
在左侧边栏(left sidebar)上,选择您的网络类型(network type)。如果您使用无线网卡连接到互联网(或局域网) ,请选择(area network)Wi-Fi。如果您使用有线连接访问互联网(或LAN ),请单击或点击(click or tap)以太网(Ethernet)。
在窗口的右侧,单击或点击(click or tap)您的网络连接(network connection)名称。
(Scroll)在网络连接详细信息页面上向下(network connection)滚动,直到找到名为IP 设置(IP settings)的部分。然后,单击或点击IP assignment下的Edit。
设置(Settings)应用程序现在显示“编辑 IP 设置”("Edit IP settings")对话框。您可以在此处更改计算机或设备的(computer or device)IP 地址(IP address)。如果您希望路由器自动分配 Windows 10 PC 的IP 地址(IP address),请选择自动 (DHCP)(Automatic (DHCP))。这也称为动态IP 地址(IP address)。
如果您想设置自己的静态 IP 地址(static IP address),请选择手动(Manual),然后启用IPv4和/或IPv6开关,具体取决于您要使用的互联网协议。请注意,它们中的每一个都有自己不同的IP 地址(IP address),因此如果您选择启用两者,则必须输入IPv4和IPv6所需的详细信息。(IPv6)
要将您的IP 地址(IP address)更改为静态地址,无论您是为IPv4还是IPv6协议设置它,您都必须输入以下详细信息:
-
IP 地址:(IP address:)键入要使用的静态IP 地址。(IP address)例如,我们要将Windows 10 PC的IP 地址(IP address)( IPv4 )更改为 192.168.50.10。
-
子网前缀长度:(Subnet prefix length:)键入确定子网大小的前缀长度。(prefix length)例如,我们将路由器配置为使用255.255.255.0 的子网掩码(subnet mask),这意味着我们必须输入 24 的“子网前缀长度”("Subnet prefix length")(网络掩码中 1 的位数)。如果我们的子网掩码为 255.255.0.0,则前缀长度(prefix length)为 16,依此类推。您可以在此处找到有关子网的更多详细信息:什么是 IP 地址、子网掩码以及如何在Windows中更改它们?
-
网关:(Gateway:)输入路由器的IP 地址(IP address)。在我们的例子中,它是 192.168.50.1。
首选 DNS(Preferred DNS)和备用 DNS(Alternate DNS)设置不是强制性的- 如果您将它们留空,它们将由您的路由器自动分配。但是,如果(How)您也想更改它们,您可以这样做(更多详细信息:什么是DNS?它有(How)什么用处?)。
输入所有详细信息后,单击或点击(click or tap)保存(Save),以便Windows 10更改您的IP 地址(IP address)。
注意:(NOTE:)如果您选择使用静态IP 地址(IP address),请确保您输入的所有详细信息都是正确的;否则,您的 Windows 10 PC 将失去互联网连接。如果发生这种情况,请将您的IP 地址(IP address)更改回自动 (DHCP)(Automatic (DHCP)),以便您的路由器可以将其更改为可以使用的东西。
2. 如何在Windows 10中更改(Windows 10)IP 地址(IP address),使用控制面板(Control Panel)
在Windows 10中,您还可以从控制面板更改您的(Control Panel)IP 地址(IP address)。打开控制面板,然后单击(Control Panel and click)或点击“网络和 Internet("Network and Internet.") ”下的“查看网络状态和任务” 。("View network status and tasks")
在网络和共享中心,从(Network and Sharing Center)“查看您的活动网络”("View your active networks")区域单击或点击您的互联网连接。
在网络的状态(Status)窗口中,单击或点击属性(Properties)。
在“属性(Properties)”窗口中,选择Internet Protocol Version 4 (TCP/IPv4)或Internet Protocol Version 6 (TCP/IPv6),具体取决于您要更改的IP 地址。(IP address)如果您想同时更改两者,请对它们中的每一个重复接下来的步骤。
单击或点击属性(Properties)。
Internet Protocol Version 4 (TCP/IPv4) Properties或Internet Protocol Version 6 (TCP/IPv6) Properties的窗口,具体取决于您之前选择的内容。在这里您可以更改您的IP 地址(IP address):
如果要使用路由器自动分配给 Windows 10 PC 的动态IP 地址(IP address),请选择“自动获取 IP 地址”。("Obtain an IP address automatically.")然后,单击或点击确定(OK)并关闭您打开的所有窗口。
如果要为网络适配器设置静态(network adapter)IP 地址(IP address),请选择“使用以下 IP 地址”。("Use the following IP address.")然后,手动输入所需的详细信息:IP 地址、子网掩码(IP address, Subnet mask)和默认网关(Default gateway),就像我们在本指南中的上一个方法中向您展示的那样。
单击或点击OK保存新的IP 地址(IP address)设置,然后关闭您在此过程中打开的所有窗口。
3. 如何在Windows 10中更改(Windows 10)IP 地址(IP address),使用PowerShell 或命令提示符(PowerShell or Command Prompt)(cmd)
如果您更喜欢使用命令行环境,还可以使用PowerShell 或命令提示符更改(PowerShell or Command Prompt)Windows 10中的IP 地址(IP address)。不管(Regardless)你最喜欢的控制台是什么,运行netsh interface ip show config命令。在显示的结果中,确定要更改IP 地址的(IP address)网络适配器(network adapter)。例如,我们的网络接口(network interface)名称是Wi-Fi,如下面的截图所示。
如果要将IP 地址(IP address)更改为路由器通过DHCP自动分配的动态地址,请运行以下命令:netsh interface ip set address "Network Interface Name" dhcp。将“网络接口名称”("Network Interface Name")替换为您的网络连接(network connection)名称。例如,我们需要运行netsh interface ip set address "Wi-Fi" dhcp。
如果要设置静态IP 地址(IP address),请运行以下命令:netsh interface ip set address name= "Network Interface Name" static [IP address] [Subnet Mask] [Gateway]。将[IP address] [Subnet Mask] [Gateway]替换为与您的([IP address] [Subnet Mask] [Gateway])网络配置(network configuration)匹配的那些。在我们的示例中,如果我们想将IP 地址(IP address)更改为 192.168.50.10,我们必须运行netsh interface ip set address name="Wi-Fi" static 192.168.50.10 255.255.255.0 192.168.50.1。
而已!
您最喜欢在Windows 10中更改(Windows 10)IP 地址(IP address)的方法是什么?
现在您知道的不仅仅是一种而是三种不同的方法来更改您的IP 地址(IP address)并将其设置为动态或静态。你最喜欢的做法是什么?你还知道其他方法吗?如果你这样做了,或者你有什么要添加到本指南中,请不要犹豫发表评论。
3 ways to change the IP address in Windows 10
Have you ever wondered how you can chаnge the IP address in Windows 10? Do you want to learn how to do it from Windows 10's Settings app or the Control Panel? Maybe you're a command-line fan, and want to learn how to change the IP address in Windows 10 using CMD (Command Prompt) or PowerShell? Read on and find out how all of these are done in Windows 10:
NOTE: To be able to change your IP address in Windows 10, you must log in to Windows 10 using an administrator account. Also, before learning how to change your IP address, it would be best if you already knew what IP addresses and subnet masks are, how to find what your IP is, and how to find the IP address of your router.
1. How to change the IP address in Windows 10, using the Settings app
Because it relies on the visual interface of the operating system, this is probably the easiest method for changing the IP address of your Windows 10 computer or device. Here's what you need to do:
Open the Settings app: a quick way to do it is to push the Settings button from the Start Menu or to press Windows + I on your keyboard simultaneously. In the Settings app, open the Network & Internet category.
On the left sidebar, select your network type. If you connect to the internet (or local area network) using a wireless card, select Wi-Fi. If you're accessing the internet (or LAN) using a wired connection, click or tap on Ethernet.
On the right side of the window, click or tap on the name of your network connection.
Scroll down on your network connection details page until you find the section called IP settings. Then, click or tap on Edit, under IP assignment.
The Settings app now shows the "Edit IP settings" dialog. This is where you can change the IP address of your computer or device. If you want the IP address of your Windows 10 PC to be assigned automatically by your router, select Automatic (DHCP). This is also called a dynamic IP address.
If you want to set your own static IP address, select Manual and then enable the IPv4 and/or IPv6 switches, depending on what internet protocols you want to use. Note that each of them has its own distinct IP address, so you must enter the required details for both IPv4 and IPv6 if you choose to enable both.
To change your IP address to a static one, regardless of whether you set it for your IPv4 or IPv6 protocols, you have to enter the following details:
-
IP address: type the static IP address that you want to use. For example, we want to change the IP address (IPv4) of our Windows 10 PC to 192.168.50.10.
-
Subnet prefix length: type the prefix length that determines the size of the subnet. For example, we configured our router to use a subnet mask of 255.255.255.0, which means that we have to enter a "Subnet prefix length" of 24 (the number of 1 bits in the netmask). If we would've had a subnet mask of 255.255.0.0, the prefix length would have been 16, and so on. You can find more details about subnets here: What are IP addresses, subnet masks, and how do you change them in Windows?.
-
Gateway: type the IP address of your router. In our case, that's 192.168.50.1.
The Preferred DNS and Alternate DNS settings are not mandatory - if you leave them blank, they are automatically assigned by your router. However, if you want to change them too, you can do so (more details here: What is DNS? How is it useful?).
Once you've entered all the details, click or tap on Save so that your IP address is changed by Windows 10.
NOTE: If you choose to use a static IP address, make sure that all the details you enter are right; otherwise, your Windows 10 PC loses internet connectivity. If that happens, change your IP address back to Automatic (DHCP) so that your router can change it to something that works.
2. How to change the IP address in Windows 10, using the Control Panel
In Windows 10, you can also change your IP address from the Control Panel. Open the Control Panel and click or tap on "View network status and tasks" under "Network and Internet."
In the Network and Sharing Center, click or tap on your internet connection from the "View your active networks" area.
In your network's Status window, click or tap on Properties.
In the Properties window, select Internet Protocol Version 4 (TCP/IPv4) or Internet Protocol Version 6 (TCP/IPv6), depending on the IP address that you want to change. If you want to change both, repeat the next steps for each of them.
Click or tap on Properties.
The previous action opens a window called Internet Protocol Version 4 (TCP/IPv4) Properties or Internet Protocol Version 6 (TCP/IPv6) Properties, depending on what you chose earlier. This is where you can change your IP address:
If you want to use a dynamic IP address that's automatically assigned to your Windows 10 PC by your router, select "Obtain an IP address automatically." Then, click or tap on OK and close all the windows you've opened.
If you want to set a static IP address for your network adapter, select "Use the following IP address." Then, enter the required details manually: IP address, Subnet mask, and Default gateway, just like we've shown you in the previous method from this guide.
Save your new IP address settings by clicking or tapping on OK, then close all the windows you've opened during the process.
3. How to change the IP address in Windows 10, using PowerShell or Command Prompt (cmd)
If you prefer using a command-line environment, you can also change the IP address in Windows 10 using PowerShell or Command Prompt. Regardless of what your favorite console is, run the netsh interface ip show config command. In the results that are displayed, identify the network adapter for which you want to change the IP address. For example, the name of our network interface is Wi-Fi, as you can see in the screenshot below.
If you want to change the IP address to a dynamic one that's automatically assigned by your router via DHCP, run the following command: netsh interface ip set address "Network Interface Name" dhcp. Replace "Network Interface Name" with the name of your network connection. For example, we need to run netsh interface ip set address "Wi-Fi" dhcp.
If you want to set a static IP address, run this command: netsh interface ip set address name= "Network Interface Name" static [IP address] [Subnet Mask] [Gateway]. Replace [IP address] [Subnet Mask] [Gateway] with the ones that match your network configuration. In our example, if we'd want to change our IP address to 192.168.50.10, we'd have to run netsh interface ip set address name="Wi-Fi" static 192.168.50.10 255.255.255.0 192.168.50.1.
That's it!
What is your favorite method to change the IP address in Windows 10?
Now you know not just one but three different methods to change your IP address and set it to dynamic or static. What's your favorite way of doing it? Do you know other methods too? If you do, or if you have something to add to this guide, don't hesitate to comment.