Skip to content

fix: anygw address not working via cable in dsa devices - #1293

Open
a-gave wants to merge 1 commit into
libremesh:masterfrom
a-gave:fix/anygw-dsa-mac
Open

a-gave wants to merge 1 commit into
libremesh:masterfrom
a-gave:fix/anygw-dsa-mac

Conversation

@a-gave

@a-gave a-gave commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

WIP

Retrying the approach of #1214:

  • using a better hotplug script that do bridge fdb replace instead of flush and then add
  • the hotplug script is attached both to net and iface events for the devices anygw and br-lan
  • a nftable rule that guards ingress: should not be from an anygw mac
  • a nftable rule that guards egress: should not be to an anygw mac

Works so far on:

cudy-wr3000s-v1 (dsa) ---- switch ----- mikrotik_sxtsq-5-ac (dsa)
                              |
                           client

@a-gave
a-gave deployed to physical-lab October 20, 2026 12:07 — with GitHub Actions Active
@a-gave
a-gave deployed to physical-lab October 20, 2026 13:30 — with GitHub Actions Active
@a-gave
a-gave deployed to physical-lab October 20, 2026 13:30 — with GitHub Actions Active
@a-gave
a-gave deployed to physical-lab October 20, 2026 13:30 — with GitHub Actions Active
@a-gave
a-gave deployed to physical-lab October 20, 2026 13:30 — with GitHub Actions Active
@a-gave
a-gave deployed to physical-lab October 20, 2026 13:30 — with GitHub Actions Active
@a-gave
a-gave deployed to physical-lab October 20, 2026 13:30 — with GitHub Actions Active

[ "$DEVICE" = "$BRIDGE_INTERFACE" ] || [ "$DEVICE" = "$MACVLAN_INTERFACE" ] || exit 0

MACVLAN_MAC=$(ip l s $MACVLAN_INTERFACE 2>/dev/null | grep ether | awk '{ print $2 }' )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better:

MACVLAN_MAC=$(cat /sys/class/net/$MACVLAN_INTERFACE/address)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Done

@pony1k

pony1k commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Did you check if the nftable rules actually catch packets? Just curious, why are you filtering on dsa conduit ports, like eth0 and not on lan1, lan2, etc.? Are you sure this works with all switches? From what I've read, the packets passing here would use a switch specifc tagging protcol that may change the location of the mac source address in the frame.

If outgoing frames from anygw mac address are prevented from leaving through ethernet ports, wouldn't that break internet connection for clients connected via cable?

This branch is waiting to be deployed

1 waiting deployment
physical-lab — a336d0d8 Waiting Oct 21, 2026 by a-gave via test-firmware (librerouter_1 / 24.10.6) #206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants