OpenWrt internet device connection opkg

I setup mine home network as a mesh network with the use of the badman protocol.

But now I have a problem, the openwrt internet clients can't connect to the internet. So opkg can't update any packages.

Now all the connected devices to the WiFi network does have internet connection on the right subnet.
I always thought that the virtual wan device made the need to be linked to the right internet proto and that wan device is responsible to give the device internet.

I have static proto that where I can reach the mesh ap's.

And everything I search in Google how the internet being handled on a openwrt device returns nothing.

Does someone know what I'm searching or the terms for Google to help me further? Thanks in advance

  • Did the mesh setup ever work for you?
  • Configs?

Is it batman or a fork gone bad? (pun intended)

Have you configured IP/mask/gateway/dns properly on all the APs?
What is the output of uci export network; ip -4 addr; ip -4 ro; ip-4 ru; nslookup openwrt.org

2 Likes

The simplest way to run a mesh is to make the nodes that are not connected to the Internet dumb APs. A dumb AP has only one network, lan. The mesh interface bat0 bridges into the lan network the same way a wired connection would.

For internal Internet usage to work, the lan network needs to have a gateway and DNS server configured. The gateway is the next router toward the Internet, which would be the LAN's main router. The DNS server is also usually that machine, though you can use an external DNS.

2 Likes

Sorry for the late response i had a bizzy work weeks, thanks for your response :slight_smile:

now i have a hunch that something is wrong with, but how do i setup the right server and gateway or do i need to change the local network of the main router to give some sort of loopback?

192.168.255.0/24 dev br-thuis scope link  src 192.168.255.4 
-ash: ip-4: not found
Server:         127.0.0.1
Address:        127.0.0.1#53

here is the output:

root@Redmi2:~# uci export network; ip -4 addr; ip -4 ro; ip-4 ru; nslookup openwrt.org
package 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 packet_steering '1'
        option ula_prefix 'fddb:25ec:312c::/48'

config interface 'gasten'
        option device 'br-Gasten'
        option proto 'none'
        option defaultroute '0'

config interface 'thuis'
        option device 'br-thuis'
        option proto 'static'
        option ipaddr '192.168.255.4'
        option netmask '255.255.255.0'
        option gateway '192.168.255.1'
        option defaultroute '0'
        list dns '192.168.255.1'

config interface 'IOT'
        option device 'br-IOT'
        option proto 'none'
        option defaultroute '0'

config interface 'bt0'
        option proto 'batadv'
        option bridge_loop_avoidance '1'
        option hop_penalty '30'
        option defaultroute '0'
        option gw_mode 'off'
        option routing_algo 'BATMAN_IV'

config interface 'batman'
        option proto 'batadv_hardif'
        option master 'bt0'
        option defaultroute '0'
        option mtu '2304'

config device
        option type 'bridge'
        option name 'br-IOT'
        list ports 'bt0.1'
        list ports 'eth0'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'wan'

config device
        option type 'bridge'
        option name 'br-Gasten'
        list ports 'bt0.100'

config device
        option type 'bridge'
        option name 'br-thuis'
        list ports 'bt0.255'

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
12: br-thuis: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    inet 192.168.255.4/24 brd 192.168.255.255 scope global br-thuis
       valid_lft forever preferred_lft forever
192.168.255.0/24 dev br-thuis scope link  src 192.168.255.4 
-ash: ip-4: not found
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:      openwrt.org
Address 1: 139.59.209.225
Address 2: 2a03:b0c0:3:d0::1af1:1

Still think its weird that opkg can't update but nslookup returns the right ip address


root@Redmi2:~# nslookup google.com
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:      google.com
Address 1: 172.217.168.206
Address 2: 2a00:1450:400e:810::200e
root@Redmi2:~# opkg update
Downloading https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt7621/packages/Packages.gz
Failed to send request: Operation not permitted
*** Failed to download the package list from https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt7621/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/base/Packages.gz
Failed to send request: Operation not permitted
*** Failed to download the package list from https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/base/Packages.gz

Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/luci/Packages.gz
Failed to send request: Operation not permitted
*** Failed to download the package list from https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/luci/Packages.gz

Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/packages/Packages.gz
Failed to send request: Operation not permitted
*** Failed to download the package list from https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/routing/Packages.gz
Failed to send request: Operation not permitted
*** Failed to download the package list from https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/routing/Packages.gz

Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/telephony/Packages.gz
Failed to send request: Operation not permitted
*** Failed to download the package list from https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/telephony/Packages.gz

Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt7621/packages/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/base/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/luci/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/packages/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/routing/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/telephony/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

