2

is it possible to get the IP address of a device connected via USB? The device in question is a wireless printer, its connect via USB and WiFi, the printer is assigned an IP address and its displayed on the screen of the printer but I want to get the IP address for the printer via the USB port. I have tried the following:

lsusb -D /dev/bus/usb/001/008

Which gets me pretty much every details possible about the printer apart from the IP address. Any suggestions?

1
  • If the manufacturer didn't see fit to transmit this information over USB, it is unlikely that there is a documented and reliable way to obtain it. Including the make and model of the printer would do wonders for making your question answerable even in theory. – tripleee Mar 27 '15 at 11:32
2

There are four possible situations:

  1. Your printer establishes a network connection and acts as a gateway. You should have a new interface listed by ifconfig (typically usb0), and your printer's address should be available in /proc/net/route

  2. Your printer establishes a network connection and lets your computer configure it via DHCP. You should have a new interface listed by ifconfig, and your printer's IP address is in your computer's DHCP leases.

  3. Your printer establishes a network connection, but neither your computer nor the printer are willing to configure the network. You have a new interface listed by ifconfig, but since there is no communication, it is impossible to know what IP address your printer would pick (aside from looking it up in the documentation).

  4. Your printer connects via USB, but doesn't use Ethernet-over-USB protocol. No IP address then.

PS: practical answer - configure your WIFI router to give a fixed IP address to the printer, then you will be able to connect your printer by WIFI only and you'll always know its IP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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