openwrt 使用 移动WIFI USB RNDIS 上网
最初为了简单,是使用 无线中继方式上网,但是有时不稳定,而移动WIFI 也支持 RNDIS 方式。
打开编译配置以下功能:
Kernel modules ---> -*- kmod-usb-core............................................ Support for USB -*- kmod-usb-net............... Kernel modules for USB-to-Ethernet convertors -*- kmod-usb-net-cdc-ether.............. Support for cdc ethernet connections <*> kmod-usb-net-rndis......................... Support for RNDIS connections <*> kmod-usb-ohci............................... Support for OHCI controllers <*> kmod-usb2................................... Support for USB2 controllers <*> kmod-usb3................................... Support for USB3 controllers -*- kmod-usb-storage..................................... USB Storage support <*> kmod-usb-storage-extras.................... Extra drivers for usb-storage <*> kmod-usb-storage-uas.................... USB Attached SCSI (UASP) support <*> kmod-usb-uhci............................... Support for UHCI controllers Network ---> <*> dhcpcd..................... DHCPv4/IPv4LL/IPv6RS/DHCPv6 quad stack client Utilities ---> <*> tar.............................................................. GNU tar ---> <*> usb-modeswitch................................ USB mode switching utility -*- usbids....................................................... USB ID list <*> usbutils................................... USB devices listing utilities
编译完成后,升级后插入USB 线测试
[ 110.492259] usb 1-1: new high-speed USB device number 2 using xhci-mtk [ 110.675695] usb-storage 1-1:1.0: USB Mass Storage device detected [ 110.683867] scsi host0: usb-storage 1-1:1.0 [ 111.723145] scsi 0:0:0:0: CD-ROM USB SCSI CD-ROM 2.31 PQ: 0 ANSI: 2 [ 111.745418] sd 0:0:0:1: Power-on or device reset occurred [ 111.751451] sd 0:0:0:1: [sda] Media removed, stopped polling [ 111.757987] sd 0:0:0:1: [sda] Attached SCSI removable disk [ 114.725905] usb 1-1: USB disconnect, device number 2 [ 115.272400] usb 1-1: new high-speed USB device number 3 using xhci-mtk [ 115.472810] cdc_ether 1-1:1.0 eth1: register 'cdc_ether' at usb-1e1c0000.xhci-1, XXX CDC Ethernet Device, xx:xx:xx:xx:xx:xx [ 115.489962] usb-storage 1-1:1.2: USB Mass Storage device detected [ 115.522355] scsi host0: usb-storage 1-1:1.2
ifconfig 查看多出来一个 eth1 并且自动获取了IP
eth1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx inet addr:192.168.0.118 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: 0/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:16 errors:0 dropped:0 overruns:0 frame:0 TX packets:19 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1216 (1.1 KiB) TX bytes:2030 (1.9 KiB)
配置网络wan 使用 eth1 选择 DHCP 客户端



浙公网安备 33010602011771号