- Use RNDIS USB Dongle for WAN connection
- Setting up RNDIS-based dongles
- RNDIS Troubleshooting
- RNDIS Security Note
- Building image with support for 3g/4g and usb tethering
- Preparing build environment
- Configuring packages
- Selecting target architecture and profile
- Selecting kernel modules for usb networking support.
- Additional packages required for 3g functionality
- ppp, chat, and uqmi
- comgt and usb-modeswitch
- minicom, picocom, and screen
- Web Interface Support
- Build process
- Smartphone USB tethering
- Introduction
- Instructions
- 1. Installation
- 2. Smartphone
- 3.a Command-line interface
- 3.b Web interface
- Troubleshooting
- Use 3g/UMTS USB Dongle for WAN connection
- настройка Openvrt + мобила в качестве инета по USB кабелю
Use RNDIS USB Dongle for WAN connection
RNDIS (Remote Network Driver Interface Specification) is ethernet over USB protocol used by some fast speed USB modems/dongles.
It is also used by many USB3.0-GigabitEthernet-Adapter like the TP-Link UE300 and all chinese low-cost ones I bought on ebay. 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 interface or settings, they are just usb-to-ethernet adapters, nothing more.
For more more information about different protocols used:
Setting up RNDIS-based dongles
(This section is based on experience with Bleeding Edge r47548 from December of 2015 on a wt3020 and connecting to an Alcatel Onetouch L850.).
For rndis devices, only a limited subset of packages are necessary (besides the base USB packages, that are most likely already contained in the base image):
kmod-usb-net-rndis will also install kmod-mii, kmod-usb-net, kmod-usb-net-cdc-ether and kmod-usb-net-rndis as dependencies.
After installing the packages and connecting the USB stick, the following should appear in dmesg:
You can verify the interface details on the new usb0 network interface by running ifconfig usb0 .
(you need to reboot or restart the network subsystem with /etc/init.d/network restart afterwards)
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.
RNDIS Troubleshooting
If you only see the usb messages, but not the rndis_host messages, then modesetting may be at fault.
Checking /sys/kernel/debug/usb/devices , the device should look like this:
and not like this:
(note the number of interfaces “#Ifs=” and the “ProdID=”)
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. To protect it, you can add the following rule to Network→Firewall→Custom Rules:
Now, if you need to access your dongle web interface, log in to your OpenWRT box with:
and point your browser to http://localhost:8080.
- Last modified: 2021/03/28 04:51
- by mwynn
Self-registration in the wiki has been disabled.
If you want to contribute to the OpenWrt wiki, please post HERE in the forum or ask on IRC for access.
Except where otherwise noted, content on this wiki is licensed under the following license:
CC Attribution-Share Alike 4.0 International
Источник
Building image with support for 3g/4g and usb tethering
Preparing build environment
First of all, you need a complete build environment, either physical or virtual system, as described on the OpenWrt developer guide.
You need to clone OpenWrt git repository on your build system and synchronize all package feeds with your config file.
Be sure to understand the build procedure to prevent build failure.
Configuring packages
Selecting target architecture and profile
Run make menuconfig .
Select your architecture on which you would put your compiled OpenWrt image. Then select your target profile, according your hardware type.
If you have selected correct value for target system, target profile, and target images, go to next step.
Selecting kernel modules for usb networking support.
Go to Kernel Modules → USB Support .
Select the following modules by pressing y to include the modules within the compiled image.
kmod-usb-net → to support usb networking interface.
Select all subsets if you want perfect support for usb network interfaces, including Android and iPhone tethering. Some newer 4g dongles use usb network interface (rndis) instead of legacy serial protocol.
kmod-usb-serial → to support legacy 3g dongles.
Select all subsets to ensure that your dongle works. Most 3g dongles use the option driver or generic serial driver to work. Note that option driver has better capability of distinguishing between modem serial interfaces and storage interface than generic usb serial driver.
Additional packages required for 3g functionality
ppp, chat, and uqmi
Go to Network section. Select `uqmi` to support qmi interface and `ppp` to support standard point-to-point protocol. chat is needed to establish serial communication to prepare PPP link negotiation.
Some dongles are using mbim protocol. To make use of mbim protocol, install umbim package.
comgt and usb-modeswitch
Go to Utilities section. Select comgt to provide control over 3g interface and usb-modeswitch to provide mode switching between virtual cd-rom interface to serial interface.
minicom, picocom, and screen
If you want to debug serial communication, you may want to install serial terminal. There are several choices of serial terminal, such as minicom, picocom, and screen. I recommend picocom because of its small size.
Screen can be used as persistent session manager. Minicom has a nice interface, optimized for serial communication.
For devices with 4MB flash, picocom is the only serial terminal that can be installed.
Web Interface Support
If you want to control your 3g dongle with Luci web interface, go to Luci.
Build process
Continue selecting packages as needed. When you are done, run the build process
Faster build time can be achieved by enabling multiple build jobs. In case of quad-core cpu.
If build process is successful, your firmware images will be located on bin/target-platform/ .
If your hardware-specific image name could not be found, it’s possible that you added too many packages that don’t fit your hardware flash memory. Try reducing packages and restart the build process if such case happens.
- Last modified: 2018/03/03 15:25
- by 188.166.177.185
Self-registration in the wiki has been disabled.
If you want to contribute to the OpenWrt wiki, please post HERE in the forum or ask on IRC for access.
Except where otherwise noted, content on this wiki is licensed under the following license:
CC Attribution-Share Alike 4.0 International
Источник
Smartphone USB tethering
This article relies on the following:
Introduction
USB tethering is used to connect your OpenWrt Router to the Internet by using the your smartphone. It’s more convenient and has better performance (lower latency) than turning your smartphone into an access point and using that. It also is less of a CPU load on your phone, charges your phone, and allows you the flexibility of doing things with your OpenWrt router that you cannot do with your phone like connecting multiple devices with ease, both wireless and wired, to each other and to the internet. In order to maximize performance, you should turn your tethered phone Wi-Fi and Bluetooth off.
Instructions
1. Installation
For the easiest installation, have a wired upstream internet connection to boot-strap this process. You will need: the router, your tethering phone, necessary cables, a laptop and an upstream internet connection via Ethernet for initial setup. Instead of a wired upstream connection to plug into the router WAN port, is also possible to download necessary packages below, through your laptop while tethered to your phone, the same way you can get the OpenWrt distribution for your router.
Provide USB tethering support for Android 8/10 with RNDIS:
Extra steps depending on USB type and drivers for your router:
Additional steps for iOS devices:
2. Smartphone
Connect the smartphone to the USB port of the router with the USB cable, and then enable USB Tethering from the Android settings. Turn on the phone’s Developer Options [Find the Build information in the About Phone menu, and tap rapidly 7 x]. There is a Default USB Configuration: USB Tethering option. The phone will now immediately turn on USB Tethering mode when plugged into a configured router [or laptop], without further commands. However, it is necessary to remove the screen lock on the phone. A locked phone will not start USB Tethering by itself.
3.a Command-line interface
On the router, enter:
For IPhones, replace the interface name usb* with eth* depending on router.
It should be all working at this point. To activate wireless connections to the router, go to Network, Wireless and set then enable the interfaces.
3.b Web interface
Instead, to create a whole new interface, make a new one called TetheringWAN, and bind to it the new *usb0* network device (restart if you do not see it yet. And, for some cases, the new interface may be called ‘*eth1*: check what the log is showing in your case). Set the protocol to DHCP client mode or DHCPv6 client mode if the ISP assigns IPv6 , and under the Firewall Settings tab, place it into the WAN zone. Save changes.
See the following screenshots.
First page of the Create Interface wizard.
Firewall tab of the Create Interface Wizard. Very important to set it as WAN .
And the end result in the Interfaces page.
After committing the changes the new TetheringWAN should be activated. Otherwise, restart it with the buttons you find in the Interface page of LuCI web interface.
Troubleshooting
If all went well, you should be able to see something like the following in the kernel log
Note how the last line tells us that this new “RNDIS device” was bound to interface usb0.
The above messages will not be shown with IPhone tethering.
Источник
Use 3g/UMTS USB Dongle for WAN connection
You may also want to checkout the multiwan_package package to use this simultaneously with other connections to the internet.
Cellular mobile telephony can be intercepted very easily. Remember this is a wireless connection.
Many mobile ISPs block certain (or most) ports. Port forwarding will probably not work (as the traffic is blocked by the ISP ‘s firewall).
If you’ve got a Huawei E367 (which will work), or a Huawei E585 (which does not currently work), you may want to read the following tutorial (which includes info on why you may not be able to get the on-board micro-SD card to function): http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=836
If you have the Leadtek FlashOFDM card (Flarion) from T-Mobile in Slovakia and the Asus WL-500g Premium, you may use the image on http://www.accalio.com/index.php?id=301. If you wish to get more information, or another distribution with the driver, please contact Accalio http://www.accalio.com
Some modem sticks provide an usb-ethernet-device (e.g. Huawei “HiLink” — device numbers with ‘h’, but also other manufacturers like ZTE has such products MF823, MF831, …) In that case you should install usb-modeswitch package and follow usb tethering tutorial. Tethering will in most cases add an additional NAT layer. If you prefer to let OpenWRT care about dialing in, routing, NATting, firewalling or if your provider assigns you an external IPv4 (which is most useful for setups, that need port forwarding), you will most likely want to set (“modeswitch”) your 3g/4g modem to act as a serial device.
Serial device modes: If a dongle in permanently configured for serial mode, it is advised not to install usb-modeswitch onto your router device. Modem sticks are commonly equipped with a flash space containing drivers and software and/or provide a slot for a micro-SD-card. These features (like the ‘NO-CD’ feature) can be configured in various ways. These configurations may be stored permanently. In that case a modeswitch will behave in an unpredictable way. A modem stick, that was previously configured as a modem will show up as serial devices (typically /dev/ttyUSB0-2). A default setting in combination with modeswitch may additionally show the sd-card reader. See the Troubleshooting section in this document for further information.
Источник
настройка Openvrt + мобила в качестве инета по USB кабелю
Имеется: китайский 4g маршрутизатор «ZBT-WE3926» в низу прошивки написано «powered by luci trunk svn-r10457», китаец присылал эту прошивку и в имени файла было это «826-T_826-WD_ndis_V1.2_20180629_UPGRADE» возможно это как-то поможет.
c 4g роутер работает отвратно (4g модем встроен), скорость низкая и постоянно скачет пинг, также часто дисконекает по 4g до полной потери пакетов (хотя новая вышка опсоса прямо за домом) видимо модуль 4G поврежден либо его 4G частоты не совпадают с нашими. + оператор блокирует раздачу инета с модемов, хотя это все уже обошел, все равно не устраивает его работа по стабильности.
Но также есть несколько мобил работающих там же с 4G отлично, скорость идеальная около 120-130 мбит по мегафону. Задача: Хотелось бы настроить раздачу интернета на этом роутере по одному из вариантов:
1) Включать режим USB модема на телефоне, подключить телефон к этому роутеру, а дальше раздавать принятый с телефона интернет по Wi-Fi и ethernet кабелю. (заодно и мобила будет заряжаться всегда по этому USB, я так понимаю мне нужен вариант NDIS (возможно я неправ)
2) Включать на телефоне тетеринг расшарив интернет уже по Wi-Fi в режиме точки доступа, далее принимать роутером в режиме клиента и отдавать также далее по кабелю и Wi-Fi.
Второй вариант хотел бы использовать только в крайнем случае если первый вообще никак не работает и нереален! Но очень хочу в идеале первый вариант с кабелем, в доме навалом соседских wi-fi приблуд (около 30-40 сетей, днем меньше, вечером включают больше) и все это сбивает скорость wi-fi и он работает нестабильно, часто вообще отваливается независимо от канала, вобщем беда с Wi-Fi.
Знатоки Openvrt подскажите пожалуйста возможно ли такое и как это организовать в моем случае по первому варианту?
Источник