How can I connect 2 wireless NICs to one wired ethernet

Surely this should be possible, but I'm just not finding the answer.

Given the following:
I have 2 BATMAN-Adv wireless mesh networks (WMN) running on separate 5 GHz channels, and a primary network. All 3 networks are in the same subnet (192.0.0.0/8).

I have a single board computer (“SBC”), acting as a bridge node between these 3 networks with 1 ethernet (eth1, eth0 is reserved and not in scope at this time) and 2 wireless NICs. The ethernet port is wired to the control room network (“Ctrl Rm Net”). Each of the wireless NICs are nodes for their respective WMNs (bat0, bat1).

Both WMNs seem to be operational, and ‘batctl -m bat0 o’ and ‘batctl -m bat1 o’ showing the full complement of connected devices on each.

^
^
|                                  +-----------+
|  +-------------+                 |         /-+--wlan0--((bat0))
+--+ Ctrl Rm Net +--br-lan (eth1)--+ SBC br0   |
   +-------------+                 |         \-+--wlan1--((bat1))
                                   +-----------+

Symptoms:
I believe that I am getting packet collisions or a cycle, because if I disable the interfaces wlan0 and wlan1 in /etc/config/network, the SBC can ping 8.8.8.8 successfully. However, this fails when these interfaces are enabled.

Also, a computer (192.0.0.13) on Ctrl Rm Net can ping eth1 at 192.168.1.100, but it cannot ping wlan0 (192.168.1.101) or wlan1 (192.168.1.102) nor any devices on either WMN (bat0 nor bat1).

Goal:
I need all 3 of these networks to communicate seamlessly.

{
        "kernel": "4.14.13",
        "hostname": "OpenWrt",
        "model": "Gateworks Newport CN80XX GW6200",
        "board_name": "gw,gw620x",
        "release": {
                "distribution": "OpenWrt",
                "version": "SNAPSHOT",
                "revision": "r0+5915-280a6b3",
                "target": "octeontx\/generic",
                "description": "OpenWrt SNAPSHOT r0+5915-280a6b3"
        }
}
package 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 'auto'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.100'
        option netmask '255.0.0.0'
        option gateway '192.0.0.1'
        option delegate '0'
        option ifname 'eth1 eth1.1 eth1.2'

config interface 'nw1_mesh0'
        option ifname 'mesh0'
        option proto 'batadv'
        option mesh 'bat0'
        option mtu '2304'

config interface 'wlan0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.101'
        option netmask '255.0.0.0'
        option gateway '192.0.0.1'
        option delegate '0'
        option stp '1'
        option ifname 'bat0 eth1.1'

config interface 'nw1_mesh1'
        option ifname 'mesh1'
        option proto 'batadv'
        option mesh 'bat1'
        option mtu '2304'

package wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '153'
        option path 'soc@0/88001f000000.pci/pci0001:1f/0001:1f:00.0/0001:20:00.0'
        option htmode 'VHT80'
        option country 'US'
        option legacy_rates '1'
        option hwmode '11ac'

config wifi-iface 'mesh0'
        option device 'radio0'
        option ifname 'mesh0'
        option mode 'mesh'
        option mesh_fwding '0'
        option encryption 'none'
        option mesh_id 'mymesh'
        option network 'nw1_mesh0'

config wifi-device 'radio1'
        option type 'mac80211'
        option channel '157'
        option path 'soc@0/88808f000000.pci/pci0002:8f/0002:8f:00.0/0002:90:00.0'
        option htmode 'VHT80'
        option country 'US'
        option legacy_rates '1'
        option hwmode '11ac'

config wifi-iface 'mesh1'
        option device 'radio1'
        option ifname 'mesh1'
        option mode 'mesh'
        option mesh_fwding '0'
        option mesh_id 'mymesh'
        option encryption 'none'
        option network 'nw1_mesh1'

package dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'
        option ra_management '1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

package firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option network 'lan wlan0 wlan1'

config include
        option path '/etc/firewall.user'

config include 'miniupnpd'
        option type 'script'
        option path '/usr/share/miniupnpd/firewall.include'
        option family 'any'
        option reload '1'

config zone
        option input 'ACCEPT'
        option forward 'ACCEPT'
        option output 'ACCEPT'
        option name 'wwan'
        option masq '1'
        option mtu_fix '1'
        option network 'mesh1bridge mesh2bridge vlan1110 vlan1111'

