Netstat (estadísticas de red) es una herramienta de la línea de comandos para controlar las conexiones de red entrantes y salientes, así como la visualización de las tablas de enrutamiento, las estadísticas de la interfaz, etc netstat está disponible en todos los sistemas operativos de tipo Unix y también disponibles en el sistema operativo Windows. Es muy útil en términos de resolución de problemas de red y la medición del desempeño. Netstat es una de las herramientas de depuración de servicios de red más básicas, que le dice qué puertos están abiertos y si los programas escuchan en tales puertos.
Comando Linux netstat
Esta herramienta es muy importante y muy útil para los administradores de red de Linux, así como para los administradores de sistemas para supervisar y solucionar los problemas relacionados con la red y determinar el rendimiento del tráfico de red. Este artículo muestra los usos del comando netstat con sus ejemplos que pueden ser útiles en la operación diaria.
1. Listado de todos los puertos de escucha TCP y conexiones UDP
Listado de todos los puertos (TCP y UDP) mediante netstat -a.
javier@localhost ~]$ netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:24837 *:* LISTEN
tcp 0 0 *:28935 *:* LISTEN
tcp 0 0 *:mysql *:* LISTEN
tcp 0 0 *:rfb *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:37810 *:* LISTEN
tcp 0 0 localhost:5939 *:* LISTEN
tcp 0 0 *:52277 *:* LISTEN
tcp 0 0 192.168.122.1:domain *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 localhost:postgres *:* LISTEN
tcp 0 0 localhost:smtp *:* LISTEN
tcp 0 0 *:db-lsp *:* LISTEN
tcp 0 0 localhost:atmtcp *:* LISTEN
tcp 0 0 localhost:57298 localhost:60918 ESTABLISHED
tcp 0 0 192.168.1.33:47144 91.123.100.210:http ESTABLISHED
tcp 0 0 192.168.1.33:42109 wb-in-f125.:xmpp-client ESTABLISHED
tcp 0 0 localhost:60918 localhost:57298 ESTABLISHED
tcp 0 0 192.168.1.33:56399 mad01s08-in-f21.1:https ESTABLISHED
tcp 0 0 192.168.1.33:56941 mad01s08-in-f14.1e:http ESTABLISHED
tcp 0 0 192.168.1.33:39687 db3msgr5011101.ga:https ESTABLISHED
tcp 0 52267 localhost:5939 localhost:60862 ESTABLISHED
tcp 0 0 192.168.1.33:57265 snt-re2-10a.sjc.dr:http ESTABLISHED
tcp 0 0 192.168.1.33:45886 91.190.216.58:12350 ESTABLISHED
tcp 0 0 192.168.1.33:33440 server12700.teamvi:5938 ESTABLISHED
tcp 0 0 localhost:60862 localhost:5939 ESTABLISHED
tcp 0 0 192.168.1.33:33519 server10011.teamvi:5938 ESTABLISHED
tcp 0 0 192.168.1.33:57818 213.199.179.171:40024 ESTABLISHED
tcp 0 0 192.168.1.33:53423 server20801.teamvi:5938 ESTABLISHED
tcp 1440 0 192.168.1.33:36636 91.123.100.221:http ESTABLISHED
2. Listado de conexiones de puertos TCP
Listado de sólo conexiones de puerto TCP (Transmission Control Protocol) utilizando netstat -at.
[javier@localhost ~]$ netstat -at
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:24837 *:* LISTEN
tcp 0 0 *:28935 *:* LISTEN
tcp 0 0 *:mysql *:* LISTEN
tcp 0 0 *:rfb *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:37810 *:* LISTEN
tcp 0 0 localhost:5939 *:* LISTEN
tcp 0 0 *:52277 *:* LISTEN
tcp 0 0 192.168.122.1:domain *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 localhost:postgres *:* LISTEN
tcp 0 0 localhost:smtp *:* LISTEN
tcp 0 0 *:db-lsp *:* LISTEN
tcp 0 0 localhost:atmtcp *:* LISTEN
tcp 0 0 192.168.1.33:55704 edge-star-shv-06-c:http ESTABLISHED
tcp 0 0 192.168.1.33:47013 194.224.66.48:http ESTABLISHED
tcp 0 0 192.168.1.33:35627 91.225.248.80:http ESTABLISHED
tcp 0 0 192.168.1.33:55178 we-in-f95.1e100.n:https ESTABLISHED
tcp 0 0 192.168.1.33:37657 mad01s08-in-f15.1:https ESTABLISHED
tcp 0 0 192.168.1.33:60057 we-in-f95.1e100.ne:http TIME_WAIT
tcp 0 0 192.168.1.33:47015 194.224.66.48:http ESTABLISHED
tcp 0 0 192.168.1.33:48846 tecmint.com:http TIME_WAIT
tcp 0 0 localhost:57298 localhost:60918 ESTABLISHED
tcp 0 0 192.168.1.33:42109 wb-in-f125.:xmpp-client ESTABLISHED
tcp 0 0 192.168.1.33:44814 mad01s09-in-f5.1e1:http ESTABLISHED
tcp 0 0 localhost:60918 localhost:57298 ESTABLISHED
tcp 0 0 192.168.1.33:49463 mad01s09-in-f10.1e:http TIME_WAIT
3. Listado de conexiones UDP Puertos
Listado sólo conexiones de puerto UDP (User Datagram Protocol) utilizando netstat -au.
[javier@localhost ~]$ netstat -au
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
udp 0 0 *:28935 *:*
udp 0 0 localhost:323 *:*
udp 0 0 *:23109 *:*
udp 0 0 *:ipp *:*
udp 0 0 *:47817 *:*
udp 0 0 localhost:37624 *:*
udp 0 0 *:35745 *:*
udp 0 0 *:950 *:*
udp 0 0 localhost:1005 *:*
udp 0 0 *:db-lsp-disc *:*
udp 0 0 *:mdns *:*
udp 0 0 *:57034 *:*
udp 0 0 *:40785 *:*
udp 0 0 192.168.122.1:domain *:*
udp 0 0 *:bootps *:*
udp 0 0 *:bootpc *:*
udp 0 0 *:sunrpc *:*
udp 0 0 *:ntp *:*
udp6 0 0 localhost:323 [::]:*
udp6 0 0 [::]:59847 [::]:*
udp6 0 0 [::]:950 [::]:*
udp6 0 0 [::]:44138 [::]:*
udp6 0 0 localhost:59017 localhost:59017 ESTABLISHED
udp6 0 0 [::]:sunrpc [::]:*
udp6 0 0 [::]:ntp [::]:*
4. Listado de todas las conexiones de Escucha
Listado de todas las conexiones activas de escucha de puertos con netstat -l.
[javier@localhost ~]$ netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:24837 *:* LISTEN
tcp 0 0 *:28935 *:* LISTEN
tcp 0 0 *:mysql *:* LISTEN
tcp 0 0 *:rfb *:* LISTEN
tcp 0 0 localhost:postgres *:* LISTEN
tcp 0 0 localhost:smtp *:* LISTEN
tcp 0 0 *:db-lsp *:* LISTEN
tcp 0 0 localhost:atmtcp *:* LISTEN
tcp6 0 0 [::]:sunrpc [::]:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 localhost:ipp [::]:* LISTEN
tcp6 0 0 [::]:40087 [::]:* LISTEN
tcp6 0 0 localhost:postgres [::]:* LISTEN
tcp6 0 0 [::]:https [::]:* LISTEN
udp 0 0 *:28935 *:*
udp 0 0 localhost:323 *:*
udp6 0 0 [::]:59847 [::]:*
udp6 0 0 [::]:950 [::]:*
udp6 0 0 [::]:44138 [::]:*
udp6 0 0 [::]:sunrpc [::]:*
udp6 0 0 [::]:ntp [::]:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 18725 @ISCSIADM_ABSTRACT_NAMESPACE
unix 2 [ ACC ] STREAM LISTENING 22786 /tmp/.s.PGSQL.5432
unix 2 [ ACC ] STREAM LISTENING 22531 /var/run/xdmctl/dmctl-:0/socket
unix 2 [ ACC ] STREAM LISTENING 746756 /tmp/Arora_1000_1000
unix 2 [ ACC ] STREAM LISTENING 28610 /home/javier/.dropbox/command_socket
unix 2 [ ACC ] STREAM LISTENING 25697 @/tmp/dbus-usNVfBmwLD
unix 2 [ ACC ] STREAM LISTENING 16118 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 19198 /var/run/sdp
5. Listado de todos los puertos de escucha TCP
Listado de todos los puertos TCP de escucha activa mediante la opción netstat -lt.
[javier@localhost ~]$ netstat -lt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:24837 *:* LISTEN
tcp 0 0 *:28935 *:* LISTEN
tcp 0 0 *:mysql *:* LISTEN
tcp 0 0 *:rfb *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:37810 *:* LISTEN
tcp 0 0 localhost:5939 *:* LISTEN
tcp 0 0 *:52277 *:* LISTEN
tcp 0 0 192.168.122.1:domain *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 localhost:postgres *:* LISTEN
tcp 0 0 localhost:smtp *:* LISTEN
tcp 0 0 *:db-lsp *:* LISTEN
tcp 0 0 localhost:atmtcp *:* LISTEN
tcp6 0 0 [::]:sunrpc [::]:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 localhost:ipp [::]:* LISTEN
tcp6 0 0 [::]:40087 [::]:* LISTEN
tcp6 0 0 localhost:postgres [::]:* LISTEN
tcp6 0 0 [::]:https [::]:* LISTEN
6. Listado de todos los puertos de escucha UDP
Listado de todos los puertos UDP de escucha activa mediante la opción netstat -lu.
[javier@localhost ~]$ netstat -lu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
udp 0 0 *:28935 *:*
udp 0 0 localhost:323 *:*
udp 0 0 *:23109 *:*
udp 0 0 *:ipp *:*
udp 0 0 *:47817 *:*
udp 0 0 localhost:37624 *:*
udp 0 0 *:35745 *:*
udp 0 0 *:950 *:*
udp 0 0 localhost:1005 *:*
udp 0 0 *:db-lsp-disc *:*
udp 0 0 *:mdns *:*
udp 0 0 *:57034 *:*
udp 0 0 *:40785 *:*
udp 0 0 192.168.122.1:domain *:*
udp 0 0 *:bootps *:*
udp 0 0 *:bootpc *:*
udp 0 0 *:sunrpc *:*
udp 0 0 *:ntp *:*
udp6 0 0 localhost:323 [::]:*
udp6 0 0 [::]:59847 [::]:*
udp6 0 0 [::]:950 [::]:*
udp6 0 0 [::]:44138 [::]:*
udp6 0 0 [::]:sunrpc [::]:*
udp6 0 0 [::]:ntp [::]:*
7. Listado de todos los puertos de escucha UNIX
Listado de todos los puertos de escucha UNIX activos utilizando netstat -lx.
[javier@localhost ~]$ netstat -lx
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 18725 @ISCSIADM_ABSTRACT_NAMESPACE
unix 2 [ ACC ] STREAM LISTENING 22786 /tmp/.s.PGSQL.5432
unix 2 [ ACC ] STREAM LISTENING 22531 /var/run/xdmctl/dmctl-:0/socket
unix 2 [ ACC ] STREAM LISTENING 746756 /tmp/Arora_1000_1000
unix 2 [ ACC ] STREAM LISTENING 28610 /home/javier/.dropbox/command_socket
unix 2 [ ACC ] STREAM LISTENING 28611 /home/javier/.dropbox/iface_socket
unix 2 [ ACC ] STREAM LISTENING 23566 /var/run/postgresql/.s.PGSQL.5432
unix 2 [ ACC ] STREAM LISTENING 28281 @/tmp/dbus-u8EFfHOzWW
unix 2 [ ACC ] STREAM LISTENING 18716 /var/run/abrt/abrt.socket
unix 2 [ ACC ] STREAM LISTENING 26307 @/tmp/.ICE-unix/1583
unix 2 [ ACC ] STREAM LISTENING 729375 socket
unix 2 [ ACC ] STREAM LISTENING 8749 /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 27962 /tmp/.esd-1000/socket
unix 2 [ ACC ] STREAM LISTENING 18747 /var/run/xdmctl/dmctl/socket
unix 2 [ ACC ] STREAM LISTENING 27965 /tmp/pulse-dqLybqcwxfr6/native
unix 2 [ ACC ] STREAM LISTENING 27967 /tmp/pulse-dqLybqcwxfr6/dbus-socket
8. Mostrando estadísticas por protocolo
Muestra estadísticas por protocolo. De forma predeterminada, se muestran las estadísticas para el TCP, UDP, ICMP e IP. El parámetro -s se puede utilizar para especificar un conjunto de protocolos.
# Netstat -s IP: 2461 total de paquetes recibidos 0 remitió 0 paquetes entrantes descartados 2431 paquetes entrantes entregados 2049 peticiones enviadas Icmp: 0 mensajes ICMP recibidos 0 entrada de mensajes ICMP ha fallado. ICMP histograma de entrada: 1 mensajes ICMP enviados 0 mensajes ICMP fracasaron ICMP histograma de salida: destino inalcanzable: 1 Tcp: 159 aberturas de conexiones activas 1 aberturas de conexión pasivas 4 intentos de conexión fallidos 0 Conexión restablece recibieron 1 conexiones establecidas 2.191 segmentos recibidos 1.745 segmentos envían 24 segmentos retransmitido 0 segmentos malas recibidas. 4 restablece enviado Udp: 243 paquetes recibidos 1 paquetes al puerto desconocido recibidos. 0 de recepción de paquetes errores 281 paquetes enviados
9. Mostrando estadísticas por protocolo TCP
Mostrando estadísticas de único protocolo TCP mediante la opción netstat -st.
[javier@localhost ~]$ netstat -st
IcmpMsg:
InType3: 224
OutType3: 61
Tcp:
15775 active connections openings
9 passive connection openings
23 failed connection attempts
287 connection resets received
17 connections established
4048495 segments received
2687124 segments send out
2400 segments retransmited
720 bad segments received.
10553 resets sent
InCsumErrors: 1
o estadísticas por protocolo UDP
[javier@localhost ~]$ netstat -su
IcmpMsg:
InType3: 212
OutType3: 58
Udp:
146952 packets received
58 packets to unknown port received.
0 packet receive errors
80671 packets sent
0 receive buffer errors
0 send buffer errors
UdpLite:
IpExt:
InNoRoutes: 1
InMcastPkts: 72
OutMcastPkts: 96
InBcastPkts: 3624
OutBcastPkts: 3624
InOctets: 6169485441
OutOctets: 1766619585
InMcastOctets: 10230
OutMcastOctets: 13600
InBcastOctets: 471120
OutBcastOctets: 471120
11. Visualización del nombre de servicio con PID
Viendo nombre de servicio con su número PID, utilizando la opción netstat -tp mostrará "PID / Program Name".
[javier@localhost ~]$ netstat -tp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:57298 localhost:60918 ESTABLISHED 18460/c:\TeamViewer
tcp 0 0 192.168.1.33:42109 wb-in-f125.:xmpp-client ESTABLISHED 1758/pidgin
tcp 0 0 localhost:60918 localhost:57298 ESTABLISHED 18460/c:\TeamViewer
tcp 0 0 192.168.1.33:56399 mad01s08-in-f21.1:https ESTABLISHED 19158/firefox
tcp 0 1668 192.168.1.33:36714 91.123.100.221:http ESTABLISHED 19015/arora
tcp 0 0 192.168.1.33:39687 db3msgr5011101.ga:https ESTABLISHED 1736/skype
tcp 0 0 localhost:5939 localhost:60862 ESTABLISHED -
tcp 0 0 192.168.1.33:57265 snt-re2-10a.sjc.dr:http ESTABLISHED 1939/dropbox
tcp 0 0 192.168.1.33:45886 91.190.216.58:12350 ESTABLISHED 1736/skype
tcp 0 0 192.168.1.33:33440 server12700.teamvi:5938 ESTABLISHED -
tcp 0 0 localhost:60862 localhost:5939 ESTABLISHED 18460/c:\TeamViewer
tcp 0 0 192.168.1.33:33519 server10011.teamvi:5938 ESTABLISHED -
tcp 0 0 192.168.1.33:57818 213.199.179.171:40024 ESTABLISHED 1736/skype
tcp 0 0 192.168.1.33:53423 server20801.teamvi:5938 ESTABLISHED -
tcp 0 0 192.168.1.33:60936 ec2-23-21-236-70.c:http TIME_WAIT -
[javier@localhost ~]$
12. Viendo modo promiscuo
Viendo modo promiscuo con ac, netstat imprimirá la información seleccionada o actualización de la pantalla cada cinco segundo. Actualización de la pantalla por defecto en cada segundo.
[javier@localhost ~]$ netstat -ac 5 |grep tcp
tcp 0 0 *:24837 *:* LISTEN
tcp 0 0 *:28935 *:* LISTEN
tcp 0 0 *:mysql *:* LISTEN
tcp 0 0 *:rfb *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:37810 *:* LISTEN
tcp 0 0 localhost:5939 *:* LISTEN
tcp 0 0 *:52277 *:* LISTEN
tcp 0 0 192.168.122.1:domain *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 localhost:postgres *:* LISTEN
tcp 0 0 localhost:smtp *:* LISTEN
tcp 0 0 *:db-lsp *:* LISTEN
tcp 0 0 localhost:atmtcp *:* LISTEN
13. Viendo enrutamiento IP del núcleo
Muestra la tabla de enrutamiento del núcleo con netstat y comando de la ruta IP.
[javier@localhost ~]$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr014. Mostrando Transacciones de interfaz de red
Mostrando transacciones de paquetes de interfaz de red que incluye tanto la transferencia y recepción de paquetes con un tamaño de MTU.
[javier@localhost ~]$ netstat -i
Kernel Interface table
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
lo 65536 574951 0 0 0 574951 0 0 0 LRU
p5p1 1500 0 0 0 0 0 0 0 0 BMU
virbr0 1500 0 0 0 0 10 0 0 0 BMU
wlan0 1500 3377395 0 0 0 2038933 0 0 0 BMRU15. Mostrando Kernel Tabla Interface
Mostrando tabla de interfaz del kernel, similar al comando ifconfig.
[javier@localhost ~]$ netstat -ie
Kernel Interface table
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 579093 bytes 1684829120 (1.5 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 579093 bytes 1684829120 (1.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
p5p1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 10:bf:48:07:a5:4f txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:a9:02:00 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10 bytes 2238 (2.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.33 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::c218:85ff:fe90:d1cf prefixlen 64 scopeid 0x20<link>
ether c0:18:85:90:d1:cf txqueuelen 1000 (Ethernet)
RX packets 3392689 bytes 4719599534 (4.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2047759 bytes 213182359 (203.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
16. Visualización de información de IPv4 e IPv6
Muestra la información de pertenencia a un grupo multicast de IPv4 e IPv6.
[javier@localhost ~]$ netstat -g
IPv6/IPv4 Group Memberships
Interface RefCnt Group
--------------- ------ ---------------------
lo 1 all-systems.mcast.net
p5p1 1 all-systems.mcast.net
wlan0 1 224.0.0.251
wlan0 1 all-systems.mcast.net
virbr0 1 224.0.0.251
virbr0 1 all-systems.mcast.net
lo 1 ff02::1
lo 1 ff01::1
p5p1 1 ff02::1
p5p1 1 ff01::1
wlan0 1 ff02::1:ff90:d1cf
wlan0 1 ff02::1
wlan0 1 ff01::1
virbr0 1 ff02::1
virbr0 1 ff01::1
virbr0-nic 1 ff02::1
virbr0-nic 1 ff01::1
17. Imprimir Información Netstat continuamente
Para obtener información netstat cada pocos segundos, a continuación, utilice el comando siguiente, se imprimirá la información netstat continuamente, por ejemplo, cada pocos segundos.
[javier@localhost ~]$ netstat -c
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.1.33:47643 91.123.100.219:http ESTABLISHED
tcp 0 0 192.168.1.33:37996 91.123.100.211:http ESTABLISHED
tcp 0 0 localhost:57298 localhost:60918 ESTABLISHED
tcp 0 0 192.168.1.33:42109 wb-in-f125.:xmpp-client ESTABLISHED
tcp 0 0 localhost:60918 localhost:57298 ESTABLISHED
tcp 0 0 192.168.1.33:37990 91.123.100.211:http ESTABLISHED
tcp 0 0 192.168.1.33:59563 mad01s09-in-f7.1e1:http ESTABLISHED
tcp 0 0 192.168.1.33:56399 mad01s08-in-f21.1:https ESTABLISHED
tcp 0 0 192.168.1.33:47645 91.123.100.219:http ESTABLISHED
tcp 0 0 192.168.1.33:37997 91.123.100.211:http ESTABLISHED
tcp 0 0 192.168.1.33:39687 db3msgr5011101.ga:https ESTABLISHED
tcp 0 0 localhost:5939 localhost:60862 ESTABLISHED
tcp 0 0 192.168.1.33:57265 snt-re2-10a.sjc.dr:http ESTABLISHED
tcp 0 0 192.168.1.33:45886 91.190.216.58:12350 ESTABLISHED
tcp 0 0 192.168.1.33:33440 server12700.teamvi:5938 ESTABLISHED
tcp 0 0 localhost:60862 localhost:5939 ESTABLISHED
tcp 0 0 192.168.1.33:33519 server10011.teamvi:5938 ESTABLISHED
tcp 0 0 192.168.1.33:57818 213.199.179.171:40024 ESTABLISHED
18. Encontrar direcciones no soportadas
Encontrar familias de direcciones sin configurar con alguna información útil.
[javier@localhost ~]$ netstat --verbose
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.1.33:60964 ec2-23-21-236-70.c:http ESTABLISHED
tcp 0 0 192.168.1.33:60965 ec2-23-21-236-70.c:http TIME_WAIT
tcp 0 0 localhost:57298 localhost:60918 ESTABLISHED
tcp 0 0 192.168.1.33:42109 wb-in-f125.:xmpp-client ESTABLISHED
tcp 0 0 localhost:60918 localhost:57298 ESTABLISHED
tcp 0 0 192.168.1.33:59563 mad01s09-in-f7.1e1:http TIME_WAIT
tcp 0 0 192.168.1.33:56399 mad01s08-in-f21.1:https ESTABLISHED
tcp 0 0 192.168.1.33:60963 ec2-23-21-236-70.c:http ESTABLISHED
19. Encontrar programas de escucha
Averigüe cuántos escuchar programas que se ejecutan en un puerto.
[javier@localhost ~]$ netstat -ap|grep http
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 192.168.1.33:60964 ec2-23-21-236-70.c:http ESTABLISHED 19158/firefox
tcp 0 0 192.168.1.33:60965 ec2-23-21-236-70.c:http TIME_WAIT -
tcp 0 0 192.168.1.33:56399 mad01s08-in-f21.1:https ESTABLISHED 19158/firefox
tcp 0 0 192.168.1.33:60963 ec2-23-21-236-70.c:http ESTABLISHED 19158/firefox
tcp 8640 0 192.168.1.33:47645 91.123.100.219:http ESTABLISHED 19015/arora
tcp 0 0 192.168.1.33:39687 db3msgr5011101.ga:https ESTABLISHED 1736/skype
tcp 0 0 192.168.1.33:57265 snt-re2-10a.sjc.dr:http ESTABLISHED 1939/dropbox
tcp6 0 0 [::]:http [::]:* LISTEN -
tcp6 0 0 [::]:https [::]:* LISTEN -
20. Visualización de estadísticas de red RAW
[javier@localhost ~]$ netstat --statistics --raw
Ip:
4077397 total packets received
0 forwarded
0 incoming packets discarded
4076124 incoming packets delivered
2694436 requests sent out
144 dropped because of missing route
4 reassemblies required
1 packets reassembled ok
Icmp:
218 ICMP messages received
0 input ICMP message failed.
ICMP input histogram:
destination unreachable: 218
60 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:
destination unreachable: 60
IcmpMsg:
InType3: 218
OutType3: 60
UdpLite:
IpExt:
InNoRoutes: 1
InMcastPkts: 74
OutMcastPkts: 98
InBcastPkts: 3696
OutBcastPkts: 3696
InOctets: 6533896094
OutOctets: 1889074772
InMcastOctets: 10358
OutMcastOctets: 13728
InBcastOctets: 480480
OutBcastOctets: 480480
Eso es todo, si usted está buscando para obtener más información y opciones sobre comando netstat, consulte netstat manual de documentos o utilizar el comando netstat hombre para conocer toda la información. Si nos hemos perdido algo en la lista, por favor infórmenos con nuestra sección de comentarios a continuación. Así, podríamos mantener la actualización de esta lista en base a sus comentarios.