怎么设置 Windows11 路由命令 只能访问 Internet 某个地址

The above commands are used to specify all requests from the local machine to access the 172 network will directly go through the gateway 172.22.1.1. This allows for easy access to both the internet and a specific host application within a client's server room. To manually set routes in Windows, use the CMD prompt and ensure the ethernet cables are properly connected to the router and Windows computer. If experiencing connectivity issues, troubleshoot by checking adapter settings and making sure one default gateway is set and specifying the appropriate network adapter. The Windows Route command is used to display and modify entries in the local IP route table. The syntax is route [-f] [-p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric]] for Windows 10/11 systems.

要在Windows 11中设置路由命令,让只有特定地址能够访问互联网,你可以使用以下步骤:

  1. 打开CMD命令提示符。
  2. 输入以下命令以设置路由:route ADD destination_network MASK subnet_mask gateway_ip metric_cost
    • 其中“destination_network”是要访问的目标网络地址,“subnet_mask”是网络的子网掩码,“gateway_ip”是用于访问互联网的网关地址,“metric_cost”是可选的,它表示到达目标网络的成本。
    • 举例来说,如果要让目标网络地址为172.16.0.0,子网掩码为255.255.0.0的网络只能通过网关地址为192.168.1.1来访问互联网,可以输入以下命令:route ADD 172.16.0.0 MASK 255.255.0.0 192.168.1.1

请确保在设置路由命令之前已经正确连接了以太网线到路由器和Windows电脑,如果遇到连接问题,可能需要检查适配器设置、确保设置了一个默认网关,并指定适当的网络适配器。Windows的路由命令用于显示和修改本地IP路由表中的条目。

Work fast from anywhere

Stay up to date and move work forward with BrutusAI on macOS/iOS/web & android. Download the app today.