Wifi does not connect or goes down

Hi,

Just flashed a fresh OpenWrt on an sd card and setup wifi with the details of my network, gateway, ip, etc. However, when I tested in diagnose it returns bad ping address. I then I try ifconfig in a terminal and it returns:


br-lan    Link encap:Ethernet  HWaddr 72:25:A4:30:6B:9F  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd29:69d1:f2f2::1/60 Scope:Global
          inet6 addr: fe80::7025:a4ff:fe30:6b9f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:282 errors:0 dropped:0 overruns:0 frame:0
          TX packets:195 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:28694 (28.0 KiB)  TX bytes:22008 (21.4 KiB)

eth0      Link encap:Ethernet  HWaddr 72:25:A4:30:6B:9F  
          inet6 addr: fe80::7025:a4ff:fe30:6b9f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1504  Metric:1
          RX packets:286 errors:0 dropped:0 overruns:0 frame:0
          TX packets:224 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:34416 (33.6 KiB)  TX bytes:26980 (26.3 KiB)
          Interrupt:41 

lan1      Link encap:Ethernet  HWaddr 72:25:A4:30:6B:9F  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:286 errors:0 dropped:0 overruns:0 frame:0
          TX packets:192 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:29268 (28.5 KiB)  TX bytes:21230 (20.7 KiB)

lan2      Link encap:Ethernet  HWaddr 72:25:A4:30:6B:9F  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan3      Link encap:Ethernet  HWaddr 72:25:A4:30:6B:9F  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan4      Link encap:Ethernet  HWaddr 72:25:A4:30:6B:9F  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:2044 (1.9 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:192 errors:0 dropped:0 overruns:0 frame:0
          TX packets:192 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:14976 (14.6 KiB)  TX bytes:14976 (14.6 KiB)

wan       Link encap:Ethernet  HWaddr 72:25:A4:30:6B:9F  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 0E:DB:FA:3F:26:9D  
          inet6 addr: fe80::cdb:faff:fe3f:269d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:584 (584.0 B)  TX bytes:4432 (4.3 KiB)

Where are the ipv4 details as those are the type I entered into the interface, why is it defaulting ti ipv6?

Thanks,

Aaron

I followed a tutorial on disabling ipv6 and restarted but still ipv4 address does not show.

For the start it would be helpful to know which version of OpenWrt you flashed on what kind of device.

Maybe you could post the result from
ubus call system board
and
/etc/config/network

network


config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd7b:ae4f:9e47::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config interface 'wan'
	option device 'wan'
	option proto 'dhcp'

config interface 'wan6'
	option device 'wan'
	option proto 'dhcpv6'

config interface 'wwan'
	option proto 'dhcp'

ubus call system board

{
	"kernel": "5.10.138",
	"hostname": "OpenWrt",
	"system": "ARMv8 Processor rev 4",
	"model": "Bananapi BPI-R64",
	"board_name": "bananapi,bpi-r64",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "22.03.0",
		"revision": "r19685-512e76967f",
		"target": "mediatek/mt7622",
		"description": "OpenWrt 22.03.0 r19685-512e76967f"
	}
}

Well,
i can't see any mistakes in this. At least LAN seems to work, but i don't understand the problems you have with wifi.
Maybe you can outline this a bit more?
What did you configure (or thought to) with what values, what did you expect and what did you get instead?
Sorry for the dumb questions, but your statement

doesn't really help a lot.

At the moment it seems to be working then say if I reboot the device wifi may not work. For example I could doing opkg update or installing a package when wifi connection suddenly drops and will not restart if I reboot the device.

Just preformed an opkgupdate which worked but then I could not install nano.

