-t (--tcp) : TCP 소켓을 출력하라는 옵션, TCP 소켓 중 연결된(ESTABLISHED) 소켓만 출력 됨
netstat -t
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 96 10.10.10.15:ssh 10.10.11.12:qnxnetman ESTABLISHED
tcp 0 0 10.10.10.15:ssh 10.10.11.12:46599 ESTABLISHED
[root@dochi /]# netstat --tcp
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 96 10.10.10.15:ssh 10.10.11.12:qnxnetman ESTABLISHED
tcp 0 0 10.10.10.15:ssh 10.10.11.12:46599 ESTABLISHED
netstat -n
-n (--numeric) : 도메인 주소를 읽어들이지 않고 숫자로 출력한다. ex)ftp -->21
netstat -n
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 224 10.10.10.15:22 10.10.11.12:3385 ESTABLISHED
tcp 0 0 10.10.10.15:22 10.10.11.12:46599 ESTABLISHED
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags Type State I-Node Path
unix 15 [ ] DGRAM 12297 /dev/log
unix 2 [ ] DGRAM 12800 @/org/freedesktop/hal/udev_event
unix 2 [ ] DGRAM 9570 @/org/kernel/udev/udevd
unix 2 [ ] DGRAM 449020
netstat -p
-p (--program) : PID(프로세서 ID) 와 사용중인 프로그램명이 표시된다. (TCP 소켓을 열고 있는 프로세스 확인 유용)
[root@dochi /]# netstat -p
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 96 10.10.10.15:ssh 10.10.11.12:qnxnetman ESTABLISHED 19030/sshd
tcp 0 0 10.10.10.15:ssh 10.10.11.12:46599 ESTABLISHED 18752/sshd
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 15 [ ] DGRAM 12297 1799/rsyslogd /dev/log
unix 2 [ ] DGRAM 12800 1955/hald @/org/freedesktop/hal/udev_event
unix 2 [ ] DGRAM 9570 666/udevd @/org/kernel/udev/udevd
unix 2 [ ] DGRAM 449020 19059/su
unix 2 [ ] DGRAM 448785 19030/sshd
netstat -rn
시스템 라우팅 정보
[root@dochi /]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth2
0.0.0.0 10.10.10.254 0.0.0.0 UG 0 0 0 eth2
netstat -s
부팅된 이후부터 현재까지 누적된 프로토콜 통계정보
[root@dochi /]# netstat -s
Ip:
913002 total packets received
990 with invalid addresses
0 forwarded
0 incoming packets discarded
912012 incoming packets delivered
588676 requests sent out
Icmp:
3 ICMP messages received
0 input ICMP message failed.
ICMP input histogram:
redirects: 3
0 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:
IcmpMsg:
InType5: 3
Tcp:
31 active connections openings
110 passive connection openings
0 failed connection attempts
0 connection resets received
2 connections established
615201 segments received
586339 segments send out
125 segments retransmited
0 bad segments received.
3 resets sent
Udp:
69856 packets received
0 packets to unknown port received.
30 packet receive errors
2212 packets sent
UdpLite:
TcpExt:
121 TCP sockets finished time wait in fast timer
31 delayed acks sent
4 packets directly queued to recvmsg prequeue.
16 packets directly received from prequeue
610545 packets header predicted
4 packets header predicted and directly queued to user
1537 acknowledgments not containing data received
548231 predicted acknowledgments
3 congestion windows recovered after partial ack
0 TCP data loss events
20 other TCP timeouts
1 DSACKs received
15 connections aborted due to timeout
TCPSackShiftFallback: 1
IpExt:
InMcastPkts: 2
InBcastPkts: 293527
OutBcastPkts: 1753
InOctets: 447084395
OutOctets: 105192423
InMcastOctets: 72
InBcastOctets: 154944511
OutBcastOctets: 223525
server [NTP 서버 IP] 를 입력( 저는 내부 ntp 서버 10.10.10.10 을 입력)
참고!!
국내 NTP 제공 사이트
zero.bora.net
ntp.ewha.net
ntp1.epidc.co.kr
ntp2.epidc.co.kr
kr.pool.ntp.org
kr.pool.ntp.org
# To configure leap seconds processing, download the latest NIST leap seconds
# file to /etc/inet, and then create a symbolic link to it from the ntp.leap
# file. Without this file, NTP will still be able to accept leap announcements
# from its upstream sources. If this file exists and is less than 6 months old
# then the contents of this file will take precedence over the upstream servers.
# The latest leap seconds file is always available at ftp://time.nist.gov/pub
#leapfile /etc/inet/ntp.leap
server 10.10.10.10