config forwarding
        option dest 'wwan'
        option src 'lan'

config forwarding
        option dest 'lan'
        option src 'wwan'

# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.

# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
12: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 192.168.1.100/8 brd 192.255.255.255 scope global br-lan
       valid_lft forever preferred_lft forever
14: br-wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 192.168.1.101/8 brd 192.255.255.255 scope global br-wlan0
       valid_lft forever preferred_lft forever
default via 192.0.0.1 dev br-wlan0 proto static
192.0.0.0/8 dev br-lan proto kernel scope link src 192.168.1.100
192.0.0.0/8 dev br-wlan0 proto kernel scope link src 192.168.1.101
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
broadcast 192.0.0.0 dev br-lan table local proto kernel scope link src 192.168.1.100
broadcast 192.0.0.0 dev br-wlan0 table local proto kernel scope link src 192.168.1.101
local 192.168.1.100 dev br-lan table local proto kernel scope host src 192.168.1.100
local 192.168.1.101 dev br-wlan0 table local proto kernel scope host src 192.168.1.101
broadcast 192.255.255.255 dev br-lan table local proto kernel scope link src 192.168.1.100
broadcast 192.255.255.255 dev br-wlan0 table local proto kernel scope link src 192.168.1.101
0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default
lrwxrwxrwx    1 root     root            16 May 24  2018 /etc/resolv.conf -> /tmp/resolv.conf
lrwxrwxrwx    1 root     root            21 Oct 30 20:15 /tmp/resolv.conf -> /tmp/resolv.conf.auto
-rw-r--r--    1 root     root             0 Oct 30 20:15 /tmp/resolv.conf.auto
==> /etc/resolv.conf <==

==> /tmp/resolv.conf <==

==> /tmp/resolv.conf.auto <==
root@OpenWrt:/#

192.0.0.0/8 is not a private IP range, but officially assigned to public servers on the internet!

2 Likes

Yes, I do realize that, and I expect to change my numbering to 10.x.x.x/8 in the near future. But that shouldn't effect the bridges specifically internal on the SBC.

If they're all in the same subnet you don't need any routing in between them, just put bat0 bat1 and an eth port all into the same bridge. Not sure why you would do that instead of having separate subnets and routing between them though.

Joining the two meshes at more than one node would create a network loop, which is very bad. If you're looking for increased bandwidth you need to place a bonding or load-sharing scheme on top of the two paths. You can't merely layer-2 bridge two paths and get more bandwidth.

When running VLANs on an eth port don't use the "base" port (eth1) for anything always refer to a specific VLAN (eth1.X).

Note that you can pass VLAN tagged traffic through a BATMAN mesh using the notation bat0.X. This may be useful instead of having two meshes.

Why on earth are you using a /8? Do you really need to handle 16M+ hosts?

1 Like

Nope, not even close. Using /8 is only for convenience in identifying the nodes on the 2 networks. The second byte of the addressing scheme specifies a group of components.

I didn't go into a lot of detail on the components themselves, but they are cameras that use the mesh networks to communicate with the base. Given the temporary installation and the environment where they will be operating, they cannot be wired back to the control room network.

If they're all in the same subnet you don't need any routing in between them, just put bat0 bat1 and an eth port all into the same bridge.

I guess I'm not sure which bridge interface I would put that on. But having all of them on only one interface doesn't make sense to me. At least not if I want to be able to ping each interface from the outside.

The way I see it, each interface that I want to bridge should be specified in the ifname option. So 'lan' to 'wlan0' to 'mesh0' would be eth1 -> eth1.0 -> bat0, and 'lan' to 'wlan1' to 'mesh1' would be eth1 -> eth1.1 -> bat1 should be the chains I'm defining through the ifname option to designate the respective bridging.

You can see this configuration in /etc/config/network below, but when I try to ping the wireless NICs from my computer, I get "Destination host unreachable":

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 'auto'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.100'
        option netmask '255.0.0.0'
        option gateway '192.0.0.1'
        option delegate '0'
        option ifname 'eth1.0 eth1.1'

config interface 'nw1_mesh0'
        option ifname 'mesh0'
        option proto 'batadv'
        option mesh 'bat0'
        option mtu '2304'

config interface 'wlan0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.101'
        option netmask '255.0.0.0'
        option gateway '192.0.0.1'
        option delegate '0'
        option stp '1'
        option ifname 'bat0 eth1.0'

