在 Linux 上创建新的以太网 USB 网络接口

Create new ethernet usb network interface on Linux

我想在我的电脑上创建一个基于 usb 的以太网设备,基本上我想告诉我的电脑(linux)它的一个 usb 端口实际上是一个以太网端口。我进行了广泛的研究,虽然这应该是可能的,但我找不到 运行.

的任何代码/命令示例

根据维基百科:

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.

所以从理论上讲,这应该是可能的,我只需要一些帮助或在正确的方向上轻轻推动一下,让这件事顺利进行。我 NOT 想做的是将 USB 转以太网 dongle/adapter 插入我的电脑,我周围有几个这样的东西,但这根本帮不了我.

这是ethernet-over-usb

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

没有外部硬件你可以尝试CDCether内核模块和ethtool(然后你只能连接到在usb设备模式下运行的usb设备)

( 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/ )

否则您需要一个物理适配器。适配器在协议和不同的硬件接口之间进行转换。

在 usb 协议中只能是 一个 网络中的主机,因此如果你想,你至少需要一根主机到主机电缆 ( http://www.linux-usb.org/usbnet/ )连接两个usb主机设备,即两台

使用物理适配器时所需的内核模块(驱动程序)是 usbnet(及其微型驱动程序)或 usb-eth