linux - 在 Linux 上创建新的以太网 USB 网络接口(interface)

标签 linux usb ethernet

我正在尝试在我的计算机上创建一个基于 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.

所以从理论上讲,这应该是可能的,我只需要一些帮助或在正确的方向上轻轻插入一下,让这件事顺利进行。我试图做的是将 USB 转以太网加密狗/适配器插入我的计算机,我周围有几个这样的东西,但这根本帮不了我。

最佳答案

这是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/ )

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

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

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

关于linux - 在 Linux 上创建新的以太网 USB 网络接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48045537/

相关文章:

c# - 创建一个 nuget 在 linux 和 windows 之间共享

linux - 了解系统日志

python - 如何从 GitLab 下载单个文件?

android - 确定使用了哪个 USB 端口

linux - 为什么不同的 PCI 插槽使用相同的设备序列号?

linux - 网络命名空间和桥接

linux - Android Studio 无法更新

c - 在不同函数的回调中使用函数

usb - 如何在没有用户手势的情况下重新连接到 USB 设备?

linux - 如何使用 "system call"确定 linux 上的以太网状态?