使用 netstat 命令的 -f 选项可查看与特定地址族的包传输相关的统计信息。
查看 IPv4 或 IPv6 包传输的统计信息。
$ netstat -f inet | inet6 |
要查看 IPv4 传输信息,请键入 inet 作为 netstat -f 的参数。使用 inet6 作为 netstat -f 的参数可查看 IPv6 信息。
以下示例显示了 netstat -f inet 命令的输出。
TCP: IPv4 Local Address Remote Address Swind Send-Q Rwind Recv-Q State -------------------- -------------------- ----- ------ ----- ------ ------- host58.734 host19.nfsd 49640 0 49640 0 ESTABLISHED host58.38063 host19.32782 49640 0 49640 0 CLOSE_WAIT host58.38146 host41.43601 49640 0 49640 0 ESTABLISHED host58.996 remote-host.login 49640 0 49206 0 ESTABLISHED |
以下示例显示了 netstat - f inet6 命令的输出。
TCP: IPv6 Local Address Remote Address Swind Send-Q Rwind Recv-Q State If ------------------ ------------------------- ----- ------ ----- ------ --------- ----- localhost.38065 localhost.32792 49152 0 49152 0 ESTABLISHED localhost.32792 localhost.38065 49152 0 49152 0 ESTABLISHED localhost.38089 localhost.38057 49152 0 49152 0 ESTABLISHED |