netstat command summary
https://www.cnblogs.com/chenqionghe/p/10654109.html
nestat Introduction
netstat is a command-line tool can be used on all of the listed network socket connection system, comprising tcp, udp and unix socket, while it also listed in the listening state (i.e., waiting for access requests) socket.
Use Parameter Description
And routing related parameters
-r : 列出路由表,功能如route命令
-n : 不使用主机名与服务名称,使用ip与port number,如同route -n
Network interface-related parameters
-a : 列出所有的连接状态,包括tcp/udp/unix socket等
-t : 仅列出tcp数据包的连接
-u : 仅列出udp数据包的连接
-l : 仅列出已在listen(监听)的服务的网络状态 -p : 列出pid进程号与program文件名 -i : 打印网络接口 -g : 显示IPv4和IPv6的多播组信 -c : 可以设置几秒后自动更新一次,例如-c 5为每5s更新一次网络状态 -s : 显示网络统计数据 -e : 显示更多的信息(如用户ID、网卡IP等)
Examples of Use
Table 1 lists the current routing state, ip and port number to show:
netstat -rn
2. List all current network connections, the port number is displayed in ip
netstat -an
3. Display Network service has been launched
netstat -tulnp
4. See all the machine network connection status
netstat -atunp
5. Print statistics
netstat -s
6. Print a network interface
netstat -i
Print a little more detail, similar to ifconfig
netstat -ie
7. continuously monitoring
netstat -ct
The display the multicast group information
-G option will output the multicast group information of IPv4 and IPv6
netstat -g
The printing of the active state is connected
Active state is connected to the socket "ESTABLISHED" field indicates the connection state of the active print
netstat -atnp | grep ESTA
Monitoring active connections with the watch command state:
watch -d -n0 "netstat -atnp | grep ESTA"
10. Review the service is running
http, smtp or ntp service is running, use grep.
netstat -aple | grep http
nestat Introduction
netstat is a command-line tool can be used on all of the listed network socket connection system, comprising tcp, udp and unix socket, while it also listed in the listening state (i.e., waiting for access requests) socket.
Use Parameter Description
And routing related parameters
-r : 列出路由表,功能如route命令
-n : 不使用主机名与服务名称,使用ip与port number,如同route -n
Network interface-related parameters
-a : 列出所有的连接状态,包括tcp/udp/unix socket等
-t : 仅列出tcp数据包的连接
-u : 仅列出udp数据包的连接
-l : 仅列出已在listen(监听)的服务的网络状态 -p : 列出pid进程号与program文件名 -i : 打印网络接口 -g : 显示IPv4和IPv6的多播组信 -c : 可以设置几秒后自动更新一次,例如-c 5为每5s更新一次网络状态 -s : 显示网络统计数据 -e : 显示更多的信息(如用户ID、网卡IP等)
Examples of Use
Table 1 lists the current routing state, ip and port number to show:
netstat -rn
2. List all current network connections, the port number is displayed in ip
netstat -an
3. Display Network service has been launched
netstat -tulnp
4. See all the machine network connection status
netstat -atunp
5. Print statistics
netstat -s
6. Print a network interface
netstat -i
Print a little more detail, similar to ifconfig
netstat -ie
7. continuously monitoring
netstat -ct
The display the multicast group information
-G option will output the multicast group information of IPv4 and IPv6
netstat -g
The printing of the active state is connected
Active state is connected to the socket "ESTABLISHED" field indicates the connection state of the active print
netstat -atnp | grep ESTA
Monitoring active connections with the watch command state:
watch -d -n0 "netstat -atnp | grep ESTA"
10. Review the service is running
http, smtp or ntp service is running, use grep.
netstat -aple | grep http