4

I'm trying to create a usb based ethernet device on my computer, basically I want to tell my computer (linux based) that one of its usb ports is actually an ethernet port. I have done extensive research and while it's supposed to be possible, I can't find any examples of code / commands to run.

According to wikipedia:

The USB-eth module in Linux makes the computer running it a variation of an Ethernet device that uses USB as the physical medium. It creates a Linux network interface, which can be assigned an IP address and otherwise treated the same as a true Ethernet interface. Any applications that work over real Ethernet interfaces will work over a USB-eth interface without modification, because they can't tell that they aren't using real Ethernet hardware.

So in theory, this should be possible, I just need some help or a gentle nudge in the right direction to get this thing rolling. What I'm NOT trying to do is plug a usb to ethernet dongle/adapter into my computer, I have several of those lying around and that doesn't help me out at all.

joel
  • 117
  • 1
  • 2
  • 8
  • 3
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Dec 31 '17 at 20:51
  • Why not just use a dummy interface? – Turbo J Dec 31 '17 at 22:07
  • @Turbo J - I saw that during my research, but isn't that like a loopback interface? It's addressable, but I can't actually route traffic out of it, correct? – joel Jan 01 '18 at 01:11
  • You cannot route traffic out of your "virtual" USB ethernet port either. You would need a physical interface for that. Programs like tcpdump work on dummy interfaces. – Turbo J Jan 01 '18 at 13:56
  • If you want an Ethernet interface with no attached hardware, look at "tun/tap". – Ben Voigt Jan 02 '18 at 16:04

1 Answers1

2

this is ethernet-over-usb

https://en.wikipedia.org/wiki/Ethernet_over_USB

without external hardware you can try the CDCether kernel module and ethtool ( then you can only connect to a usb device that operates in usb device mode )

( https://developer.ridgerun.com/wiki/index.php/How_to_use_USB_device_networking , http://tldp.org/HOWTO/Motorola-Surfboard-Modem/usb.html, http://www.linux-usb.org/usbnet/ )

else you need a physical adapter for this. the adapter translates between the protocols and the different hardware interfaces.

in usb protocol can only be one host in a network, therefore you need at least a host-to-host cable ( http://www.linux-usb.org/usbnet/ ) if you want to connect two usb host devices, i.e. two pcs

required kernel module ( driver ) when using a physical adapter is either usbnet ( with its minidrivers ) or usb-eth

ralf htp
  • 9,149
  • 4
  • 22
  • 34