root@OpenWrt:~# opkg update
Downloading https://downloads.openwrt.org/releases/22.03.0/targets/mediatek/mt7622/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/releases/22.03.0/targets/mediatek/mt7622/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/telephony/Packages.sig
Signature check passed.
root@OpenWrt:~# opkg install nano
Installing nano (7.1-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/packages/nano_7.1-1_aarch64_cortex-a53.ipk
Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/packages/nano_7.1-1_aarch64_cortex-a53.ipk, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_install_pkg: Failed to download nano. Perhaps you need to run 'opkg update'?
 * opkg_install_cmd: Cannot install package nano.

Are there any clues in the logs? Can you provide them for the time the issues occur

Your output says you are on OpenWrt 22.03.0. Can you upgrade to the latest version, OpenWrt 22.03.3?

Tried switching to a static ip address:

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd7b:ae4f:9e47::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config interface 'wan'
	option device 'wan'
	option proto 'dhcp'

config interface 'wan6'
	option device 'wan'
	option proto 'dhcpv6'

config interface 'wwan'
	option device 'wlan0'
	option proto 'static'
	option ipaddr '10.1.1.4'
	option netmask '255.255.255.0'
	option gateway '10.1.1.1'
	option broadcast '10.1.1.255'
	list dns '10.1.1.1'

However, diagnostic returned:



PING openwrt.org (139.59.209.225): 56 data bytes
64 bytes from 139.59.209.225: seq=0 ttl=47 time=345.246 ms
64 bytes from 139.59.209.225: seq=1 ttl=47 time=345.656 ms
64 bytes from 139.59.209.225: seq=2 ttl=47 time=346.722 ms
64 bytes from 139.59.209.225: seq=3 ttl=47 time=349.147 ms

--- openwrt.org ping statistics ---
5 packets transmitted, 4 packets received, 20% packet loss
round-trip min/avg/max = 345.246/346.692/349.147 ms

I still don't know what you're trying to achieve...or even how you set up your network.
Are you still trying this?

If yes, please state so. Didn't you wrote in that thread that you got it to work?
If you're on something different, please outline it detailed.
My crystal ball just shows foggy thingies, so i can't help you with that little bit of information you're sharing.

1 Like

I am trying to do that but I need to solve the wifi problem first.

I guess, you'll have to do this on your own.
We still don't know, what your problem is.
"Wifi doesn't work (sometimes)" is no help at all.

The network seems causing the problem but I am unsure how to fix it.

  • What does bad ping address mean? (I've only seen this error when the user entered an invalid address - simply enter a valid address to ping)
    • Can you just paste the results?

I don't see what you're referring to.

Here:

Show where?

I don't see a WiFi connection.

Wait, are you saying that your device doesn't get an IP from the upstream AP?

  • Have you checked the the AP
  • What channel is the upstream AP set to? (:spiral_notepad: it shouldn't use auto nor DFS channels)
  • Verify settings in /etc/config/wireless

You made a thread about this already: Wireless network scan goes down

What was the WWAN configuration when opkg update worked?

This network config has wifi but somehow the lan interface got stuffed up.


 config interface 'loopback'
 	option device 'lo'
 	option proto 'static'
 	option ipaddr '127.0.0.1'
 	option netmask '255.0.0.0'
 
 config globals 'globals'
 	option ula_prefix 'fd7b:ae4f:9e47::/48'
 
 config interface 'wan'
 	option device 'wan'
 	option proto 'dhcp'
 
 config interface 'wan6'
 	option device 'wan'
 	option proto 'dhcpv6'
 
 config interface 'wwan'
 	option proto 'static'
 	option device 'wlan0'
 	option ipaddr '10.1.1.4'
 	option netmask '255.255.255.0'
 	option gateway '10.1.1.1'
 	option broadcast '10.1.1.255'
        list dns '10.1.1.1'
 
 config interface 'lan'
 	option proto 'static'
 	option ipaddr '192.168.1.1'
 	option netmask '255.255.255.0'
 	option device 'br-lan'
 
 config device
 	option type 'bridge'
 	option name 'br-lan'
 	list ports 'lan1'
 	list ports 'lan2'
 	list ports 'lan3'
 	list ports 'lan4'
 
 config switch
         option name 'switch0'
         option reset '1'
         option enable_vlan '1'
  
 config switch_vlan
         option device 'switch0'
         option vlan '1'
         option ports '1 2 3 4 5t'
  
 config switch_vlan
         option device 'switch0'
         option vlan '2'
         option ports '0 5t'

Typically, the wifi device (wlan0 in this case) does not belong in the /etc/config/network file. This line should be removed. The wwan network should be associated with the sta mode wifi config in the /etc/config/wireless file.

Let's also take a look at your other config files, while we are at it:

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Although, I think it gets added in the network file but luci? I will have a closer look next time. As stated in the posted above yours I now have the wifi working but have encountered another problem.

This is related to the screenshot that says "connection failed"?
How is that computer connected to the router (wired or wireless)? Does it have a link? What about an IP address?

If you actually post all of the key config files, we may be able to spot the problems (so the 3 I mentioned and the network config, if anything has changed since post 16)..

1 Like

Well, yes! It was the lan interface which has the 4 ports bridged. One port connected via ether cable to my laptop and another connected via ethernet to my desktop machine.

Well, this problem is moot now since I managed to lock myself out of OpenWrt while trying to confirm your statement about wifi interface suppose to be in wireless file.