Hi mk24, and thanks again for you response

I thought about that setup, but it would be much easyer but im trying to make my home network more secure, and that's why i was trying out batman also for learning purposes.

but do i need to config static leases to the dump ap's on the main router? i tought that the dhcp interfaces did created automatically a dns host or that the dns server that the main router uses would be used?

sorry for the dumb questions still learning

Check the date/time on the devices. That is usually sign of HTTPS failing due to SSL connection fail due to incorrect date/time on the device.

Making your AP's dumb simplifies your network and should ensure they use your routers DNS and enable them to NTP update correctly.

Personally I do static DHCP reservations for AP's on the main router and leave the AP's to pick up that reservation. This means I can move them between networks if required. The other method is to manually set them to specific static addresses with the correct gateway/dns being set on them. Then NTP updates will work and SSL connections work properly.

This wiki shows you how to do the static method.

you can enable NTP logging with the following. (on the router and APs)

create a file /etc/hotplug.d/ntp/20-ntpd-logger and place the following in it.

#!/bin/sh
[ $ACTION = "step" ]    && logger -t ntpd Time set, stratum=$stratum interval=$poll_interval offset=$offset
[ $ACTION = "stratum" ] && logger -t ntpd Stratum change, stratum=$stratum interval=$poll_interval offset=$offset

This will make NTP updates show in the main log and then you can reboot the router and see if it updates or fails. Like this:

root@OpenWrt:~# logread | grep ntpd
Tue Jun 28 10:53:05 2022 user.notice ntpd: Stratum change, stratum=3 interval=4096 offset=-0.003520
Tue Jun 28 11:36:21 2022 user.notice ntpd: Stratum change, stratum=2 interval=4096 offset=0.002651

your totally right the device NTP wasn't setup right

I don't know why i didn't notice it sooner
Thanks :slight_smile:

1 Like

Its a common gotcha. No DNS means no NTP which means failing SSL. Vicious cycle. :slight_smile:

Revert that, it is cancelling the gateway.

1 Like

thanks all!!
succes:

Downloading https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt7621/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt7621/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/21.02.3/packages/mipsel_24kc/telephony/Packages.sig
Signature check passed.

Added the NTP server ip inside system -> time synchronization

and

edited the main interface inside network -> interfaces
checked the use default gateway

can't find much information about use default gateway

You cannot access the internet without a default gateway.
Enabling the ntp server is not relevant to your problem, as it is just offering time service to lan hosts. OpenWrt by default has ntp client enabled to update the time, but it needs to reach the internet for that.

2 Likes

have you checked your gateway and dns on your aps? Make sure they are set if you have them setup as statics. Check the route back to the main router as well.

If you are using DHCP reservations? I tend to add the gateway and DNS options in dhcp explicitly.

https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#dhcp_options - Option 3 and 6 are Gateway and DNS respectively.

trendy is right. Your issues have been because of config issues. Your APs were not able to connect to the internet and thus the NTP issue was secondary to the primary issue of connectivity.

Using them as dumb APs results in a "flat" network and you can mesh easier as your only "real" configuration is on the main router and the APs just handle wifi connections. DNS, DHCP and routing is managed by your main router. KISS principle.

I think you mistake me for Elfje4life1 and didn‘t read my post at all, as my problem is similar but not exact the same issue.
My ap has access to internet. The default gateway is set and can be reached. DNS, DHCP is handled by main router only.

1 Like

You both have green icons. sorry.

Ideally it is best to do a separate thread for new issues.

have you disabled firewall between the APs? Dumb AP's should not require firewalls active. The previously linked setup for Dumb AP's on the wiki has instructions.

2 Likes

no firewall, no dnsmasq, no odhcpd is running on the ap

As noted before, you should open a new, separate thread for your issue/problem. Elfje4life1 created this thread for their issue.

Let's keep things neat, tidy and respect the OP's thread.

4 Likes
ubus call system board; \
uci export dhcp; \
ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*

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