1. 程式人生 > >netstat和lsof查看網絡狀態

netstat和lsof查看網絡狀態

AC lan mark all inter 接口 misc 組播 mode

netstatlsof都是linux下的工具,可以用於查看系統的網絡狀態。

netstat

-i 顯示接口表,也就是eth0,wlan0這些
-r 顯示路由表,和命令$route顯示的一樣
-g 顯示組播

  • $netstat -r
    顯示路由表,Flag的意思如下

    A Receive all multicast at this interface.
    B OK broadcast.
    D Debugging ON. 
    M Promiscuous Mode.
    O No ARP at this interface.
    P P2P connection at this interface. 
    R Interface is running. 
    U Interface is up. 
    G Not a direct entry.

netstat和lsof查看網絡狀態