포트확인 및 점검이 가능한 tcping 소개

개요

간단한 유틸 하나 소개하려고 합니다. 인터넷이 안되거나 느릴때 혹은 포트확인 및 점검을 할적에 관리자 분들은 ping.exe라는 유틸을 사용할것입니다. 저두 많이 사용합니다. 이것으로 클라이언트 서버간의 속도나 응답여부를 확인하는데 쓰입니다.

tcping이란?

하지만, 인터넷 사이트의 경우는 응답하지 않는 경우가 많습니다. 방화벽단이나 서버단에서 ICMP 패킷이 차단이 되어 있으면 점검이 불가능합니다. 이럴경우 사용할 수 있는 유틸중에 하나가 tcping 입니다.

tcping 사용 예

웹서버가 열려 있는지 확인(http, 80번포트)

멀리 갈것도 없이 제가 지금 사용하고 있는 서버도 안됩니다. 아래 처럼 ping 명령어를 입력하면 안나옵니다. 응답값이 나오질 않습니다. 아래 처러 나오면 웹서버가 살아 있는지 느린지 먼가 문제가 있는지 알수 없습니다.

C:\Users\SOO\Desktop>ping soohyunet.com

Ping soohyunet.com [13.124.218.50] 32바이트 데이터 사용:
요청 시간이 만료되었습니다.
요청 시간이 만료되었습니다.
요청 시간이 만료되었습니다.
요청 시간이 만료되었습니다.

13.124.218.50에 대한 Ping 통계:
    패킷: 보냄 = 4, 받음 = 0, 손실 = 4 (100% 손실),
Code language: DOS .bat (dos)

하지만, tcping을 이용하면 자세히 알아 볼수 있습니다. 80번 포트가 열려 있으며, 평균 응답값이 계산되어져 나옵니다.


C:\Users\SOO\Desktop>tcping soohyunet.com

Probing 13.124.218.50:80/tcp - Port is open - time=7.899ms
Probing 13.124.218.50:80/tcp - Port is open - time=6.320ms
Probing 13.124.218.50:80/tcp - Port is open - time=6.267ms
Probing 13.124.218.50:80/tcp - Port is open - time=5.092ms

Ping statistics for 13.124.218.50:80
     4 probes sent.
     4 successful, 0 failed.
Approximate trip times in milli-seconds:
     Minimum = 5.092ms, Maximum = 7.899ms, Average = 6.395ms

C:\Users\SOO\Desktop>Code language: DOS .bat (dos)

웹서버 https(443) 포트 확인

특정 포트가 열려 있는지 확인한다면 아이피 주소 뒤에 포트넘버를 적어주면 됩니다. 아래처럼 443 https 포트가 열려 있는지 확인 해보니다. 열려 있네요.

포트확인 tcping

DNS 포트(53) 열려 있는지 확인

아래 처럼 해보니 제 서버의 경우 닫혀있네요. 서버 관리자의 경우 대부분 포트를 막고 필요한 포트만 열어 놓습니다.

C:\Users\SOO\Desktop>tcping soohyunet.com 53

Probing 13.124.218.50:53/tcp - No response - time=2013.588ms
Probing 13.124.218.50:53/tcp - No response - time=2031.041ms
Probing 13.124.218.50:53/tcp - No response - time=2014.968ms
Probing 13.124.218.50:53/tcp - No response - time=2030.427ms

Ping statistics for 13.124.218.50:53
     4 probes sent.
     0 successful, 4 failed.
Was unable to connect, cannot provide trip statistics.

C:\Users\SOO\Desktop>Code language: DOS .bat (dos)

tcping 상세 명령어 도움말

자세한 도움말은 /? 옵션으로 볼수 있으며 윈도우 기본 프로그램인 ping.exe하고 거의 동일 합니다.

C:\Users\SOO\Desktop>tcping /?
--------------------------------------------------------------
tcping.exe by Eli Fulkerson
Please see http://www.elifulkerson.com/projects/ for updates.
--------------------------------------------------------------
Usage: tcping [-flags] server-address [server-port]
Usage (full): tcping [-t] [-d] [-i interval] [-n times] [-w ms] [-b n] [-r times] [-s] [-v] [-j] [-js size] [-4] [-6] [-c] [-g count] [-S source_address] [--file] [--tee filename] [-h] [-u] [--post] [--head] [--proxy-port port] [--proxy-server server] [--proxy-credentials username:password] [-f] server-address [server-port]
-t     : ping continuously until stopped via control-c
-n 5   : for instance, send 5 pings
-i 5   : for instance, ping every 5 seconds
-w 0.5 : for instance, wait 0.5 seconds for a response
-d     : include date and time on each line
-b 1   : enable beeps (1 for on-down, 2 for on-up,
3 for on-change, 4 for always)
-r 5   : for instance, relookup the hostname every 5 pings
-s     : automatically exit on a successful ping
-v     : print version and exit
-j     : include jitter, using default rolling average
-js 5  : include jitter, with a rolling average size of (for instance) 5.
--tee  : mirror output to a filename specified after '--tee'
-4     : prefer ipv4
-6     : prefer ipv6
-c     : only show an output line on changed state
--file : treat the "server-address" as a filename instead, loop through file line by line
Note: --file is incompatible with options such as -j and -c as it is looping through different targets
Optionally accepts server-port.  For example, "example.org 443" is valid.
-g 5   : for instance, give up if we fail 5 times in a row
-S _X_ : Specify source address _X_.  Source must be a valid IP for the client computer.
HTTP Options:
-h     : HTTP mode (use url without http:// for server-address)
-u     : include target URL on each line
--post : use POST rather than GET (may avoid caching)
--head : use HEAD rather than GET
--proxy-server : specify a proxy server
--proxy-port   : specify a proxy port
--proxy-credentials : specify 'Proxy-Authorization: Basic' header in format username:password
Debug Options:
-f     : force tcping to send at least one byte
--header : include a header with original args and date.  Implied if using --tee.
--block  : use a 'blocking' socket to connect.  This prevents -w from working and uses the
default timeout (as long as 20 seconds in my case).  However it can detect an actively
refused connection vs a timeout.
If you don't pass server-port, it defaults to 80.
C:\Users\SOO\Desktop>Code language: DOS .bat (dos)

다운로드

아래 주소에서 다운로드 받으실 수 있습니다. https://download.elifulkerson.com//files/tcping/0.39/tcping.exe

또한 홈페이지에 가시면 자세한 업데이트 내역 및 사용법이 기재되어 있습니다.
https://elifulkerson.com/projects/tcping.php

참고 :

▷ ICMP란 : internet control message protocol의 약자로 메시지를 제어하고 에러를 알려주는 프로토콜입니다.

3 thoughts on “포트확인 및 점검이 가능한 tcping 소개”

Leave a Comment