TCP/IP Route コマンド
route
- C:\Windows\system32\ROUTE.EXE /?
STDERR:
ネットワーク ルーティング テーブルを操作します。
ROUTE [-f] [-p] [-4|-6] command [destination]
[MASK netmask] [gateway] [METRIC metric] [IF interface]
-f ルーティング テーブルにあるゲートウェイのエントリをすべてクリア
します。このオプションをコマンドと併用した場合、コマンドを実行
する前にテーブルがクリアされます。
-p ADD コマンドと併用された場合、システムの再起動後もルートは維持さ
れます。既定では、システムが再起動された場合、ルートは維持され
ません。適切な固定ルートを決定する他のコマンドでは、オプションは
無視されます。
-4 IPv4 の使用を強制します。
-6 IPv6 の使用を強制します。
command 次のいずれかです:
PRINT ルートを印刷します。
ADD ルートを追加します。
DELETE ルートを削除します。
CHANGE 既存のルートを変更します。
destination ホストを指定します。
MASK 次のパラメーターが 'netmask' の値であることを指定します。
netmask このルート エントリのサブネット マスクの値を指定します。
指定されない場合、既定値は 255.255.255.255 です。
gateway ゲートウェイを指定します。
interface 指定されたルートのインターフェイス番号です。
METRIC 宛先のコストなどのメトリックを指定します。
宛先の指定に使われたシンボリック名はすべてネットワーク データベース ファイル
NETWORKS で参照されます。ゲートウェイのシンボリック名は、ホスト名データベース
ファイル HOSTS で参照されます。
コマンドが PRINT または DELETE の場合、destination または gateway にはワイル
ド カード ('*' で指定) を使用できます。gateway の引数は省略できます。
destination に含まれる * または ? はシェルのパターンとして認識され、一致する宛
先ルートのみが印刷されます。'*' は任意の文字列に、'?' は 1 文字の文字に一致しま
す。例: 157.*.1、157.*、127.*、*224*。
パターン マッチは PRINT コマンドでのみ許可されます。
診断情報:
(DEST & MASK) != DEST の場合、MASK が無効なときにエラーが発生します。
例> route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
ルートを追加できませんでした: 指定したマスク パラメーターは無効です。
(Destination & Mask) != Destination です。
例:
> route PRINT
> route PRINT -4
> route PRINT -6
> route PRINT 157* .... 157* に一致するルートのみが出力されます
> route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2
宛先^ ^マスク ^ゲートウェイ メトリック^ ^
インターフェイス^
IF を指定しないと、指定したゲートウェイに最適なインターフェイスが
検索されます。
> route ADD 3ffe::/32 3ffe::1
> route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2
CHANGE はゲートウェイとメトリックの変更にのみ使用します。
> route DELETE 157.0.0.0
> route DELETE 3ffe::/32
Manipulates network routing tables.
ROUTE [-f] [-p] [-4|-6] 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.
-4 Force using IPv4.
-6 Force using IPv6.
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*.
Pattern match is only allowed in PRINT command.
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 PRINT -4
> route PRINT -6
> route PRINT 157* .... Only prints those matching 157*
> 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 ADD 3ffe::/32 3ffe::1
> 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 DELETE 157.0.0.0
> route DELETE 3ffe::/32
Return Code: 1
C:\Windows\system32\ROUTE.EXE
c:\>ver
Microsoft Windows [Version 10.0.19045.2075]
| File | Info |
|---|---|
| File Size | 24576bytes |
| Creation Time | 2019/12/07 18:09:34 |
| LastWrite Time | 2019/12/07 18:09:34 |
| ProductVersion | 10.0.19041.1889 |
| FileVersion | 10.0.19041.1889 (WinBuild.160101.0800) |
| Hash | Value |
|---|---|
| MD5 | 3c97e63423e527ba8381e81cba00b8cd |
| SHA1 | dc9ecd7e9ff4a4675c977a418bf1bb562c34c890 |
| SHA224 | aab98427c81d6e2ccb89791253205f95a980a4cacbbee1e8f4fadf8b |
| SHA256 | b8a28aeb6345ca88b04ff3d9fadf30eacf26958c991bd8e4fb1df12a68f60eae |
| SHA384 | e51897911ed0aa70721420e322563436381118be0373f5221a994ce281292a1da23213977193b0fdbd3f29949b7744cc |
| SHA512 | e202d2202632a40423c339be2eabd6430b3ea07a744fef536c555a3c083a678e8e2e03b8ca95e19198ce744c33fbdfbc4db050c6738c5837a8675bcdf203cfdd |