gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 12:13:40 29 4
gpt4 key购买 nike

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

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com