通常,您的网络路由器(network router)会为您的设备(包括 Windows 10 和 11 电脑)分配一个动态IP 地址。(IP address)如果您需要 PC 的静态IP 地址(IP address),则需要配置路由器或更改计算机上的设置选项。
好消息是有多种方法可以为您的Windows PC分配静态(Windows PC)IP 地址(IP address)。根据您的感觉,您可以选择一种方法并继续使用它为您的机器获取一个固定的IP 地址(IP address)。
为什么使用静态 IP 地址?(Why Use a Static IP Address?)
您需要静态IP 地址(IP address)的原因有很多。您可以使用远程连接(use a remote connection)连接到您的 PC。在这种情况下,拥有永久IP 地址(IP address)可以更轻松地建立远程连接。
同样,如果您使用 PC 进行网络文件共享(use your PC for network file sharing),静态IP 地址(IP address)可确保您网络上的其他设备无需重新配置即可连接到您的 PC。
Assign a Static IP to Your Windows 11/10 PC Using Your Router
为您的 PC 获取静态 IP 的一种方法是配置您的路由器以将指定的IP 地址(IP address)分配给您的计算机。大多数路由器都提供此选项,但您配置路由器的方式因路由器型号(router model)而异。
通常,您将按照以下步骤在网络路由器(network router)上为您的 PC 配置静态 IP 。
查找网络适配器的 MAC 地址(Find Your Network Adapter’s MAC Address)
为了让您的路由器识别您的 PC 并为其分配一个特定的IP 地址(IP address),您需要在路由器的设置页面上输入您的网络适配器(在您的 PC 中)的唯一MAC 地址。(MAC address)
因此,让我们首先找到您的网络适配器(network adapter)的MAC 地址(MAC address):
- 打开开始(Start )菜单,搜索命令提示符(Command Prompt),然后在搜索结果中选择命令提示符。(Command Prompt)
- 在命令提示符窗口(Command Prompt window and press) 中键入以下命令,然后按Enter:
ipconfig /all
- 命令提示符(Command Prompt)将在屏幕上显示各种值。在此处找到您的网络适配器(network adapter)并查找物理地址(Physical Address)字段的值。那是您的适配器的唯一MAC 地址(MAC address)。记下这个地址。
配置您的路由器以将静态 IP 分配给您的 PC(Configure Your Router to Assign a Static IP to Your PC)
您现在需要访问路由器的设置(access your router’s settings)页面。对于大多数路由器,您可以通过在计算机的Web 浏览器中输入 192.168.1.1 (web browser)IP 地址(IP address)来执行此操作。如果这对您不起作用,请查阅路由器手册以了解如何访问设置页面。
- 在您的计算机上启动 Web 浏览器,键入以下IP 地址(IP address),然后按Enter。
192.168.1.1
- 您将看到路由器的登录页面。输入路由器的用户名和密码并继续。对于大多数路由器,您可以在用户名和密码字段中使用admin。
- 选择路由器设置页面顶部的网络设置。(Network Settings)
- 从左侧边栏中选择DHCP 客户端和地址保留。(DHCP Client & Address Reservation)
- (Enter)在右侧的IP 地址字段中(IP Address)输入您要分配给 PC的静态IP 地址。(IP address)
- 在MAC 地址(MAC Address)字段中输入您的网络适配器(network adapter)的唯一MAC 地址。(MAC address)然后,选择添加(Add ),然后选择页面底部的确定。(OK )
- 重启你的路由器。
当您的 Windows 11 或 10 PC 连接到您的路由器时,您的路由器会将指定的IP 地址(IP address)分配给您的 PC。每次将 PC 连接到路由器时都会发生这种情况。
为您的 Windows 10 PC 分配静态 IP(Assign a Static IP to Your Windows 10 PC)
如果您不想配置(t wish)路由器的设置,另一种为您的 Windows 10 PC 分配静态IP 地址(IP address)的方法是使用Windows 设置应用程序(Windows Settings app)。您可以在此应用程序中配置您的 IP 设置,以确保您的 PC 始终获得唯一的静态 IP。
但是,这种方法存在一个小问题。如果您的路由器已将您想要的 PC 的IP 地址(IP address)分配给另一台设备,您将在将 PC 连接到路由器时遇到问题。
要解决此问题,请尝试使用远远超出路由器分配的一般IP 地址(IP address)的IP 地址。(IP address)例如,如果您的路由器通常提供IP 地址(IP address),例如 192.168.1.10,则使用 192.168.1.20 作为您 PC 的静态 IP。
要继续使用此方法:
- 同时按Windows + I键打开 PC 上的设置应用程序。(Settings )
- 在设置窗口中选择网络和 Internet 。(Network & Internet)
- 向下滚动打开的状态(Status )页面并选择更改适配器选项(Change adapter options)。
- 您将看到网络适配器列表。右键单击(Right-click)用于网络的适配器,然后从菜单中选择“(network and select) 属性”。(Properties )
- 在列表中选择Internet Protocol Version 4 (TCP/IPv4)并选择Properties。
- 在以下窗口中启用使用以下 IP 地址选项。(Use the following IP address)
- 选择IP 地址( IP address)字段并键入您要分配给 PC的静态IP 地址。(IP address)
- 填写子网掩码(Subnet mask)字段,通常为255.255.255.0。在默认网关(Default gateway)字段中输入路由器的网关,通常是192.168.1.1 。
- 对于DNS服务器,您可以使用 Google 的Public DNS。要使用这些,请选择首选 DNS 服务器(Preferred DNS server)字段并输入8.8.8.8。选择备用 DNS 服务器(Alternate DNS server)字段并输入8.8.4.4。然后,选择OK。
- 选择Close(Close)关闭Properties窗口。
您的 Windows 10 PC 将与您的路由器断开连接,然后它会自动重新连接。重新连接后,您的 PC 现在应该有分配给它的指定静态IP 地址。(IP address)
为您的 Windows 11 PC 分配静态 IP(Assign a Static IP to Your Windows 11 PC)
与Windows 10一样,您可以使用Windows 设置应用程序(Windows Settings app)为您的 Windows 11 PC分配静态IP 地址。(IP address)
- 同时按Windows + I键以打开“设置”(Settings )应用。
- 从设置(Settings)的左侧边栏中选择网络和互联网(Network & internet)。
- 选择网络和互联网页面(Network & internet page)底部的高级网络设置(Advanced network settings)。
- 在列表中找到您的网络适配器(network adapter)并选择该适配器。然后,选择查看其他属性(View additional properties)。
- 选择IP 分配(IP assignment)旁边的编辑(Edit )。
- 从编辑 IP 设置(Edit IP settings)下拉菜单中选择手动。(Manual )然后,打开IPv4选项。
- 选择IP 地址( IP address)字段并键入要分配给您的 PC的静态IP 地址。(IP address)
- 选择子网掩码(Subnet mask)字段并输入255.255.255.0。在默认网关(Default gateway)字段中输入路由器的IP 地址(IP address),通常为192.168.1.1 。
- 在首选 DNS(Preferred DNS)字段中输入8.8.8.8 。在备用 DNS(Alternate DNS)字段中输入8.8.4.4 。
- 选择底部的保存。(Save )
现在,您的 Windows 11 PC 已分配了一个静态IP 地址。(IP address)将来,您的 PC 将继续从您的路由器获取此静态IP 地址(IP address),前提是您的路由器没有IP 冲突(IP conflict)问题。
How to Assign a Static IP Address to a Windows 11/10 PC
Usually, your network router assigns a dynamіc IP address to your devices, including your Windоws 10 and 11 PCs. If you need a static IP addresѕ for your PC, уou either need to configure your router or change a settings option on уour computer.
The good thing is there are multiple ways to assign a static IP address to your Windows PC. Depending on what you feel comfortable with, you can choose a method and proceed with it to acquire a fixed IP address for your machine.
Why Use a Static IP Address?
There are many reasons you need a static IP address. It’s possible you use a remote connection to connect to your PC. In this case, having a permanent IP address makes establishing the remote connection easier.
Similarly, if you use your PC for network file sharing, a static IP address ensures the other devices on your network can connect to your PC without any reconfigurations.
Assign a Static IP to Your Windows 11/10 PC Using Your Router
One way to get a static IP for your PC is by configuring your router to allocate a specified IP address to your machine. Most routers offer this option but how you configure the router is different for each router model.
Generally, you’d follow the following steps to configure a static IP for your PC on your network router.
Find Your Network Adapter’s MAC Address
For your router to identify your PC and assign it a specific IP address, you need to enter your network adapter’s (which is in your PC) unique MAC address on your router’s settings page.
So, let’s first find your network adapter’s MAC address:
- Open the Start menu, search for Command Prompt, and select Command Prompt in the search results.
- Type the following command in the Command Prompt window and press Enter:
ipconfig /all
- Command Prompt will display various values on your screen. Find your network adapter here and look for the Physical Address field’s value. That’s your adapter’s unique MAC address. Make a note of this address.
Configure Your Router to Assign a Static IP to Your PC
You now need to access your router’s settings page. For most routers, you can do this by entering the 192.168.1.1 IP address in a web browser on your computer. If this doesn’t work for you, consult your router’s manual to find out how to access the settings page.
- Launch a web browser on your computer, type the following IP address, and press Enter.
192.168.1.1
- You’ll see your router’s login page. Enter your router’s username and password and continue. For most routers, you can use admin in both username and password fields.
- Select Network Settings at the top of your router’s settings page.
- Choose DHCP Client & Address Reservation from the sidebar on the left.
- Enter the static IP address you’d like to assign to your PC in the IP Address field on the right.
- Type your network adapter’s unique MAC address in the MAC Address field. Then, select Add and then select OK at the bottom of the page.
- Restart your router.
When your Windows 11 or 10 PC connects to your router, your router will assign the specified IP address to your PC. This will happen each time you connect your PC to your router.
Assign a Static IP to Your Windows 10 PC
If you don’t wish to configure your router’s settings, the other way to assign a static IP address to your Windows 10 PC is by using the Windows Settings app. You can configure your IP settings in this app to ensure your PC always gets a unique static IP.
However, there’s a slight issue with this method. If your router has already assigned the IP address that you want for your PC to another device, you’ll experience issues connecting your PC to your router.
To get around this, try to use an IP address far beyond the general IP addresses that your router assigns. For example, if your router usually gives IP addresses up to, say, 192.168.1.10, then use 192.168.1.20 as the static IP for your PC.
To proceed with this method:
- Open the Settings app on your PC by pressing Windows + I keys at the same time.
- Select Network & Internet on the Settings window.
- Scroll down the Status page that opens and choose Change adapter options.
- You’ll see a list of your network adapters. Right-click the adapter that you use with your network and select Properties from the menu.
- Choose Internet Protocol Version 4 (TCP/IPv4) in the list and select Properties.
- Enable the Use the following IP address option on the following window.
- Select the IP address field and type the static IP address you’d like to assign to your PC.
- Fill in the Subnet mask field, which is usually 255.255.255.0. Type your router’s gateway, which is usually 192.168.1.1, in the Default gateway field.
- For DNS servers, you can use Google’s Public DNS. To use these, select the Preferred DNS server field and type 8.8.8.8. Select the Alternate DNS server field and type 8.8.4.4. Then, choose OK.
- Close the Properties window by selecting Close.
Your Windows 10 PC will disconnect from your router, and it will then automatically reconnect. After this reconnection, your PC should now have the specified static IP address allocated to it.
Assign a Static IP to Your Windows 11 PC
Like with Windows 10, you can use the Windows Settings app to assign a static IP address to your Windows 11 PC.
- Press Windows + I keys simultaneously to open the Settings app.
- Select Network & internet from the sidebar on the left in Settings.
- Select Advanced network settings at the bottom of the Network & internet page.
- Find your network adapter in the list and select the adapter. Then, select View additional properties.
- Select Edit next to IP assignment.
- Choose Manual from the Edit IP settings dropdown menu. Then, toggle on the IPv4 option.
- Select the IP address field and type the static IP address to assign to your PC.
- Select the Subnet mask field and enter 255.255.255.0. Enter your router’s IP address, which is usually 192.168.1.1, in the Default gateway field.
- Enter 8.8.8.8 in the Preferred DNS field. Enter 8.8.4.4 in the Alternate DNS field.
- Select Save at the bottom.
And your Windows 11 PC now has a static IP address assigned to it. In the future, your PC will continue to acquire this static IP address from your router, provided there are no IP conflict issues with your router.