
$ netstat −tua
Active Internet connections (servers and established)
Proto Recv−Q Send−Q Local Address Foreign Address State
tcp 0 0 *:printer *:* LISTEN
tcp 0 0 bigcat:8000 *:* LISTEN
tcp 0 0 *:time *:* LISTEN
tcp 0 0 *:x11 *:* LISTEN
tcp 0 0 *:http *:* LISTEN
tcp 0 0 bigcat:domain *:* LISTEN
tcp 0 0 bigcat:domain *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 *:631 *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
tcp 0 1 dsl−78−199−139.s:1174 64.152.100.93:nntp SYN_SENT
tcp 0 1 dsl−78−199−139.s:1175 64.152.100.93:nntp SYN_SENT
tcp 0 1 dsl−78−199−139.s:1173 64.152.100.93:nntp SYN_SENT
tcp 0 0 dsl−78−199−139.s:1172 207.153.203.114:http ESTABLISHED
tcp 1 0 dsl−78−199−139.s:1199 www.xodiax.com:http CLOSE_WAIT
tcp 0 0 dsl−78−199−139.sd:http 63.236.92.144:34197 TIME_WAIT
tcp 400 0 bigcat:1152 bigcat:8000 CLOSE_WAIT
tcp 6648 0 bigcat:1162 bigcat:8000 CLOSE_WAIT
tcp 553 0 bigcat:1164 bigcat:8000 CLOSE_WAIT
udp 0 0 *:32768 *:*
udp 0 0 bigcat:domain *:*
udp 0 0 bigcat:domain *:*
udp 0 0 *:631 *:*
This output probably looks very different from what you get on your own system. Notice the distinction
between "Local Address" and "Foreign Address", and how each includes a corresponding port number (or
service name if available) after the colon. "Local Address" is our end of the connection. The first group with
LISTEN in the far right hand column are services that are running on this system. These are servers that are
running in the background on bigcat, and "listen" for incoming connections. So they have a port opened, and
this is where they "listen". These connections might come from the local system (i.e. bigcat itself), or remote
systems. This is very important information to have! The others just below this are connections that have
been established from this system to other systems. The respective connections are in varying states as
indicated by the key words in the last column. Those with no key word in the last column at the end are
servers responding to UDP connections. UDP is a different protocol from TCP altogether, but is used for
some types of low priority network traffic.
Now, the same thing with the "−n" flag to suppress converting to "names" so we can actually see the port
numbers:
$ netstat −taun
Active Internet connections (servers and established)
Proto Recv−Q Send−Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:515 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:37 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.1:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 1 169.254.179.139:1174 64.152.100.93:119 SYN_SENT
Security Quick−Start HOWTO for Red Hat Linux
8.3. Netstat Tutorial 49
Commenti su questo manuale