fix: anygw not working via cable in dsa devices#1214
Open
a-gave wants to merge 2 commits intolibremesh:masterfrom
Open
fix: anygw not working via cable in dsa devices#1214a-gave wants to merge 2 commits intolibremesh:masterfrom
a-gave wants to merge 2 commits intolibremesh:masterfrom
Conversation
1340203 to
6830dfe
Compare
6830dfe to
e346bf9
Compare
e346bf9 to
dcdf181
Compare
Contributor
Author
|
fixed a typo |
dcdf181 to
a2443ef
Compare
Fix libremesh#1192. In dsa devices if another libremesh node is connected via cable anygw starts working intermittently for hosts connected via cable Manually adjust the bridge fdb, as suggested here [0], with an /etc/hotplug.d/net trigger adding an entry that states that the anygw mac address can be found locally on device br-lan Then add a nftables guard rule that drop packets with ether source address equal to the anygw_mac on every dsa user ports that is member of br-lan to prevent icmp6 broadcast loops. To use the command bridge it is necessary to add the package ip-bridge ~30KB. This wouldn't be required in swconfig devices but an easy way to distinguish between dsa and swconfig devices at compile time doesn't exists at the moment. [0] https://www.kernel.org/doc/html/latest/networking/dsa/configuration.html#forwarding-database-fdb-management
a2443ef to
7272d4d
Compare
some devices using dsa, don't have an bridge called br-lan instead it is present a configuration like ``` config device 'switch' option name 'switch' option type 'bridge' config bridge-vlan 'lan_vlan' option device 'switch' option vlan '1' option ports 'lan1 lan2 lan3 lan4' config interface 'lan' option device 'switch.1' ... ``` utils.lua should then check lan_vlan's device first, or fallback to br-lan anygw.lua should configure it's macvlan on top of the device `switch.1` if present or using the most common 'br-lan' added then a dynamic retrieval of the right device from `network.lan.device` tested on: - dlink,dsl-2750b-b1 (bmips/bcm6328) dsa with switch.1 - tp-link,td-w8968-v3 (bmips/bcm6318) dsa with switch.1 - cudy,wr3000s-v1 (mediatek/filogic) dsa with br-lan
7272d4d to
a5f3fb1
Compare
Contributor
Author
|
added a fix for some dsa devices which come up without anygw, and so without a dhcp server, because they miss an interface named 'br-lan' and protocols anygw and lan fail to be configured. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #1192. In dsa devices if another libremesh node is connected via cable
anygw starts working intermittently for hosts connected via cable
Manually adjust the bridge fdb, as suggested here [0], with an /etc/hotplug.d/net trigger
adding an entry that states that the anygw mac address can be found locally on device br-lan
Then add a nftables guard rule that drop packets with ether source address equal to the anygw_mac
on every dsa user ports that is member of br-lan to prevent icmp6 broadcast loops.
To use the command bridge it is necessary to add the package ip-bridge ~30KB.
This wouldn't be required in swconfig devices but an easy way to distinguish between dsa and swconfig devices
at compile time doesn't exists at the moment.
[0] https://www.kernel.org/doc/html/latest/networking/dsa/configuration.html#forwarding-database-fdb-management