Creating a Mesh Network (with OLSR Protocol) for multiple Access Points

I do not bridge all 3 interfaces. It as per the web instructions you followed.

2 Likes

Hello everybody, sorry for the long absence, I was waiting for the WiFi USB Dongle I bought online to arrived. I have installed the dongle for RPi 1 and RPi 2, and finally they can detect each other. So that is one problem solved.

Below is the network and interface configuration of both RPi.
RPi 1
/etc/config/network

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

config globals 'globals'
        option ula_prefix 'fd8f:d9ae:4317::/48'

config interface 'lan'
        option type 'bridge'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option proto 'dhcp'
        option ifname 'eth0'

config interface 'mesh'
        option proto 'static'
        option ipaddr '192.168.10.2'
        option netmask '255.255.255.0'

/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'platform/soc/3f300000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option htmode 'HT20'
        option country 'KR'
        option legacy_rates '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option mode 'ap'
        option encryption 'none'
        option ssid 'OpenWRT1'
        option network 'lan'

config wifi-device 'radio1'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0'
        option htmode 'HT20'
        option country 'KR'
        option legacy_rates '1'

config wifi-iface
        option device 'radio1'
        option mode 'adhoc'
        option ssid 'meshbackhaul'
        option encryption 'psk'
        option key 'meshbackhaul'
        option network 'mesh'

RPi 2
/etc/config/network

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

config globals 'globals'
        option ula_prefix 'fd29:812a:a8cd::/48'

config interface 'lan'
        option type 'bridge'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option proto 'dhcp'
        option ifname 'eth0'

config interface 'mesh'
        option proto 'static'
        option ipaddr '192.168.10.3'
        option netmask '255.255.255.0'

/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'platform/soc/3f300000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option htmode 'HT20'
        option country 'KR'
        option legacy_rates '1'

config wifi-iface
        option device 'radio0'
        option key 'meshnetw'
        option mode 'ap'
        option ssid 'OpenWRT2'
        option encryption 'none'
        option network 'lan'

config wifi-device 'radio1'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0'
        option htmode 'HT20'
        option country 'KR'
        option legacy_rates '1'

config wifi-iface
        option device 'radio1'
        option mode 'adhoc'
        option ssid 'meshbackhaul'
        option encryption 'psk'
        option key 'meshbackhaul'
        option network 'mesh'

The second problem is, as I have stated previously, each RPi will also provide wifi internet access via its onboard wifi (SSID: OpenWRT1 by RPi 1 and SSID: OpenWRT2 by RPi 2).
How can I configure each RPi? I assume since only RPi1 is connected to internet via ethernet port, the configuration between RPi1 and RPi2 would be different.
Can anybody provide solution for this? Should I bridge all eth0, wlan0 (onboard wifi), and wlan1 (dongle wifi) at RPi 1 and bridge wlan0 and wlan 1 at RPi 2?

*current condition is eth0 and wlan0 of both RPi is bridged. My smartphone can get internet access from either OpenWRT1 (RPi 1) or OpenWRT2 (RPi 2) wifi, if they have internet connection from ethernet port. I think this is okay for RPi 1, but RPi 2 should only get internet acces from RPi 1 and does not have anything connected to its ethernet port.

You tell the mesh that Internet is available.

This is done by making one single route (0.0.0.0/0) on the mesh, or a combination of 2 or more groups of more-specific routes that equal 0.0.0.0/0 (e.g. 0.0.0.0/1 and 128.0.0.0/1) - on the device(s) that have Internet connectivity.

This way, you can also prioritize one Internet connection over another, etc..

1 Like

I already set HNA of RPi 1 to 0.0.0.0 because it has internet access, but my smartphone still cant established connection to wifi OpenWRT2 of RPi2 (no internet via ethernet port at RPi 2). Connectting to wifi OpenWRT1 of RPi 1 is no problem. Which part is wrong? Is it bridge problem?

I'm not sure why you're bridging anything, that's the point of using routers.

  • The mesh is linked and passes routed traffic via one or more pre-specified interface(s)
  • You tell the mesh what networks exist at each router location by adding those subnets
  • You NAT to WAN as normal on the router with Internet (i.e. the 0.0.0.0/0 routes), if mesh traffic uses Private RFC1918 IPs
  • Your other interfaces are used as normal (or NATed to the MESH, or subnets are added for no-NAT)

So, do you have an OLSR announcement, NAT-masquerade or route issue?

1 Like

The problem is I dont know what I haven't done or did wrong. I think I have done all steps provided by justingoetz and recommendation by experts in this forum. No error notification shown by each RPi. My smartphone can connect to OpenWRT1 wifi but it cant connect to OpenWRT2 wifi. When trying to connect to OpenWRT2, it says cannot get IP address. Maybe it is something related to DHCP settings in RPi 2?

I just found this tutorial https://openwrt.org/docs/guide-user/network/wifi/routedap. Is this what I need to do?