route: Manipulates network routing tables.


... 命令"route"的示例
... "route" 摘自 Microsoft Windows 帮助
... 重要信息,"route"命令的提示

命令: "route" 开启 Windows 11, 10, .. 可用

命令"route"的示例

Route命令用于查看或修改Windows计算机的路由表。以下是使用“route”命令的一些示例: ### 查看路由表: 示例1:查看整个路由表:

route print

此命令显示完整的路由表,包括网络接口、网络地址、网关地址和指标。 示例2:查看特定目标主机的路由表:

route print -4 192.168.1.1

此命令显示特定目标主机(此处为 192.168.1.1)的路由表。 ### 添加路线: 示例3:添加静态路由:

route add 10.0.0.0 mask 255.0.0.0 192.168.1.1

此命令为网络 10.0.0.0 添加一条静态路由,子网掩码为 255.0.0.0,网关为 192.168.1.1。 示例 4:添加持久路由:

route -p add 172.16.0.0 mask 255.255.0.0 192.168.1.1

此命令为网络 172.16.0.0 添加一条持久静态路由,子网掩码为 255.255.0.0,网关为 192.168.1.1。选项`-p`使路由持久化,以便在重新启动后保留它。 ### 删除路线: 示例5:删除静态路由:

route delete 10.0.0.0

此命令删除网络 10.0.0.0 的静态路由。 示例 6:删除所有持久路由:

route -p delete *

此命令删除所有持久路由。请务必谨慎使用此选项,因为它会删除任何持久路由。 ### 更多的选择: 示例 7:更改路由的度量:

route change 192.168.1.0 mask 255.255.255.0 metric 10

此命令将 192.168.1.0 网络的路由度量更改为 10。 这些示例旨在让您了解如何在不同场景中使用“route”命令。根据您的具体需求和网络设置,参数可能会有所不同。使用`route /?`获取选项和参数的完整列表。

"route" 摘自 Microsoft Windows 帮助

Microsoft Windows [Version 10.0.19045.3693]
(c) Copyright 1985-2023 Microsoft Corp.

C:\\WINDOWS>


Manipulates network routing tables.

ROUTE [-f] [-p] [command [destination]
                  [MASK netmask]  [gateway] [METRIC metric]  [IF 
interface]

  -f           Clears the routing tables of all gateway entries.  If 
this is
               used in conjunction with one of the commands, the tables 
are
               cleared prior to running the command.
  -p           When used with the ADD command, makes a route persistent 
across
               boots of the system. By default, routes are not 
preserved
               when the system is restarted. Ignored for all other 
commands, 
               which always affect the appropriate persistent routes. 
This 
               option is not supported in Windows 95.
  command      One of these:
                 PRINT     Prints  a route
                 ADD       Adds    a route
                 DELETE    Deletes a route
                 CHANGE    Modifies an existing route	
  destination  Specifies the host.
  MASK         Specifies that the next parameter is the 'netmask' 
value.
  netmask      Specifies a subnet mask value for this route entry.
               If not specified, it defaults to 255.255.255.255.
  gateway      Specifies gateway.
  interface    the interface number for the specified route.
  METRIC       specifies the metric, ie. cost for the destination.

All symbolic names used for destination are looked up in the network 
database
file NETWORKS. The symbolic names for gateway are looked up in the host 
name
database file HOSTS.

If the command is PRINT or DELETE. Destination or gateway can be a 
wildcard,
(wildcard is specified as a star '*'), or the gateway argument may be 
omitted.

If Dest contains a * or ?, it is treated as a shell pattern, and only
matching destination routes are printed. The '*' matches any string,
and '?' matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.
Diagnostic Notes:
    Invalid MASK generates an error, that is when (DEST & MASK) != 
DEST.
    Example> route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
             The route addition failed: The specified mask parameter is 
invalid. (Destination & Mask) != Destination.

Examples:

    > route PRINT
    > route ADD 157.0.0.0 MASK 255.0.0.0  157.55.80.1 METRIC 3 IF 2
             destination^      ^mask      ^gateway     metric^    ^
                                                         Interface^
      If IF is not given, it tries to find the best interface for a 
given 
      gateway.
    > route PRINT
    > route PRINT 157*          .... Only prints those matching 157*
    > route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2
    
      CHANGE is used to modify gateway and/or metric only.
    > route PRINT
    > route DELETE 157.0.0.0
    > route PRINT

重要信息,"route"命令的提示

当使用`route`命令,有一些重要的要点需要注意,特别是在安全和网络配置方面: ### 安全性和真实性: 1. 访问权限:请注意,修改路由表需要管理权限。因此,请以管理员身份打开命令提示符,以提升的权限运行命令。 2. 持久路由:当您添加或删除持久路由时(`route -p`),确保您清楚了解对网络连接的影响。错误配置的持久路由可能会导致网络问题,尤其是在重新启动后。 ### 网络配置: 3. 正确使用选项:根据您的需要使用正确的选项和参数。不正确的配置可能会导致连接问题。 4. 路由的有效性:确保添加的路由有意义且有效。不正确的路由条目可能会导致网络连接错误。 ### 错误处理和监控: 5. 日志记录:添加或修改路由时,请仔细查看日志数据,确保路由配置正确且没有错误。 6. 网络延迟监控:对于较大的网络或路由表更改,监控网络延迟以确保更改不会导致重大性能问题非常重要。 ### 路由删除: 7. 删除时要小心:删除路由时(`route delete`)您应该确保删除正确的路由以避免网络问题。 8. 现有连接:请注意,删除路由可能会影响现有网络连接。建议在生产时间之外进行此操作。 ### 网络安全: 9. 防火墙影响:路由表的更改可能会影响防火墙配置。确保防火墙配置正确以适应新路由。 ### 一般注意事项: 10. 备份:在对路由表进行任何重大更改之前,请创建当前配置的备份。这样可以在出现问题时快速恢复。 11. 文档:保留对路由表的所有更改的准确文档,以便您可以跟踪它们并在必要时恢复到以前的配置。 这几点应该对你有帮助`route`-命令安全有效地使用。建议您谨慎更改路由表,以避免出现网络问题。


Deutsch
English
Español
Français
Italiano
日本語 (Nihongo)
한국어 (Hangugeo)
汉语 (Hànyǔ)
Türkçe
Português
Português
Svenska
Norsk
Dansk
Suomi
Nederlands
Polski









Windows-10


... Windows 10 FAQ
... Windows 10 How To


Windows 10 How To


... Windows 11 How To
... Windows 10 FAQ



指挥 route - Manipulates network routing tables.

HTTP: ... console/cn/144.htm
0.077
11920

Can I create a Diagonal Text in Word!

Aufnahmegeräte Linie-In über Desktop Verknüpfung direkt öffnen!

How to turn off the clicking sound in ms internet explorer?

System Requirements Immersive Headset for Windows 10 Mixed Reality, what's it?

How long does it take 35 times to overwrite files and random renaming?

Cortana window cannot be closed in Windows 10 / 11?



(0)