首页  >  文章  >  系统教程  >  如何在 Windows 11/10 上更改 NAT 类型

如何在 Windows 11/10 上更改 NAT 类型

王林
王林原创
2024-06-14 16:27:051044浏览

在线玩多人游戏时,您可能需要将 NAT 类型从严格更改为开放。严格或适度的 NAT 类型可能会导致加入游戏聚会时出现网络问题,例如突然断开连接、延迟、难以举办比赛等。

您可以更改 Windows 上的 NAT 类型以缓解限制,从而获得更快、更可靠的网络连接。但更改 NAT 时,您必须平衡您的需求和潜在的安全风险。

什么是 NAT,NAT 类型有哪些?

网络地址转换 (NAT) 是路由器(和防火墙)中的一项功能,可将家庭和办公室设备中的私有 IPv4 地址转换为 ISP 分配给路由器的公共 IPv4 地址,反之亦然。 NAT 有助于解决全球可用公共 IPv4 地址数量有限的问题。

NAT 类型描述了网络连接的状态。三种 NAT 类型是严格、中等和开放。

  • NAT 类型严格:它是最安全的 NAT 类型,但也是最严格的一种。具有严格 NAT 类型的用户可以加入由具有开放 NAT 类型的系统托管的游戏。但是,如果具有中等 NAT 类型的系统加入同一游戏,连接就会断开。
  • NAT 类型中等:中等安全并打开一些端口。具有中等 NAT 类型的系统可以加入使用中等或开放 NAT 类型的其他系统。
  • NAT 类型开放:如果您想举办比赛,请选择开放 NAT。它没有限制,可以不受限制地促进所有设备之间的数据传输,无论其 NAT 类型或防火墙配置如何。

您的默认 NAT 类型取决于您的路由器配置。如果您遇到与网络相关的问题,将 NAT 类型从“严格”或“中等”更改为“开放”会有所帮助。但是,请警惕与将 NAT 类型更改为开放相关的潜在安全风险。

如何设置静态专用 IP 地址

无论您要使用 UPnP 方法还是端口转发来更改 NAT 类型,您都需要一个静态 IP 地址才能使其工作。由于大多数路由器分配动态 IP 地址,因此您必须为 Windows 设备手动配置静态 IP。

如果您已为设备分配了静态 IP 地址,请跳到以下步骤来更改 NAT 类型。如果没有,请按照以下步骤在 Windows 计算机上设置静态 IP 地址:

  1. 按 Win + R 打开“运行”。
  2. 键入 cmd 并单击“确定”以打开命令提示符。
  3. 在命令提示符中,键入以下命令以查看网络信息:
    <code class="hljs ">ipconfig </code> 
  4. 在本指南中,我们将为以太网适配器设置静态 IP。因此,向下滚动到以太网适配器部分,记下 IPv4 地址、子网掩码和默认网关。How to Change NAT Type on Windows 11/10
  5. 接下来,按 Win + I 打开“设置”。
  1. 转到“网络和互联网”,然后单击“以太网”以打开以太网适配器属性。How to Change NAT Type on Windows 11/10
  2. 单击 IP 分配旁边的“编辑”按钮。How to Change NAT Type on Windows 11/10
  3. 选择自动 (DCHP) 下拉列表,然后选择手动。How to Change NAT Type on Windows 11/10
  4. 切换开关以启用 IPv4。
  5. 输入 IP 地址,确保 IP 地址的前三个八位字节与使用 ipconfig 命令获取的 IPv4 地址匹配,例如,键入 192.168.0.200。如您所见,我们保留了 IP 地址的前三个八位字节 (192.168.0),但将第四个八位字节从 101 更改为 200。 How to Change NAT Type on Windows 11/10
  6. 输入子网掩码和默认网关地址使用 ipconfig 命令获取的以太网适配器。
  7. 在首选 DNS 字段中,输入 8.8.8.8;对于备用 DNS,输入 8.8.4.4。这是 Google 提供的公共 DNS 服务器。
  8. 将其他设置保留为默认值,然后单击“保存”为设备设置静态 IP 地址。

拥有静态 IP 后,您可以按照以下步骤更改 Windows 计算机上的 NAT 类型。

