自己的台式机使用的是无线网卡,使用nethogs时候出现一下错误:
ioctl failed while establishing local IP for selected device eth0. You may specify the device on the command line.
这个意思的是eth0设备没有分配IP地址,无法监控流量。原因是使用的是无线网卡, ifconfig
eth0 Link encap:Ethernet HWaddr 18:03:73:31:97:19
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:20 Memory:e1500000-e1520000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:31049 errors:0 dropped:0 overruns:0 frame:0
TX packets:31049 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3963939 (3.9 MB) TX bytes:3963939 (3.9 MB)
wlan1 Link encap:Ethernet HWaddr c8:3a:35:cd:86:a6
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::ca3a:35ff:fecd:86a6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1498604 errors:0 dropped:0 overruns:0 frame:0
TX packets:1467841 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:519141678 (519.1 MB) TX bytes:1276239936 (1.2 GB)
因此 要监控wlan1的网卡才行,使用nethogs制定设备即可,
nethogs wlan1