Connect OpenWrt to WLAN

Hello!

My problem is:

my openWRT does not identify my modemstick, so i have to modify my openWRT

but i cannot do e.g. "opkg update" because of "failed establish connection"

i have a ubuntu-labtop connected to a WLAN-internet, the openWRT modem is connected to the labtop by LAN, the modem is NOT connected to internet, there is no WAN.

how can i establish a connection to internet?

You need to establish some temporarily internet connection to download the required packages, which you then install on your router.

Perhaps, you can use a laptop/PC to connect your modem stick and connect to the Internet, assuming your laptop/PC already has the drivers installed? Otherwise, you may need to take your laptop out, find a public network, download the OpenWrt drivers (or source code), bring them back and install on your router.

hey, i have a wifi-connection with my labtop, so my labtop has internet-connection, i'm connected to the modem by SSH.

but when i enter e.g.

root@OpenWrt:~# opkg update

i get the "failed establish connection" problem

Your OpenWrt router is not aware of the connection from your labtop to wifi/internet.
Basically you have to "bridge" your Wifi connection to LAN.

If you can you could connect your router to your wifi router also.

1 Like

Download packages (*.ipk files) to your laptop, copy them over to the router, and install with opkg install <package> --cache <dir>

If you can you could connect your router to your wifi router also

Blockquote

the wifi router is smartphone (AP), openwrt finds the wifi after scanning, tries to connect several times but fails....

You could also go for the method @savostyanov suggested. If it's only one file or a few. Otherwise bridge your wifi to lan interface.

Another possibility would be to use a USB stick if you router has USB connector. If you don't know how to copy your downloaded files to the router.

EDIT:

scp *.ipk root@192.168.1.1:/tmp
given that you reach your router with the IP above.

Set up a shared connection on the laptop, then use the laptop as a gateway to the internet:

uci -q delete network.wan
uci set network.lan.dns="8.8.8.8 8.8.4.4"
uci set network.lan.gateway="laptop_ip"
uci commit network
/etc/init.d/network restart

thanks!

tying to bridge my wifi connection to LAN:

do you think i also have to make some modification in openWRT

made a terrible mistake, can not connect to my modem anymore

i did not replace "laptop_iP" with my laptop_ip

can i adjust this?

It should not affect LAN connectivity.
In any case, you can access the device via its IPv6 link-local address.

the packages are *.gz

i download them, rename them in *.ipk

copy them to the router and then rename then again before installing?

The packages should normally be *.ipk when you download them. Could you explain where you got them from?

Renaming *.gz to *.ipk won't do the trick.

with

opkg update

i get e.g.

Downloading http://downloads.openwrt.org/releases/19.07.3/targets/ramips/mt76x8/packages/Packages.gz
Failed to establish connection
*** Failed to download the package list from http://downloads.openwrt.org/releases/19.07.3/targets/ramips/mt76x8/packages/Packages.gz

Downloading http://downloads.openwrt.org/releases/19.07.3/targets/ramips/mt76x8/kmods/4.14.180-1-d92769dc5268e102503ae83fe968a56c/Packages.gz
Failed to establish connection
*** Failed to download the package list from http://downloads.openwrt.org/releases/19.07.3/targets/ramips/mt76x8/kmods/4.14.180-1-d92769dc5268e102503ae83fe968a56c/Packages.gz

then i download this *.gz-packages on my labtop, when i unpack the gz-files, i get files without ending

The gz-files are package lists, not packages. You don't need to update package lists on your router. You need to download *.ipk packages on your laptop, copy them over on your router, and install them.

Later, when you have your connection from router active, you can do opkg update and install more packages from the internet.

1 Like

You can find ipk packages here:

https://downloads.openwrt.org/releases/

Be aware! You have to choose the correct release tree you are using on your device and the correct architecture/platform according to your router hardware.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.