config interface 'nw1_mesh1'
        option ifname 'mesh1'
        option proto 'batadv'
        option mesh 'bat1'
        option mtu '2304'

config interface 'wlan1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.102'
        option netmask '255.0.0.0'
        option gateway '192.0.0.1'
        option delegate '0'
        option stp '1'
        option ifname 'bat1 eth1.1'


As for joining the 2 WMNs and creating a network loop, I don't think I'm doing that. They are operating on separate frequencies in order to avoid overloading the radio signal with the video streams they are pushing back to the control room.

If you run VLANs on the Ethernet cable then the device at the other end has to be VLAN aware. "eth1.0" is not a valid construct since VLAN tag numbers start at 1.

The simplest setup would be:

config interface 'wifi_bridge'
    option type 'bridge'
    option proto 'none'
    option ifname 'bat0 bat1 eth1'

A bridge like this works as a virtual Ethernet switch -- it directs traffic based on MAC address only. The proto none means there is no connection to the OS itself. The Ethernet port has access to the meshes but it is not possible to log in to OpenWrt with ssh for example. If you want that, use proto static and give the bridge an IP address.

Also since this emulates an unmanaged switch, the configuration above links the two meshes to each other. It is important that if you want that, to do it only at only one place in your network or there will be a loop, since this is outside the BATMAN protocol and mesh routing no longer applies.

I'm sorry, but I'm just not getting it.

When I have this /etc/config/network, I get an IP address for the new wifi_bridge, but the bridges to wlan0 & wlan1 are now missing. Unfortunately, I also cannot ping the new wifi_bridge.

Yes, I did change my network settings to use 10.x.x.x as I mentioned I would be doing.

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 'auto'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ipaddr '10.100.0.1'
        option netmask '255.0.0.0'
        option gateway '10.0.0.1'
        option delegate '0'
        option ifname 'eth1'

config interface 'nw1_mesh0'
        option ifname 'mesh0'
        option proto 'batadv'
        option mesh 'bat0'
        option mtu '2304'

config interface 'wlan0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '10.100.0.10'
        option netmask '255.0.0.0'
        option gateway '10.0.0.1'
        option delegate '0'
        option stp '1'
        option ifname 'bat0 eth1.1'

config interface 'nw1_mesh1'
        option ifname 'mesh1'
        option proto 'batadv'
        option mesh 'bat1'
        option mtu '2304'

config interface 'wlan1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '10.100.0.20'
        option netmask '255.0.0.0'
        option gateway '10.0.0.1'
        option delegate '0'
        option stp '1'
        option ifname 'bat1 eth1.2'

config interface 'wifi_bridge'
        option type 'bridge'
#       option proto 'none'
option proto 'static'
option ipaddr '10.100.0.30'
option netmask '255.0.0.0'
option gateway '10.0.0.1'
        option ifname 'bat0 bat1 eth1'

and now ifconfig

bat0      Link encap:Ethernet  HWaddr 42:B2:C2:49:CC:33
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:351 errors:0 dropped:41 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:42 (42.0 B)  TX bytes:76753 (74.9 KiB)

bat1      Link encap:Ethernet  HWaddr 1E:DF:CD:18:7F:17
          UP BROADCAST RUNNING 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)

br-lan    Link encap:Ethernet  HWaddr 00:D0:12:8E:F5:5B
          inet addr:10.100.0.1  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::2d0:12ff:fe8e:f55b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:912 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:181410 (177.1 KiB)  TX bytes:1898 (1.8 KiB)

br-wifi_bridge Link encap:Ethernet  HWaddr 42:B2:C2:49:CC:33
          inet addr:10.100.0.30  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::40b2:c2ff:fe49:cc33/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:1092 (1.0 KiB)

