如何用route命令配置?

sheyg 2004-12-09 10:08:53
在下有一例:如果当前计算机想访问内部网的网段在192.168.0.0-192.168.254.0的网关是192.168.3.1,而访问互联网的网关是192.168.3.62这样用route命令怎设?我从来没用过route命令!
...全文
233 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
sheyg 2004-12-09
  • 打赏
  • 举报
回复
谢谢icuc88(MS MVP@职业特种兵),正如你所说,问题解决了!我会给你分的!
sheyg 2004-12-09
  • 打赏
  • 举报
回复
老大,这个我也有,而且还是中文的。可在下就是不会用。
请问,我想把访问192.168.0.1-192.168.0.254的网关设为,192.168.3.1,只用一个命令就可以吗?
route add 192.168.0.1 mask 255.255.255.0 192.168.3.1
就这样一个命令说能说明1-254的路由都是3.1吗?
icuc88 2004-12-09
  • 打赏
  • 举报
回复
有错:)

route 10.10.10.0 mask 255.255.255.0 192.168.3.1 -p

其中:10.10.10.0 255.255.255.0是需要访问你的机器的网段
icuc88 2004-12-09
  • 打赏
  • 举报
回复
在下有一例:如果当前计算机想访问内部网的网段在192.168.0.0-192.168.254.0的网关是192.168.3.1,而访问互联网的网关是192.168.3.62这样用route命令怎设?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1、默认网关配置为:192.168.3.62

然后配置静态路由:

route 10.10.10.1 mask 255.255.255.0 192.168.3.1 -p

其中:10.10.10.1 255.255.255.0是需要访问你的机器的网段
followme_ck 2004-12-09
  • 打赏
  • 举报
回复
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 DELETE 157.0.0.0
> route PRINT

6,849

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