About netstat commnd

This command is awesome, we can use it conveniently to check the network status.

Here some common examples:

1)    netstat display the current IP port status.

2) netstat -nr display the routing tables

Parameter tables:

-a Displays all active connections and the TCP and UDP ports on
which the computer is listening.
-b(Windows) Displays the binary (executable) program‘s name involved in creating each connection or listening port. (Windows XP, 2003 Server and newer Windows operating systems; not Microsoft
Windows 2000 or older).
-b (OS X, NetBSD) Causes -i to report the total number of bytes of traffic.
-e Displays ethernet statistics, such as the number
of bytes and packets sent and received. This parameter can be combined with -s.
-f(Windows) Displays fully qualified domain names <FQDN>
for foreign addresses (only available on Windows Vista and newer operating systems).
-f Address Family(FreeBSD) Limits display to a particular socket address family, unixinetinet6
-g Displays multicast group membership information for both IPv4 and IPv6 (may only be available on newer operating systems)
-i Displays network interfaces and their statistics (not available under Windows)
-m Displays the memory statistics for the networking code (STREAMS statistics on Solaris).
-n Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.
-o(Windows) Displays active TCP connections and includes the process ID (PID) for each connection. You can find the application based on the PID on theProcesses tab in Windows Task Manager. This
parameter can be combined with -a, -n, and -p. This parameter is available on Microsoft Windows XP, 2003 Server (and Windows 2000 if a hotfix is applied).[6]
-p protocol(Windows andBSD) Shows connections for the protocol specified by protocol. In this case, protocol can be tcp, udp, tcpv6, or udpv6. If this parameter is used with -s to
display statistics by protocol, protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6.
-p (Linux) Show which processes are using which sockets (similar to -b under Windows) (you must be root to do this)
-P protocol(Solaris) Shows connections for the protocol specified by protocol. In this case, protocol can be ip, ipv6, icmp, icmpv6, igmp, udp, tcp, or rawip.
-r Displays the contents of the IP routing
table
. (This is equivalent to the route print command under Windows.)
-s Displays statistics by protocol. By default, statistics are shown for the TCPUDPICMP,
and IP protocols. If the IPv6 protocol for Windows XP is installed, statistics are shown for the TCP over IPv6,
UDP over IPv6, ICMPv6, and IPv6 protocols. The -p parameter can be used to specify a set of protocols.
-t (Linux) Display only TCP connections.
-W(FreeBSD) Display wide output - doesn‘t truncate hostnames or IPv6 addresses
-v(Windows) When used in conjunction with -b it will display the sequence of components involved in creating the connection or listening port for all executables.
Interval Redisplays the selected information every Interval seconds. Press CTRL+C to stop the redisplay. If this parameter is omitted, netstat prints the selected information only once.
-h (unix)

/?(windows)

Displays help at the command prompt.
时间: 2024-08-04 22:11:40

About netstat commnd的相关文章

linux常用命令--netstat

简介 Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接等等. 常用参数 -a (all)显示所有选项,提示:LISTEN和LISTENING的状态只有用-a或者-l才能看到-t (tcp)仅显示tcp相关选项-u (udp)仅显示udp相关选项-n 拒绝显示别名,能显示数字的全部转化成数字.-l 仅列出有在 Listen (监听) 的服務状态 -p 显示建立相关链接的程序名-r 显示路由信息,路由

netstat状态详解

一.生产服务器netstat tcp连接状态................................................................................ 2 1.1生产服务器某个业务LVS负载均衡上连接状态数量............................................... 2 1.2生产服务器某个业务web上连接状态数量...............................................

netstat状态

Netstat 状态分析 Netstat状态分类 用netstat -an命令查看!再stat下面有一些英文,简单说一下这些英文具体都代表什么: LISTEN:(Listening for a connection.)侦听来自远方的TCP端口的连接请求 SYN-SENT:(Active; sent SYN. Waiting for a matching connection request after having sent a connection request.)再发送连接请求后等待匹配的

linux下netstat --timers / -o详解及keepalive相关

在linux查看网络连接数或者网络状态,我一般用netstat或者lsof这两种,netstat的话有个时间计时功能,里面涉及到不少tcp/ip协议的知识,今天就来说一说我理解的netstat计时功能. netstat -altpno 或者 netstat -altpn --timers,看显示结果: Proto Recv-Q Send-Q Local Address    Foreign Address   State  PID/Program name  Timer 可以看到显示的标题,多出

linux下netstat --timers / -o详解及keepalive相关 2

在linux查看网络连接数或者网络状态,我一般用netstat或者lsof这两种,netstat的话有个时间计时功能,里面涉及到不少tcp/ip协议的知识,今天就来说一说我理解的netstat计时功能. netstat -altpno 或者 netstat -altpn --timers,看显示结果: Proto Recv-Q Send-Q Local Address    Foreign Address   State  PID/Program name  Timer 可以看到显示的标题,多出

六、Linux/UNIX操作命令积累【kill、netstat、df、du】

在使用Linux/UNIX下,经常会使用文本界面去设置系统或操作系统,作者本人在工作的过程也在不断接触这方面的命令,所以为此特酝酿.准备.开始了本文的编写.本文主要记录自己平时遇到的一些Linux/UNIX下操作命令,记录与整理一下,一可加深印象,二可记录分享.希望各位看官,对于不合适的或有歧义的地方,给予指明与说明,以便共同学习与提高. [转载使用,请注明出处:http://blog.csdn.net/mahoking] 023 kill命令:查看进程及杀死进程 查看进程使用ps命令,本例演示

Netstat命令详解(windows下)

转自:http://blog.csdn.net/hsd2012/article/details/50759017 Netstat 用于显示与IP .TCP .UDP 和ICMP 协议相关的统计数据,一般用于检验本机各端口的网络连接情况. 如果你的计算机有时候接收到的数据报导致出错数据或故障,你不必感到奇怪,TCP/IP 可以容许这些类型的错误,并能够自动重发数据报.但如果累计的出错情况数目占到所接收的IP 数据报相当大的百分比,或者它的数目正迅速增加,那么你就应该使用Netstat 查一查为什么

zabbix3.0 使用SS代替netstat无需脚本,1分钟搞定TCP状态监控

这段时间一直忙,没时间好好理下监控,趁着假期有时间,理了一下. 对于zabbix监控TCP状态,在网上查了很多资料,大多数都是使用netstat命令来实现. 如果服务器的压力小,链接少,不会有问题,但随着服务器压力和链接数的增加,用netstat就会造成执行速度慢,server端无法接收到执行结果,造成监控异常. 平时一直用SS,所以试着用SS代替netstat,速度快了不少. 个人较喜欢偷懒,看到网上很多少写了非常长的脚本,又是函数,又是写临时文件的.其实完全没必要,不用写啥脚本,临时文件,很

linux中netstat命令

netstat命令:查询网络状态 查看本机启用的端口: netstat  -an -tuln -a  查看所有的连接和监听端口 -n  显示IP地址和端口号,而不显示域名和服务名 -l  查看监听端口 -t  列出TCP协议端口,只有TCP有监听状态(listen) -u  列出UDP协议端口 netstat -an | grep ESTABLISHED  查看正在连接的ip    ,加 | wc 就可以显示连接数 netstat -rn  一般用来查看网关(最后一行第二个) route   -