라우팅 적용

  • Definition

       PC-STREAM:업무망에서 인터넷 사이트를 연계할 때 쓰임(KT에서는 이렇게 부른다.)

업무망인터넷망 간의 스트림 연계 테스트(PC-STREAM)를 구성할 때

인터넷PC에서 Windows의 hosts 파일을 변경하여 스트림 연계를 테스트한다.

가령.도메인( http://www.iros.go.kr)을 망연계 IP(192.168.137.101 )로 보내고자 할때

아래와 같이 변조할 것이다.

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
192.168.137.101 www.iros.go.kr

다른 도메인을 테스트하고자 할 때에는 PC-STREAM의 여러 정책을 테스트하기 위해

정책 테스트마다, 목적지의 도메인을 변경하면서 테스트를 해야 하는데…

이거 정말 쉽지 않은 작업이다.

해당 작업을 빠르게 진행하기 위해서 아래의 방법을 제안해본다.

– 사용자 PC단에서 임의 사설 IP를 망연계 IP로 toss하도록 라우팅 적용)

1. 사용자 PC에서 바라보는 사설 IP에 대하여 망연계 IP로 던지게 라우팅 테이블을 적용한다.

2. 사용자 host변조를 각각 사설ip마다 망연계IP로 변조 구성한다.

3. 사설IP에 대하여 도메인을 연계하도록 정책 구성을 한다.

– 예제: http://www.iros.go.kr, ko-kr.facebook.com를 192.168.100.1, 192.168.100.2로

호스트 변조 시키고, 각 사설ip에 대하여 라우팅 테이블을 추가하는 예제

cmd를 Administrator 권한 적용하여 실행후 아래의 라우팅 적용 – 1번

C:\>route add 192.168.100.1 mask 255.255.255.255 192.168.137.102
C:\>route add 192.168.100.2 mask 255.255.255.255 192.168.137.102

확인

C:\>print route

===========================================================================
활성 경로:
네트워크 대상 네트워크 마스크 게이트웨이 인터페이스 메트릭
0.0.0.0 0.0.0.0 211.204.5.193 211.204.5.205 20
127.0.0.0 255.0.0.0 연결됨 127.0.0.1 306
127.0.0.1 255.255.255.255 연결됨 127.0.0.1 306
127.255.255.255 255.255.255.255 연결됨 127.0.0.1 306
169.254.0.0 255.255.0.0 연결됨 169.254.151.251 286
169.254.151.251 255.255.255.255 연결됨 169.254.151.251 286
169.254.255.255 255.255.255.255 연결됨 169.254.151.251 286
192.168.0.0 255.255.0.0 연결됨 192.168.137.1 266
192.168.82.0 255.255.255.0 연결됨 192.168.82.1 266
192.168.82.1 255.255.255.255 연결됨 192.168.82.1 266
192.168.82.255 255.255.255.255 연결됨 192.168.82.1 266
192.168.100.1 255.255.255.255 192.168.137.102 192.168.137.1 11
192.168.100.2 255.255.255.255 192.168.137.102 192.168.137.1 11

host 변조 적용 – 2번

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
192.168.100.1 www.iros.go.kr
192.168.100.2 ko-kr.facebook.com

스트림 정책 적용 – 3번%ec%a0%95%ec%b1%85%ec%a0%81%ec%9a%a9

아, 훌륭하다.

tcpdump 덤프 떳을때 정상적으로 해당 ip를 토스하고 있고

여러정책 변경할때 마다, 삽질하는 수고를 덜어주게 되었다.

사용자 PC단에서 없는 인터페이스 ip를 토스해주니.. 이 얼마나 고마운..

정상적으로 넘어가는것도 로그로 확인..

캡처.PNG

아마도, POC나 BMT할때 이런거 적용하면 정말 훌륭할텐데… 리버스 프록시 쓰지말구…