Windows 에서 route 사용하기

by 조쉬 posted Feb 27, 2014
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
Windows route 명령어
아래의 경우(먼저 linux route 명령어 참조)는 사실 default gateway(리눅스로 구성된..)를 만지고 있는 사람이 쓰게 된다.
그럼 게이트가 2개일때 User(대부분의 User가 Windows 시스템을 쓴다는 가정하에...)에서는 또는 default gateway가 윈도우 시스템이라면 게이트를 이동시킬 수 없는 것인가?
물론 Windows에서도 이동시킬 수 있다.
먼저 자신의 routing table을 보려면
route print
명령어를 이용하면 된다.
그리고 라우팅 추가는
route add 211.218.150.200 mask 255.255.255.255 192.168.0.2
하면 되고, 윈도우에서는 뒤에 -p옵션을 주면 컴퓨터를 리붓하더라도 없어지지 않는다.
그러면... default gateway가 있음에도 불구하고 다른 경로를 통해서 트래픽이 나가게 된다.
User Default gateway www.naver.com
192.168.0.3 192.168.0.1 ↑ ↓
↑↓ ↑ ↓
↑↓ ↑ ↓
↑↓ ↑ ↓
↑ → → → → → → → → → gate2 → → → → → → → → ↓
← ← ← ← ← ← ← ← 192.168.0.2← ← ← ← ← ← ← ← ←

route 명령어 설명은 아래 help파일 참조...


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 acros
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 inval
(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