我有 4g 调制解调器,它应该可以通过 工作rndis
。将其插入 USB 后,我得到了这些网络接口:
- enp0s29f2u1
- eth0
但是我无法配置它。
完成后,eject -t cdrom
我得到另一个接口:enp0s29f2u2。我可以配置它。
所以现在我有:
[root@nethvo ~]# ifconfig enp0s29f2u2
enp0s29f2u2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.2 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::ae50:43ff:fe6f:d8eb prefixlen 64 scopeid 0x20<link>
ether ac:50:43:6f:d8:eb txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 3593027 dropped 0 overruns 0 frame 3593027
TX packets 2126 bytes 212899 (207.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@nethvo ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 84.204.31.121 0.0.0.0 UG 0 0 0 enp2s0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s29f2u2
10.0.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 enp0s29f2u2
84.204.31.120 0.0.0.0 255.255.255.248 U 0 0 0 enp2s0
84.204.31.121 0.0.0.0 255.255.255.255 UH 0 0 0 enp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 enp1s9
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 enp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1005 0 0 wlp1s10
169.254.0.0 0.0.0.0 255.255.0.0 U 1010 0 0 enp0s29f2u2
192.168.46.0 0.0.0.0 255.255.255.0 U 0 0 0 enp1s9
192.168.47.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp1s10
192.168.140.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0
[root@nethvo ~]# ping -c 2 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
From 10.0.0.2 icmp_seq=1 Destination Host Unreachable
From 10.0.0.2 icmp_seq=2 Destination Host Unreachable
--- 10.0.0.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1001ms
pipe 2
[root@nethvo ~]# telnet 10.0.0.1 80
Trying 10.0.0.1...
telnet: connect to address 10.0.0.1: No route to host
缺什么?
来自日志消息的更新:
Jun 26 15:51:10 nethvo kernel: rndis_host 3-2:1.0 enp0s29f2u2: unregister 'rndis_host' usb-0000:00:1d.2-2, RNDIS device
Jun 26 15:51:10 nethvo avahi-daemon[642]: Withdrawing workstation service for enp0s29f2u2.
Jun 26 15:51:10 nethvo kernel: usb 3-2: reset full-speed USB device number 4 using uhci_hcd
Jun 26 15:51:10 nethvo kernel: rndis_host 3-2:1.0: RNDIS init failed, -71
Jun 26 15:51:10 nethvo kernel: rndis_host: probe of 3-2:1.0 failed with error -71
答案1
rndis 仅适用于 Windows,因为它是 MSFT 专有驱动程序。除非您很幸运并设法找到 ASIX 或同等产品的通用芯片组驱动程序,并且该驱动程序足够接近以将其视为“usbnet”设备,否则您将无法轻松地在 Centos 上配置它。根据我的经验,这也经常失败,但至少可以让您使用 ethtool 和 ifconfig 来获取更多详细信息,即使您无法 ping 或使用 tcpdump 跟踪它。