1. Turn On Discovery Mode on Windows

Network Discovery is a built-in Windows feature to help you allow other computers on the network to detect your computer. You can turn On or Off the Network Discovery mode on Windows 10 from the Settings apps. Here's how to do it on Windows 11:

  1. Press Win + I to open Settings.
  2. Open the Network & internet tab in the left pane.How to Change NAT Type on Windows 11/10
  3. Click on Advanced network settings.How to Change NAT Type on Windows 11/10
  4. Scroll down and click Advanced sharing settings under the More settings section.How to Change NAT Type on Windows 11/10
  5. Toggle the switch for Network Discovery to turn it on for public networks.

2. Enable UPnP On Your Router

How to Change NAT Type on Windows 11/10

You can change your NAT type to Open by enabling Universal Plug and Play (UPnP) in your router settings. This is the easiest way to change the NAT type, provided you can access your router configuration page. However, there are security concerns with the UPnP method, which hackers may exploit.

Note that the following steps apply to a TP-Link router. The process to enable UPnP may differ for routers from other manufacturers. Check your router's user manual or manufacturer knowledge base online for instructions.

Follow these steps to enable UPnP:

  1. Log in to your router's web-based utility. To do this, type the default gateway address (for example (http://192.168.0.1) in the search bar and press Enter. If not, here's how to find your router's IP address.
  2. On the router dashboard, open the Advanced tab.
  3. Click to expand NAT Forwarding in the left pane.
  4. Open the UPnP tab under NATForwarding.
  5. Toggle the switch to enable UPnP.

You can now close your router's web-based utility and check for any improvements in your network connectivity.

3. Change NAT Type Using Port Forwarding

Alternatively, you can use the safer port forwarding method to change your NAT type for a specific game title or application. While the process is a little complicated compared to UPnP, port forwarding gives greater control over open ports and their usage with enhanced security.

To create a new port forwarding entry, you'll need to know the TCP or UDP ports used for your specific game. For example, Call of Duty: Black Ops Cold War uses the following ports:

<code class="hljs xml">TCP: 3074, 27014-27050UDP: 3074-3079</code> 

To find your game's UDP and TCP ports, perform a web search with your game title for port forwarding. Often, the game developers include port information for the game on their website.

How to Change NAT Type on Windows 11/10

Alternatively, go to portforward, select your game, and then your router name and model using the given options. On the following page, scroll down to locate the specific ports for your game. Port Forward keeps a database of ports for games on multiple platforms and for different router makers.

To change NAT type using Power Forwarding:

  1. 登录路由器的网络应用程序。在本例中,我们将使用 TP-Link 的基于网络的实用程序。
  2. 打开“高级”选项卡。
  3. 在左侧窗格中,单击展开 NAT 转发。How to Change NAT Type on Windows 11/10
  4. 打开端口转发选项卡。
  5. 单击右上角的 + 添加图标以创建新的端口转发条目。
  6. 在“添加端口转发条目”对话框中,键入“服务名称”的名称。确保添加名称以便于识别此端口转发条目以供将来参考。How to Change NAT Type on Windows 11/10
  7. 在设备 IP 地址中,键入计算机的以太网或 Wi-Fi 静态 IP 地址。
  8. 在外部和互联网端口字段中输入游戏的端口号。您可以使用 UDP 或 TCP 端口,但在外部端口和内部端口字段中使用相同的端口。
  9. 将协议字段设置为全部。
  10. 完成后,单击“保存”以保存端口转发条目。
How to Change NAT Type on Windows 11/10

该条目将保存在端口转发表中。您可以使用状态切换开关启用或禁用该条目。

除了端口转发之外,您还可以通过修改路由器的配置文件来更改 NAT 类型。然而,包括TP-Link在内的一些路由器制造商对配置文件进行了加密,使得进行必要的修改变得极其困难。

在 Windows 上更改 NAT 类型以修复网络问题

可能需要更改 NAT 类型才能解决与网络相关的问题。您可以启用 UPnP 或打开网络发现来缓解网络限制。但是,我们建议使用端口转发来减少网络限制,同时又不影响网络安全。

以上是如何在 Windows 11/10 上更改 NAT 类型的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn