コンピュータのルーティングテーブルの変更を行うコマンドの紹介です。
WindowsやLinuxで使われます。
(使い方は異なります。以下はWindows操作です)
ルーティングテーブルの表示です。
Z:\>route PRINT
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 02 55 17 0c 30 ...... Intel(R) PRO/100 VE Network Connection - パケッ
ト スケジューラ ミニポート
0x10004 ...00 1d 73 29 fb ac ...... BUFFALO WLI-UC-AG Wireless LAN Adapter - パ
ケット スケジューラ ミニポート
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.33 20
0.0.0.0 0.0.0.0 192.240.0.1 192.240.0.235 25
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.0.0 255.255.255.0 192.168.0.33 192.168.0.33 20
192.168.0.33 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.0.255 255.255.255.255 192.168.0.33 192.168.0.33 20
192.240.0.0 255.255.255.0 192.240.0.235 192.240.0.235 25
192.240.0.235 255.255.255.255 127.0.0.1 127.0.0.1 25
192.240.0.255 255.255.255.255 192.240.0.235 192.240.0.235 25
224.0.0.0 240.0.0.0 192.168.0.33 192.168.0.33 20
224.0.0.0 240.0.0.0 192.240.0.235 192.240.0.235 25
255.255.255.255 255.255.255.255 192.168.0.33 192.168.0.33 1
255.255.255.255 255.255.255.255 192.240.0.235 192.240.0.235 1
Default Gateway: 192.168.0.1
===========================================================================
Persistent Routes:
None
Z:\>
ルーティングテーブルの追加、削除、表示です。
以下は、124.83.0.0を追加し、削除している例です。
追加後に、表示し、最後にroute delete 124.83.0.0で削除しています)
Z:\>route add 124.83.0.0 mask 255.255.255.0 192.240.0.235 metric 19 if 0x10004
Z:\>route PRINT
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 02 55 17 0c 30 ...... Intel(R) PRO/100 VE Network Connection - パケッ
ト スケジューラ ミニポート
0x10004 ...00 1d 73 29 fb ac ...... BUFFALO WLI-UC-AG Wireless LAN Adapter - パ
ケット スケジューラ ミニポート
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.33 20
0.0.0.0 0.0.0.0 192.240.0.1 192.240.0.235 25
124.83.0.0 255.255.255.0 192.240.0.235 192.240.0.235 19
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.0.0 255.255.255.0 192.168.0.33 192.168.0.33 20
192.168.0.33 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.0.255 255.255.255.255 192.168.0.33 192.168.0.33 20
192.240.0.0 255.255.255.0 192.240.0.235 192.240.0.235 25
192.240.0.235 255.255.255.255 127.0.0.1 127.0.0.1 25
192.240.0.255 255.255.255.255 192.240.0.235 192.240.0.235 25
224.0.0.0 240.0.0.0 192.168.0.33 192.168.0.33 20
224.0.0.0 240.0.0.0 192.240.0.235 192.240.0.235 25
255.255.255.255 255.255.255.255 192.168.0.33 192.168.0.33 1
255.255.255.255 255.255.255.255 192.240.0.235 192.240.0.235 1
Default Gateway: 192.168.0.1
===========================================================================
Persistent Routes:
None
Z:\>route delete 124.83.0.0
Z:\>