今天才发现安装了NetworkManager的Linux上都有这么一个命令:nm-tool。这个命令是用来输出NetworkManager程序的状态和设备的,可以方便的查看当前连接的一些状态,包括IP地址、网关、DNS服务器、WLAN关联的BSSID等,非常方便,输出大概如下:

/etc$ nm-tool

NetworkManager Tool

State: connected (global)

- Device: wlan0  [SSID] ------------------------------------------------------
  Type:              802.11 WiFi
  Driver:            rtl8192ce
  State:             connected
  Default:           yes
  HW Address:        ...

  Capabilities:
    Speed:           65 Mb/s

  Wireless Properties
    WEP Encryption:  yes
    WPA Encryption:  yes
    WPA2 Encryption: yes

  Wireless Access Points (* = current AP)
    *SSID:         Infra, BSSID, Freq 2427 MHz, Rate 54 Mb/s, Strength 70 WPA WPA2

  IPv4 Settings:
    Address:         192.168.1.5
    Prefix:          24 (255.255.255.0)
    Gateway:         192.168.1.1

    DNS:             192.168.1.1
    DNS:             8.8.8.8


- Device: eth0 -----------------------------------------------------------------
  Type:              Wired
  Driver:            e1000e
  State:             unavailable
  Default:           no
  HW Address:        ...

  Capabilities:
    Carrier Detect:  yes

  Wired Properties
    Carrier:         off

diabloneo
1.2k 声望180 粉丝