eth1      Link encap:Ethernet  HWaddr 00:D0:12:8E:F5:5B
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:914 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:194894 (190.3 KiB)  TX bytes:1918 (1.8 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:5233 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5233 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:429176 (419.1 KiB)  TX bytes:429176 (419.1 KiB)

mesh0     Link encap:Ethernet  HWaddr 04:F0:21:59:38:F7
          inet6 addr: fe80::6f0:21ff:fe59:38f7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:2304  Metric:1
          RX packets:242 errors:0 dropped:0 overruns:0 frame:0
          TX packets:249 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15968 (15.5 KiB)  TX bytes:23182 (22.6 KiB)

mesh1     Link encap:Ethernet  HWaddr 04:F0:21:3E:57:DE
          inet6 addr: fe80::6f0:21ff:fe3e:57de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:2304  Metric:1
          RX packets:246 errors:0 dropped:0 overruns:0 frame:0
          TX packets:251 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:16224 (15.8 KiB)  TX bytes:23408 (22.8 KiB)

Simplify this some. Have a bridge containing only the bat0 and bat1 interfaces and one Ethernet port untagged. Do not use those interfaces in any other network. Connect a PC to the Ethernet cable and see if it can reach devices on the meshes.

I had to be away for a few days, but I designed a test system based on your suggestions to be as simple as I could.

Setup:

  • dev (wired @ 10.0.0.202/8)
  • SBC1 (wired eth1 @ 10.100.0.1, wifi_bridge interface bat0 bat1 eth1)
  • SBC2 (wired eth1 @ 10.2.1.1, wifi_bridge interface bat0 bat1 eth1)
  • cam1 (wired @ 10.0.0.113)
  • cam2 (wired @ 10.0.0.123)
  • bat0 (can see configured NICs from both SBCs)
  • bat1 (can see configured NICs from both SBCs)
  • switch1 (SBC1 always connected)
  • switch2 (SBC2 and both cameras always connected)

Results:

  • connect dev to switch1
    • dev cannot ping SBC2 or cameras
    • dev can ping SBC1
  • connect dev to switch2
    • dev can ping SBC2 and both cameras
      • No surprise. Pretty sure dev is bypassing SBC2 altogether and just going through the switch.
    • dev cannot ping SBC1

Any ideas?

SBC1: /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 'auto'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ipaddr '10.100.0.1'
        option netmask '255.0.0.0'
        option gateway '10.0.0.1'
        option delegate '0'
        option ifname 'eth1'

config interface 'nw1_mesh0'
        option ifname 'mesh0'
        option proto 'batadv'
        option mesh 'bat0'
#        option routing_algo 'BATMAN_V'
        option mtu '2304'

config interface 'nw1_mesh1'
        option ifname 'mesh1'
        option proto 'batadv'
        option mesh 'bat1'
#        option routing_algo 'BATMAN_V'
        option mtu '2304'

config interface 'wifi_bridge'
        option type 'bridge'
        option proto 'none'
        option ifname 'bat0 bat1 eth1'

SBC1; ifconfig

bat0      Link encap:Ethernet  HWaddr B6:E9:31:4F:1D:AC
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:49075 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49669 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2061150 (1.9 MiB)  TX bytes:2086098 (1.9 MiB)

bat1      Link encap:Ethernet  HWaddr 86:62:AE:A7:4C:99
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:322254 errors:0 dropped:0 overruns:0 frame:0
          TX packets:338094 errors:0 dropped:20 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13588876 (12.9 MiB)  TX bytes:14255484 (13.5 MiB)

br-lan    Link encap:Ethernet  HWaddr 00:D0:12:8E:F5:5B
          inet addr:10.100.0.1  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::2d0:12ff:fe8e:f55b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14012 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5397 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1726963 (1.6 MiB)  TX bytes:771470 (753.3 KiB)

br-wifi_bridge Link encap:Ethernet  HWaddr 86:62:AE:A7:4C:99
          inet6 addr: fe80::8462:aeff:fea7:4c99/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:98744 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2764832 (2.6 MiB)  TX bytes:856 (856.0 B)

eth1      Link encap:Ethernet  HWaddr 00:D0:12:8E:F5:5B
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14014 errors:0 dropped:105 overruns:0 frame:0
          TX packets:5397 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1923251 (1.8 MiB)  TX bytes:771730 (753.6 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:119294 errors:0 dropped:0 overruns:0 frame:0
          TX packets:119294 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9790448 (9.3 MiB)  TX bytes:9790448 (9.3 MiB)

mesh0     Link encap:Ethernet  HWaddr 04:F0:21:59:38:F7
          inet6 addr: fe80::6f0:21ff:fe59:38f7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:2304  Metric:1
          RX packets:149409 errors:0 dropped:0 overruns:0 frame:0
          TX packets:153633 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10441586 (9.9 MiB)  TX bytes:14731320 (14.0 MiB)

mesh1     Link encap:Ethernet  HWaddr 04:F0:21:3E:57:DE
          inet6 addr: fe80::6f0:21ff:fe3e:57de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:2304  Metric:1
          RX packets:152245 errors:0 dropped:0 overruns:0 frame:0
          TX packets:151858 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10639670 (10.1 MiB)  TX bytes:14560656 (13.8 MiB)

SBC2: /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 'auto'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth1'
        option proto 'static'
        option ipaddr '10.2.1.1'
        option netmask '255.0.0.0'
        option gateway '10.0.0.1'
        option ip6assign '60'

config interface 'nwi_mesh0'
        option ifname 'mesh0'
        option proto 'batadv'
        option mesh 'bat0'
#        option routing_algo 'BATMAN_V'
        option mtu '2304'

config interface 'nwi_mesh1'
        option ifname 'mesh1'
        option proto 'batadv'
        option mesh 'bat1'
#        option routing_algo 'BATMAN_V'
        option mtu '2304'

config interface 'wifi_bridge'
        option type 'bridge'
        option proto 'none'
        option ifname 'bat0 bat1 eth1'

SBC2: ifconfig

bat0      Link encap:Ethernet  HWaddr 2E:84:BF:63:8C:E8
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:4 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:42 (42.0 B)  TX bytes:42 (42.0 B)

bat1      Link encap:Ethernet  HWaddr BA:7D:EC:EA:88:2A
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:338088 errors:0 dropped:0 overruns:0 frame:0
          TX packets:322257 errors:0 dropped:19 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:14254960 (13.5 MiB)  TX bytes:13589274 (12.9 MiB)

br-lan    Link encap:Ethernet  HWaddr 00:D0:12:09:F6:07
          inet addr:10.2.1.1  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::2d0:12ff:fe09:f607/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1830 errors:0 dropped:1 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:87088 (85.0 KiB)  TX bytes:1838 (1.7 KiB)

br-wifi_bridge Link encap:Ethernet  HWaddr BA:7D:EC:EA:88:2A
          inet6 addr: fe80::b87d:ecff:feea:882a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:56 (56.0 B)  TX bytes:856 (856.0 B)

eth1      Link encap:Ethernet  HWaddr 00:D0:12:09:F6:07
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1830 errors:0 dropped:13 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:112708 (110.0 KiB)  TX bytes:1858 (1.8 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:122205 errors:0 dropped:0 overruns:0 frame:0
          TX packets:122205 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8310808 (7.9 MiB)  TX bytes:8310808 (7.9 MiB)

mesh0     Link encap:Ethernet  HWaddr 04:F0:21:59:38:ED
          inet6 addr: fe80::6f0:21ff:fe59:38ed/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:2304  Metric:1
          RX packets:1828 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1837 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:120988 (118.1 KiB)  TX bytes:169644 (165.6 KiB)

mesh1     Link encap:Ethernet  HWaddr 04:F0:21:3E:57:32
          inet6 addr: fe80::6f0:21ff:fe3e:5732/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:2304  Metric:1
          RX packets:1827 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1840 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:120782 (117.9 KiB)  TX bytes:169762 (165.7 KiB)

Is it valid to have different intefaces on the same network?

You have LAN, WLAN0 and WLAN1 all on 10.0.0.0.

Is it valid to have different intefaces on the same network?
You have LAN, WLAN0 and WLAN1 all on 10.0.0.0.

I think that's ok. But I'm willing to try anything at this point. What would you recommend?

You will have trouble accessing wordpress.com

That's ok, I never go there now. :slight_smile:

But no, it's a closed system. I already changed to 10.0.0.0/8 to get back into my IP lane, and avoid confusion.

Do not do that-- you have made a network loop. The two meshes can only be bridged at ONE point.

I don't see any advantage in two meshes that are layer 2 bridged with each other versus one big one. They are not independent when a layer 2 bridge exists.

D'oh! Yes, you're right. I wasn't thinking very clearly there.

I took the wifi_bridge off of SBC2, and tried the same procedures as above on my simple network. Unfortunately, the results are the same, dev cannot see SBC2 or the cameras when it is connected to switch1, and only using the bat0 bat1 eth1 wifi_bridge.

I'm still missing something, but I'm just not seeing where the disconnect could be.

I thought that is what you wanted.

  • One interface "local" to log into the router's LAN, primarily to set up and adminster the router itself.
  • One interface bridged to the camera meshes, connected by Ethernet cable to a server that communicates with the cameras. This server needs no access to a router, only cameras. So the router doesn't even have an IP on this interface. It is a "dumb" switch to the wifi mesh.

I'm not sure what the role of SBC#2 is in all of this.

Now these two network roles should be set up on different eth ports (or different VLANs on the same eth port) and the two networks should have separate non-overlapping IP subnets. Here eth1 has an IP on the local network but not on the camera network, and I don't know if the Linux kernel will "hairpin" something originating from the local network back into the camera bridge, or only send it out on the physical cable. It really isn't designed to be used that way anyway.

If you really want one giant network with all paths combined both at layer 2 and layer 3, just put all interfaces both eth and mesh into the LAN bridge.

No, that's not quite right. I was trying to simplify the original description to keep as much confusion of the details from creeping in. But alas and alack, they have joined the discussion. So let me clarify:

  • 2 independent sets of cameras, each connected to an SBC (eth1, if you're interested) to provide the connection to their respective WMN.
    • 10.1.x.x/8
    • 10.2.x.x/8
  • 1 control room network (where the base station for viewing the cameras is located)
    • 10.0.x.x/8
  • 1 bridge SBC between these 3 networks to connect them all
    • aka SBC1, above
    • eth1: 10.0.0.10
    • wlan0: 10.1.0.10
    • wlan1: 10.2.0.10

There is no need for the 2 WMNs to communicate except at the bridge node. So there is no need to worry about a hairpin turn from one WMN to the other. It's all about creating a Y connection. Communications between 10.0.x.x network goes to 10.1.x.x on wlan0, and 10.0.x.x network goes to 10.2.x.x on wlan1.

Based on today's experiments, I think I'm getting close. I cut out the wlan0 interface on SBC2, but there still seems to be a packet collision happening. Sometimes I can ping SBC2 on wlan1 ( @ 10.2.1.11) when dev is connected to switch2. Unfortunately, that cuts off immediately when I disconnect dev from the switch, so I know it's not going through WMN2. And when I reconnect dev to switch2, I get exactly 10 ping packets, then nothing until I ping 8.8.8.8, which seems to clear up some interference somewhere, and I can start pinging 10.2.1.11 again. Very strange.

SBC1 (Y-bridge) /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 'auto'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ipaddr '10.100.0.1'
        option netmask '255.0.0.0'
        option gateway '10.0.0.1'
        option delegate '0'
#       option ifname 'eth1'
option ifname 'eth1 bat0 bat1'

config interface 'nw1_mesh0'
        option ifname 'mesh0'
        option proto 'batadv'
        option mesh 'bat0'
        option mtu '2304'

config interface 'wlan0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '10.100.0.10'
        option netmask '255.0.0.0'
        option gateway '10.0.0.1'
        option delegate '0'
        option stp '1'
        option ifname 'bat0 eth1.1'

config interface 'nw1_mesh1'
        option ifname 'mesh1'
        option proto 'batadv'
        option mesh 'bat1'
        option mtu '2304'

config interface 'wlan1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '10.100.0.20'
        option netmask '255.0.0.0'
        option gateway '10.0.0.1'
        option delegate '0'
        option stp '1'
        option ifname 'bat1 eth1.2'

SBC1: ifconfig

root@OpenWrt:/# ifconfig
bat0      Link encap:Ethernet  HWaddr D6:7E:0C:06:29:9C
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:221731 errors:0 dropped:0 overruns:0 frame:0
          TX packets:244891 errors:0 dropped:442 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:45008905 (42.9 MiB)  TX bytes:90121989 (85.9 MiB)

bat1      Link encap:Ethernet  HWaddr 3A:9E:75:60:E6:9C
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5237 errors:0 dropped:0 overruns:0 frame:0
          TX packets:364791 errors:0 dropped:955 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1450861 (1.3 MiB)  TX bytes:26846937 (25.6 MiB)

br-lan    Link encap:Ethernet  HWaddr 00:D0:12:8E:F5:5B
          inet addr:10.100.0.1  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::2d0:12ff:fe8e:f55b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:356281 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9300 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:21145291 (20.1 MiB)  TX bytes:775878 (757.6 KiB)

eth1      Link encap:Ethernet  HWaddr 00:D0:12:8E:F5:5B
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:255249 errors:0 dropped:104 overruns:0 frame:0
          TX packets:219322 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:92625478 (88.3 MiB)  TX bytes:35961528 (34.2 MiB)

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:41512 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41512 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3486269 (3.3 MiB)  TX bytes:3486269 (3.3 MiB)

mesh0     Link encap:Ethernet  HWaddr 04:F0:21:59:38:F7
          inet6 addr: fe80::6f0:21ff:fe59:38f7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:2304  Metric:1
          RX packets:759791 errors:0 dropped:2 overruns:0 frame:0
          TX packets:1076482 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:128744762 (122.7 MiB)  TX bytes:211992048 (202.1 MiB)

mesh1     Link encap:Ethernet  HWaddr 04:F0:21:3E:57:DE
          inet6 addr: fe80::6f0:21ff:fe3e:57de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:2304  Metric:1
          RX packets:589981 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1755016 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:81841846 (78.0 MiB)  TX bytes:222645111 (212.3 MiB)

SBC2: /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 'auto'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth1'
#       option proto 'dhcp'
option proto 'static'
option ipaddr '10.2.1.1'
option netmask '255.0.0.0'
option gateway '10.0.0.1'
option delegate '0'

config interface 'nwi_mesh0'
        option ifname 'mesh0'
        option proto 'batadv'
        option mesh 'bat0'
        option mtu '2304'

config interface 'nwi_mesh1'
        option ifname 'mesh1'
        option proto 'batadv'
        option mesh 'bat1'
        option mtu '2304'

config interface 'wlan1'
        option type 'bridge'
        option stp '1'
        option ifname 'eth1 bat1'
        option proto 'static'
        option ipaddr '10.2.1.11'
        option netmask '255.0.0.0'
        option gateway '10.0.0.1'
        option delegate '0'

SBC2:

root@OpenWrt:~# ifconfig
bat1      Link encap:Ethernet  HWaddr 9A:50:B1:77:E0:55
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13293 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:3 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2252275 (2.1 MiB)  TX bytes:2412 (2.3 KiB)

br-lan    Link encap:Ethernet  HWaddr 00:D0:12:09:F6:07
          inet addr:10.2.1.1  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::2d0:12ff:fe09:f607/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8472 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5710 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1621676 (1.5 MiB)  TX bytes:882761 (862.0 KiB)

br-wlan1  Link encap:Ethernet  HWaddr 9A:50:B1:77:E0:55
          inet addr:10.2.1.11  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::9850:b1ff:fe77:e055/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13293 errors:0 dropped:0 overruns:0 frame:0
          TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2066173 (1.9 MiB)  TX bytes:2650 (2.5 KiB)

eth1      Link encap:Ethernet  HWaddr 00:D0:12:09:F6:07
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8546 errors:0 dropped:14 overruns:0 frame:0
          TX packets:5710 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1758135 (1.6 MiB)  TX bytes:886501 (865.7 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:6296 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6296 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:439216 (428.9 KiB)  TX bytes:439216 (428.9 KiB)

mesh0     Link encap:Ethernet  HWaddr 04:F0:21:59:38:ED
          inet6 addr: fe80::6f0:21ff:fe59:38ed/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:2304  Metric:1
          RX packets:171023 errors:0 dropped:0 overruns:0 frame:0
          TX packets:45356 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:26463923 (25.2 MiB)  TX bytes:8516303 (8.1 MiB)

mesh1     Link encap:Ethernet  HWaddr 04:F0:21:3E:57:32
          inet6 addr: fe80::6f0:21ff:fe3e:5732/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:2304  Metric:1
          RX packets:176130 errors:0 dropped:0 overruns:0 frame:0
          TX packets:45419 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:27119515 (25.8 MiB)  TX bytes:8519357 (8.1 MiB)

Using a /8, you only have one big network. There only needs to be one network bridge on each device. Usually that would be the existing lan. Do not create more bridges (see rule 1 below). This isn't a very good way to run things, but it will get you started.

Two major rules:

  1. An interface (e.g. bat0 or eth1.1) can only be in one bridge. The bridge takes over control of the physical interface. Physical interfaces don't have their own IP address while in a bridge, they inherit it from the bridge.
  2. When tagging packets on an eth cable (eth1.1) do not use the parent interface (eth1) for anything. Of course the device on the other end of the cable needs to be VLAN aware and send and receive tagged packets. This is an advanced concept that doesn't necessarily need to be deployed unless you're out of ports or cables.