Multiple gateways

No.
10.0.0.210 is the fritzbox7530ax-rtr-val as you can see on my scheme.

The openwrt device where the Client 02 is connected, is silvercrestswv733a1-ext-A and it's IP address is 10.0.0.222.
So I have to post the configs of 10.0.0.222, right?

Help me understand this:

Client 02 has a manually assigned IP address and gateway. the gateway specified on Client 02 is 10.0.0.210, which is fritzbox device, not running OpenWrt. The actual effective gateway for Client 02 is 10.0.0.1, despite the fact that you have set 10.0.0.210 as the desired gateway.

Is that correct?

If so, the problem is related to something on the Fritzbox.

Yep, but the Client 02 is not connected directly to fritzbox.
Client 02 is connected to OpenWRT extender that is connected to Fritzbox gateway 10.0.0.210.
Only in this configuration the following state is correct:

If i connect Client 02 directly to Fritzbox .210 , all work well.

relayd is a hack to achieve bridge like behaviour. It seems that it forwards packets destined to the internet via its own gateway disregarding the mac address of the router the client hosts use in the frame. It works well with one gateway, but is not designed to accommodate your scenario. There are other ways to achieve more natural bridging, like WDS. Or you'll have to rely only on the gateway of OpenWrt for all the clients connected to it.

1 Like

This is the config files for the .222 OpenWRT device:

root@OpenWrt:~# cat /etc/config/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 'xxxx:xxxx:xxxx::/48'

config interface 'lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option delegate '0'
        option device 'eth0'
        option defaultroute '0'
        option ipaddr '10.0.1.222'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '0'

config device
        option name 'eth0'
        option ipv6 '0'
        option multicast_router '1'

config interface 'nbridge'
        option proto 'relay'
        option ipaddr '10.0.0.222'
        option delegate '0'
        option defaultroute '0'
        option peerdns '0'
        option force_link '1'
        list network 'lan'
        list network 'wifi0'

config device
        option name 'wlan1'
        option ipv6 '0'

config interface 'wifi0'
        option proto 'static'
        option device 'wlan1'
        option ipaddr '10.0.0.222'
        list dns '10.0.0.1'
        option delegate '0'
        option gateway '10.0.0.1'
        option netmask '255.255.255.0'
        option broadcast '10.0.0.255'


root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/10300000.wmac'
        option band '2g'
        option htmode 'HT40'
        option channel 'auto'
        option cell_density '0'
        option country 'IT'
        option disabled '1'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
        option channel '36'
        option band '5g'
        option htmode 'VHT80'
        option country 'IT'
        option cell_density '0'

config wifi-iface 'wifinet0'
        option device 'radio1'
        option mode 'sta'
        option ssid 'TIM_ROBY'
        option bssid 'XX:XX:XX:XX:XX:XX'
        option encryption 'sae'
        option key 'Spxh5qbm7&'
        option network 'wifi0'


root@OpenWrt:~# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option ignore '1'

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


root@OpenWrt:~# cat /etc/config/firewall

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

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option masq_allow_invalid '1'
        list network 'lan'
        list network 'nbridge'
        list network 'wifi0'

Ok, thanks trendy.

Apart from the WDS method (which would not be ideal in my case given the presence of the fritzbox), do you know if there is any other library for bridging in which that functionality is implemented?

Your best bet is to read the infobox at the beginning of relayd page

If supported by both devices, consider using WDS, Layer 2 GRE tunnels (“gretap”), or mesh networking.

Using relayd as instructed in this article isn't guaranteed to work.

The most common problem is that the client router cannot pass the DHCP message between the main router and the client connected to the client router. Currently it seems to be the hardware/SOC limitation (related to MAC cloning?)

Instead of relayd it should be possible to use kmod-trelay, the only information about using it can be seen in its source code, if you used it successfully please add a section for it in this article.

1 Like

I will try with kmod-trelay.

Another thing before try kmod-trelay.
There is a method with relayd and rules to change the route of packets based on gateway parameter?

I have no idea, I have never used it.

1 Like

I know this is an old topic, But i red through it and i think you need to use Mwan3 to load balance between the 2 WANs you got at 10.0.0.210.

Or somehow call Node A or B gates at client 2 instead of 10.0.0.210.