Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I typed sudo nethogs eth0 in terminal and tried to monitor my internet bandwidth, I got an error ioctl failed while establishing local IP for selected device eth0. You may specify the device on the command line.

This is the output of sudo ip addr:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever

2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen1000 link/ether 20:6a:8a:5d:5d:1c brd ff:ff:ff:ff:ff:ff

3: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc pfifo_fast state UNKNOWNqlen 1000
    link/ether 56:10:e4:e0:61:f1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.10/24 brd 192.168.1.255 scope global usb0
    inet6 fe80::5410:e4ff:fee0:61f1/64 scope link 
       valid_lft forever preferred_lft forever

4: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 20:7c:8f:79:88:ab brd ff:ff:ff:ff:ff:ff
share|improve this question

1 Answer 1

up vote 6 down vote accepted

Usually you get that answer when you try to monitor an interface which has no IP address assigned (probably not connected).

The output from ip addr shows that only one of your interfaces has an IP address, namely usb0.

So sudo nethogs usb0 should finally give the desired result.

share|improve this answer
    
Thanks, it's working now. –  Herks Mar 1 '13 at 13:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.