<cmd_test@btjeon-naver ~>$ ping linuxcommand.org
PING linuxcommand.org (216.105.38.11) 56(84) bytes of data.
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=1 ttl=49 time=156 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=2 ttl=49 time=157 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=3 ttl=49 time=155 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=4 ttl=49 time=155 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=5 ttl=49 time=155 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=6 ttl=49 time=155 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=7 ttl=49 time=155 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=8 ttl=49 time=155 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=9 ttl=49 time=155 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=10 ttl=49 time=155 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=11 ttl=49 time=156 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=12 ttl=49 time=155 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=13 ttl=49 time=155 ms
64 bytes from secureprojects.sourceforge.net (216.105.38.11): icmp_seq=14 ttl=49 time=156 ms
^C
--- linuxcommand.org ping statistics ---
14 packets transmitted, 14 received, 0% packet loss, time 13015ms
rtt min/avg/max/mdev = 155.048/155.756/157.381/0.835 ms
ping 명령어는 ICMP ECHO-REQUEST라고 하는 고유의 네트워크 패킷을 지정된 호스트로 전송한다.
Ctrl-C 키를 눌러서 연결을 중단하면 네트워크 성능 현황을 확인할 수 있다. 적당히 수행된 네트워크는 0%의 패킷 손실을 보인다.
<cmd_test@btjeon-naver ~>$ traceroute slashdot.org
traceroute to slashdot.org (104.18.28.86), 30 hops max, 60 byte packets
1 10.41.74.4 (10.41.74.4) 0.886 ms 0.905 ms 0.874 ms
2 10.250.134.146 (10.250.134.146) 0.918 ms 1.013 ms 10.250.134.154 (10.250.134.154) 1.116 ms
3 10.250.1.29 (10.250.1.29) 1.161 ms 0.958 ms 10.250.1.33 (10.250.1.33) 0.746 ms
4 10.250.61.73 (10.250.61.73) 0.913 ms 10.250.134.253 (10.250.134.253) 0.806 ms 10.250.61.61 (10.250.61.61) 0.839 ms
5 10.250.61.1 (10.250.61.1) 0.695 ms 10.250.61.9 (10.250.61.9) 0.678 ms 0.662 ms
6 10.250.1.254 (10.250.1.254) 0.570 ms 0.371 ms 0.324 ms
7 10.250.1.251 (10.250.1.251) 1.106 ms 1.077 ms 0.774 ms
8 218.145.32.113 (218.145.32.113) 1.603 ms 1.581 ms 1.567 ms
9 * * *
10 * * *
11 218.145.42.206 (218.145.42.206) 3.125 ms 2.394 ms ce-0-18-0-3.r03.osakjp02.jp.bb.gin.ntt.net (129.250.8.77) 29.874 ms
12 61.120.144.46 (61.120.144.46) 146.667 ms 104.18.28.86 (104.18.28.86) 1.844 ms 1.813 ms
traceroute 명령어는 로컬 시스템으로부터 지정된 호스트까지의 모든 네트워크 이동 구간(hop)들을 보여준다. 라우터별로 정보를 보면 호스트명, IP 주소 그리고 로컬시스템에서 라우터까지의 왕복 시간에 대한 3번의 테스트 결과 데이터를 볼 수 있다. 하지만 라우터를 식별할 수 없는 경우에는 별표(*)로 표시되는 것을 볼 수 있다.
netstat 명령어는 다양한 네트워크 설정 사항이나 통계 정보를 확인하는 데 사용된다.
<cmd_test@btjeon-naver ~>$ netstat -ie
Kernel Interface table
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.41.75.215 netmask 255.255.254.0 broadcast 10.41.75.255
ether f2:20:cd:ce:dd:d7 txqueuelen 1000 (Ethernet)
RX packets 3445523 bytes 291385562 (277.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 755131 bytes 377662460 (360.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 32 bytes 2592 (2.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 32 bytes 2592 (2.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
-ie 옵션으로 시스템의 네트워크 인터페이스 정보를 확인할 수 있다. UP이라는 단어는 네트워크 인터페이스가 현재 활성화된 상태임을 나타낸다.
<cmd_test@btjeon-naver ~>$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default gateway 0.0.0.0 UG 0 0 0 eth0
10.41.74.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
link-local 0.0.0.0 255.255.0.0 U 0 0 0 eth0
-r 옵션은 커널의 네트워크 라우팅 테이블 정보를 보여준다. 이 정보를 통해 네트워크 간에 패킷을 송신하기 위해 네트워크가 어떤 식으로 설정되었는지를 알 수 있다.
출처 : 리눅스 커맨드라인 완벽 입문서
'IT일반 > Linux' 카테고리의 다른 글
Command Line - 파일 보관 및 백업 (0) | 2022.05.31 |
---|---|
Command Line - 파일 검색 (0) | 2022.05.28 |
Command Line - 저장 장치 (0) | 2022.05.27 |
Command Line - 패키지 관리 (0) | 2022.05.26 |
Command Line - 프롬프트 커스터마이징 (0) | 2022.05.23 |