Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:user-guide:network:wan:ethernetoverusb_rndis [2018/03/03 16:49] – ↷ Links adapted because of a move operation bobafetthotmaildocs:guide-user:network:wan:wwan:ethernetoverusb_rndis [2024/12/04 09:55] – [Setting up RNDIS-based dongles] andrewz
Line 1: Line 1:
 ====== Use RNDIS USB Dongle for WAN connection ====== ====== Use RNDIS USB Dongle for WAN connection ======
  
-[[https://en.wikipedia.org/wiki/RNDIS|RNDIS]] (Remote Network Driver Interface Specification) is [[https://en.wikipedia.org/wiki/Ethernet_over_USB|ethernet over USB]] protocol used by some fast speed USB modems/dongles.+[[https://en.wikipedia.org/wiki/RNDIS|RNDIS]] (Remote Network Driver Interface Specification) is [[https://en.wikipedia.org/wiki/Ethernet_over_USB|Ethernet over USB]] protocol used by some USB modems.
  
-For more more information about different protocols used: +The same applies to external modems connected to USB ports ("dongles"and internal models installed into M.2(NGFF) or mPCIe slots.
-  * **ppp**, see [[docs:user-guide:network:wan:3gdongle|How to use 3g/UMTS USB Dongle for WAN connection]] +
-  * **qmi** and **mbim**, see [[docs:user-guide:network:wan:ltedongle|How To use LTE modem in QMI mode for WAN connection]] +
-  * **ncm**, see [[docs:user-guide:network:wan:ethernetoverusb_ncm|How To use LTE modem in NCM mode for WAN connection]]+
  
-===== Setting up RNDIS-based dongles =====+Note from [[https://github.com/torvalds/linux/blob/master/drivers/net/usb/rndis_host.c|rndis_host Linux driver source code]]:
  
-(This section is based on experience with Bleeding Edge r47548 from December of 2015 on a wt3020 and connecting to an Alcatel Onetouch L850.).+> USE OF RNDIS IS STRONGLY DISCOURAGED in favor of such non-proprietary alternatives as CDC Ethernet or the newer (and currently rare) "Ethernet Emulation Model" (EEM).
  
-For rndis devicesonly a limited subset of packages are necessary (besides the base USB packagesthat are most likely already contained in the base image):+It is also used by many USB3.0-GigabitEthernet-Adapters like the TP-Link UE300 and all Chinese low-cost ones you can buy on ebayetc. It is one of the ways these gigabit ethernet dongles use to be "plug and play" or "driverless"by conforming to RNDIS standard so they don't need a special driver just for themselves. These dongles lack any kind of web interface or settings, they are just usb-to-ethernet adapters, nothing more.
  
 +Worth to add, the same protocol is widely used for [[docs:guide-user:network:wan:smartphone.usb.tethering|smartphone tethering]], so the same instructions are usually applicable for that use case as well.
 +
 +
 +For more information about other protocols commonly used:
 +  * **QMI** and **MBIM**, see [[docs:guide-user:network:wan:wwan:ltedongle|How to use LTE modem in QMI mode for WAN connection]]
 +  * **NCM**, see [[docs:guide-user:network:wan:wwan:ethernetoverusb_ncm|How to use LTE modem in NCM mode for WAN connection]]
 +  * **ECM**, see [[docs:guide-user:network:wan:wwan:ethernetoverusb_cdc|Use cdc_ether driver based dongles for WAN connection]]
 +  * **PPP**, see [[docs:guide-user:network:wan:wwan:3gdongle|How to use 3g/UMTS USB Dongle for WAN connection]]
 +
 +===== Setting up RNDIS-based dongles =====
 +
 +For RNDIS device to work ''kmod-usb-net-rndis'' package needs to be installed. Install it either in Luci → System → Software or via command line:
 <code> <code>
-opkg update +root@OpenWrt:~# opkg update 
-opkg install kmod-usb-net-rndis usb-modeswitch+root@OpenWrt:~# opkg install kmod-usb-net-rndis
 </code> </code>
  
-kmod-usb-net-rndis will also install kmod-mii, kmod-usb-net, kmod-usb-net-cdc-ether and kmod-usb-net-rndis as dependencies.+Additional modules will be automatically installed as //dependencies//
 + 
 +You can also add the necessary packages when building a new image with [[https://firmware-selector.openwrt.org/|Firmware Selector]]. 
 + 
 +Install ''usb-modeswitch'' __only if__ that is needed for switching the modem into a "working" state. More about: [[docs:guide-user:network:wan:wwan:usb-modeswitching|USB mode switch]] 
  
-After installing the packages and connecting the USB stick, the following should appear in dmesg:+After installing the packages and connecting the USB stick, the following should appear in ''dmesg'' output:
  
 <code> <code>
Line 30: Line 44:
 </code> </code>
  
-You can verify the interface details on the new usb0 network interface by running ''ifconfig usb0''.+Note the interface name (''usb0'') mentioned on the last line, it will be used later. For another modem the name could be ''eth3'' or something like that.
  
-If the USB stick will be your only WAN connection, then the easiest way to set up the automatic connection is to change /etc/config/network to be something like: +If the USB stick will be your only WAN connection, then the easiest way to set up the automatic connection is to change ''/etc/config/network'' to be something like: 
  
 <code> <code>
Line 42: Line 56:
 (you need to reboot or restart the network subsystem with ''/etc/init.d/network restart'' afterwards) (you need to reboot or restart the network subsystem with ''/etc/init.d/network restart'' afterwards)
  
-Since RNDIS-based sticks create their own NATted IP subnet, it is important that OpenWRT'local IP range is different from the 4G stick's IP range. In the case of the Alcatel L850, the default range is 192.168.1.1, which clashes with OpenWRT's default. Therefore OpenWRT's LAN IP should be changed to something else, such as:+:!: Since RNDIS-based sticks create their own NAT'ed IP subnet, it is important that OpenWrt'LAN IP range is different from the modem's IP range. For some modems the default range is 192.168.1.1, which clashes with OpenWrt's default. Therefore OpenWrt's LAN IP should be changed to something else, such as:
  
 <code> <code>
 config interface 'lan' config interface 'lan'
-        option ipaddr '10.10.10.1'+        option ipaddr '192.168.10.1'
 </code> </code>
  
-If auto-connect is disabled, or PIN-request is enabled on the 4G stick, you may have to visit the dongle's admin web interface (typically 192.168.1.1) to enter the PIN or initiate the 4G connection. You can do this from your PC connected to the OpenWRT wifi.+==== Additional steps ====
  
-=== RNDIS Troubleshooting ===+For some modems adding an interface will be sufficient, but others may need an APN provisioned, it is also sometimes necessary to send a special "dial" command to the AT command port, consult AT Commands Guide for the given modem for details. If this is the case it is worth trying to configure the [[docs:guide-user:network:wan:wwan:ethernetoverusb_ncm|NCM]] interface instead.
  
-If you only see the usb messages, but not the rndis_host messages, then modesetting may be at fault.+If the modem exposes //serial// interfaces then the appropriate driver needs to be installed (''kmod-usb-serial'' or ''kmod-usb-serial-option'' or ''kmod-usb-serial-qualcomm'' or ''kmod-usb-acm'') as well as a simple //terminal// app like ''picocom''. More about: sending [[docs:guide-user:network:wan:wwan:at_commands|AT commands]] from the router.
  
-Checking /sys/kernel/debug/usb/devices , the device should look like this:+If auto-connect is disabled, or PIN-request is enabled on the modem, you may need to visit its admin web interface (typically at ''http://192.168.1.1'') to enter the PIN and/or initiate the connection. 
 + 
 +==== RNDIS Troubleshooting ==== 
 + 
 +If you only see the USB messages, but not the rndis_host messages, then //modeswitching// may be at fault. 
 + 
 +Checking with ''cat /sys/kernel/debug/usb/devices'', the device section should look like this:
  
 <code> <code>
Line 95: Line 115:
  
  
-=== RNDIS Security Note ===+==== RNDIS Security Note ====
  
 :!: Leaving your RNDIS-based dongle admin web interface available to LAN users might not be something you would like to do, as there is usually no authentication mechanism there. :!: Leaving your RNDIS-based dongle admin web interface available to LAN users might not be something you would like to do, as there is usually no authentication mechanism there.
-To protect it, you can add the following rule to Network->Firewall->Custom Rules:+To protect it, you can add the following rule to Network->Firewall->Custom Rules (obsolete, needs to be converted to ''nftables'' rules):
  
 <code> <code>
Line 104: Line 124:
 </code> </code>
  
-Now, if you need to access your dongle web interface, log in to your OpenWRT box with:+Now, if you need to access your dongle web interface, log in to your OpenWrt box with:
  
 <code> <code>
Line 111: Line 131:
  
 and point your browser to http://localhost:8080. and point your browser to http://localhost:8080.
 +
  • Last modified: 2024/12/14 23:42
  • by andrewz