Skip to contentSkip to conversation

Add support for neigh_forward_grat

PATCH Applied Danielle Ratson 3 participants 9 messages May 17 – May 20

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add support for neigh_forward_grat

The existing neighbor suppression unconditionally suppresses gratuitous ARP and unsolicited Neighbor Advertisements, which breaks legitimate use cases like Multi-Homing and EVPN where these announcements need to propagate across the VXLAN fabric.

This series adds a new neigh_forward_grat option that provides independent control of gratuitous ARP and unsolicited NA forwarding. When neigh_suppress is enabled and neigh_forward_grat is also enabled, regular neighbor discovery is suppressed while gratuitous announcements are forwarded.

Both port-level control (via IFLA_BRPORT_NEIGH_FORWARD_GRAT) and per-VLAN control (via BRIDGE_VLANDB_ENTRY_NEIGH_FORWARD_GRAT) are provided. The default value of OFF preserves existing behavior.

The new attributes use NLA_U8, although the kernel netlink guideline recommends NLA_U32 as the minimum integer type on the grounds that alignment makes smaller types equivalent on the wire. For a simple on/off attribute there is no technical advantage to u32 over u8, and keeping u8 preserves consistency with all surrounding bridge port attributes and avoids introducing new helpers alongside the existing infrastructure.

Patch #1: adds port-level support via ip link and bridge link commands. Patch #2: adds per-VLAN support via bridge vlan command.

Danielle Ratson (2):
iplink: bridge_slave: Add support for neigh_forward_grat
bridge: vlan: Add support for neigh_forward_grat

 bridge/link.c            | 14 ++++++++++++++
 bridge/vlan.c            | 18 ++++++++++++++++++
 ip/iplink_bridge_slave.c | 10 ++++++++++
 man/man8/bridge.8        | 25 ++++++++++++++++++++++++-
 man/man8/ip-link.8.in    | 10 ++++++++++
 5 files changed, 76 insertions(+), 1 deletion(-)
Signature · 1 line
2.51.0
#1 lore raw

PATCH 1/2 iplink: bridge_slave: Add support for neigh_forward_grat

Add support for controlling gratuitous ARP and unsolicited NA forwarding at the port level via the neigh_forward_grat option.

This allows configuring the option via:

$ ip link set dev <port> type bridge_slave neigh_forward_grat {on|off}

Or via the bridge command:

$ bridge link set dev <port> neigh_forward_grat {on|off}
---
 bridge/link.c            | 14 ++++++++++++++
 ip/iplink_bridge_slave.c | 10 ++++++++++
 man/man8/bridge.8        | 10 ++++++++++
 man/man8/ip-link.8.in    | 10 ++++++++++
 4 files changed, 44 insertions(+)
bridge/link.c +14 -0
index 7638797d..370d7de4 100644
@@ -174,6 +174,9 @@ static void print_protinfo(FILE *fp, struct rtattr *attr)
 				     "neigh_vlan_suppress %s ",
 				     rta_getattr_u8(at));
 		}
+		if (prtb[IFLA_BRPORT_NEIGH_FORWARD_GRAT])
+			print_on_off(PRINT_ANY, "neigh_forward_grat", "neigh_forward_grat %s ",
+				     rta_getattr_u8(prtb[IFLA_BRPORT_NEIGH_FORWARD_GRAT]));
 		if (prtb[IFLA_BRPORT_VLAN_TUNNEL])
 			print_on_off(PRINT_ANY, "vlan_tunnel", "vlan_tunnel %s ",
 				     rta_getattr_u8(prtb[IFLA_BRPORT_VLAN_TUNNEL]));
@@ -313,6 +316,7 @@ static void usage(void)
 		"                               [ mcast_max_groups MAX_GROUPS ]\n"
 		"                               [ neigh_suppress {on | off} ]\n"
 		"                               [ neigh_vlan_suppress {on | off} ]\n"
+		"                               [ neigh_forward_grat {on | off} ]\n"
 		"                               [ vlan_tunnel {on | off} ]\n"
 		"                               [ isolated {on | off} ]\n"
 		"                               [ locked {on | off} ]\n"
@@ -343,6 +347,7 @@ static int brlink_modify(int argc, char **argv)
 	int backup_port_idx = -1;
 	__s8 neigh_suppress = -1;
 	__s8 neigh_vlan_suppress = -1;
+	__s8 neigh_forward_grat = -1;
 	__s8 learning = -1;
 	__s8 learning_sync = -1;
 	__s8 flood = -1;
@@ -474,6 +479,12 @@ static int brlink_modify(int argc, char **argv)
 							   *argv, &ret);
 			if (ret)
 				return ret;
+		} else if (strcmp(*argv, "neigh_forward_grat") == 0) {
+			NEXT_ARG();
+			neigh_forward_grat = parse_on_off("neigh_forward_grat",
+							  *argv, &ret);
+			if (ret)
+				return ret;
 		} else if (strcmp(*argv, "vlan_tunnel") == 0) {
 			NEXT_ARG();
 			vlan_tunnel = parse_on_off("vlan_tunnel", *argv, &ret);
@@ -579,6 +590,9 @@ static int brlink_modify(int argc, char **argv)
 	if (neigh_vlan_suppress != -1)
 		addattr8(&req.n, sizeof(req), IFLA_BRPORT_NEIGH_VLAN_SUPPRESS,
 			 neigh_vlan_suppress);
+	if (neigh_forward_grat != -1)
+		addattr8(&req.n, sizeof(req), IFLA_BRPORT_NEIGH_FORWARD_GRAT,
+			 neigh_forward_grat);
 	if (vlan_tunnel != -1)
 		addattr8(&req.n, sizeof(req), IFLA_BRPORT_VLAN_TUNNEL,
 			 vlan_tunnel);
ip/iplink_bridge_slave.c +10 -0
index 3821923b..1be02041 100644
@@ -38,6 +38,7 @@ static void print_explain(FILE *f)
 		"			[ group_fwd_mask MASK ]\n"
 		"			[ neigh_suppress {on | off} ]\n"
 		"			[ neigh_vlan_suppress {on | off} ]\n"
+		"			[ neigh_forward_grat {on | off} ]\n"
 		"			[ vlan_tunnel {on | off} ]\n"
 		"			[ isolated {on | off} ]\n"
 		"			[ locked {on | off} ]\n"
@@ -275,6 +276,11 @@ static void bridge_slave_print_opt(struct link_util *lu, FILE *f,
 			     "neigh_vlan_suppress %s ",
 			     rta_getattr_u8(tb[IFLA_BRPORT_NEIGH_VLAN_SUPPRESS]));
 
+	if (tb[IFLA_BRPORT_NEIGH_FORWARD_GRAT])
+		print_on_off(PRINT_ANY, "neigh_forward_grat",
+			     "neigh_forward_grat %s ",
+			     rta_getattr_u8(tb[IFLA_BRPORT_NEIGH_FORWARD_GRAT]));
+
 	if (tb[IFLA_BRPORT_GROUP_FWD_MASK]) {
 		char convbuf[256];
 		__u16 fwd_mask;
@@ -415,6 +421,10 @@ static int bridge_slave_parse_opt(struct link_util *lu, int argc, char **argv,
 			NEXT_ARG();
 			bridge_slave_parse_on_off("neigh_vlan_suppress", *argv,
 						  n, IFLA_BRPORT_NEIGH_VLAN_SUPPRESS);
+		} else if (strcmp(*argv, "neigh_forward_grat") == 0) {
+			NEXT_ARG();
+			bridge_slave_parse_on_off("neigh_forward_grat", *argv,
+						  n, IFLA_BRPORT_NEIGH_FORWARD_GRAT);
 		} else if (matches(*argv, "group_fwd_mask") == 0) {
 			__u16 mask;
 
man/man8/bridge.8 +10 -0
index fe800d3f..aae6c75a 100644
@@ -55,6 +55,7 @@ bridge \- show / manipulate bridge addresses and devices
 .BR mcast_to_unicast " { " on " | " off " } ] [ "
 .BR neigh_suppress " { " on " | " off " } ] [ "
 .BR neigh_vlan_suppress " { " on " | " off " } ] [ "
+.BR neigh_forward_grat " { " on " | " off " } ] [ "
 .BR vlan_tunnel " { " on " | " off " } ] [ "
 .BR isolated " { " on " | " off " } ] [ "
 .BR locked " { " on " | " off " } ] [ "
@@ -659,6 +660,15 @@ enabled on the port. When on, the \fBbridge link\fR option \fBneigh_suppress\fR
 has no effect and the per-VLAN state is set using the \fBbridge vlan\fR option
 \fBneigh_suppress\fR. By default this flag is off.
 
+.TP
+.BR "neigh_forward_grat on " or " neigh_forward_grat off "
+Controls whether gratuitous ARP packets and unsolicited Neighbor Advertisement
+packets are forwarded when neighbor suppression is enabled on the port.
+By default this flag is off, meaning gratuitous ARP and unsolicited NA packets
+will be suppressed when neighbor suppression is enabled. Setting this flag to
+on allows these packets to be forwarded even when neighbor suppression is
+enabled.
+
 .TP
 .BR "vlan_tunnel on " or " vlan_tunnel off "
 Controls whether vlan to tunnel mapping is enabled on the port. By
man/man8/ip-link.8.in +10 -0
index ef45fe08..e89b2db3 100644
@@ -2677,6 +2677,8 @@ the following additional arguments are supported:
 ] [
 .BR neigh_vlan_suppress " { " on " | " off " }"
 ] [
+.BR neigh_forward_grat " { " on " | " off " }"
+] [
 .BR vlan_tunnel " { " on " | " off " }"
 ] [
 .BR isolated " { " on " | " off " }"
@@ -2791,6 +2793,14 @@ is enabled on the port. When on, the \fBbridge link\fR option
 \fBneigh_suppress\fR has no effect and the per-VLAN state is set using the
 \fBbridge vlan\fR option \fBneigh_suppress\fR. By default this flag is off.
 
+.BR neigh_forward_grat " { " on " | " off " }"
+- controls whether gratuitous ARP packets and unsolicited Neighbor
+Advertisement packets are forwarded when neighbor suppression is enabled
+on the port. By default this flag is off, meaning gratuitous ARP and
+unsolicited NA packets will be suppressed when neighbor suppression is
+enabled. Setting this flag to on allows these packets to be forwarded even
+when neighbor suppression is enabled.
+
 .BR vlan_tunnel " { " on " | " off " }"
 - controls whether vlan to tunnel mapping is enabled on the port. By
 default this flag is off.
Signature · 1 line
2.51.0
#4 lore raw

PATCH 2/2 bridge: vlan: Add support for neigh_forward_grat

In reply to Danielle Ratson

Add support for controlling gratuitous ARP and unsolicited NA forwarding at the per-VLAN level via the neigh_forward_grat option.

This allows configuring the option via:

$ bridge vlan set dev <port> vid <vlan> neigh_forward_grat {on|off}
---
 bridge/vlan.c     | 18 ++++++++++++++++++
 man/man8/bridge.8 | 15 ++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)
bridge/vlan.c +18 -0
index 27d31ba8..ff03ac86 100644
@@ -39,6 +39,7 @@ static void usage(void)
 		"                                               [ mcast_router MULTICAST_ROUTER ]\n"
 		"                                               [ mcast_max_groups MAX_GROUPS ]\n"
 		"                                               [ neigh_suppress {on | off} ]\n"
+		"                                               [ neigh_forward_grat {on | off} ]\n"
 		"       bridge vlan { show } [ dev DEV ] [ vid VLAN_ID ]\n"
 		"       bridge vlan { tunnelshow } [ dev DEV ] [ vid VLAN_ID ]\n"
 		"       bridge vlan global { set } vid VLAN_ID dev DEV\n"
@@ -368,6 +369,18 @@ static int vlan_option_set(int argc, char **argv)
 			addattr8(&req.n, sizeof(req),
 				 BRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS,
 				 neigh_suppress);
+		} else if (strcmp(*argv, "neigh_forward_grat") == 0) {
+			bool neigh_forward_grat;
+			int ret;
+
+			NEXT_ARG();
+			neigh_forward_grat = parse_on_off("neigh_forward_grat",
+							  *argv, &ret);
+			if (ret)
+				return ret;
+			addattr8(&req.n, sizeof(req),
+				 BRIDGE_VLANDB_ENTRY_NEIGH_FORWARD_GRAT,
+				 neigh_forward_grat);
 		} else {
 			if (matches(*argv, "help") == 0)
 				NEXT_ARG();
@@ -1012,6 +1025,11 @@ static void print_vlan_opts(struct rtattr *a, int ifindex)
 		print_on_off(PRINT_ANY, "neigh_suppress", "neigh_suppress %s ",
 			     rta_getattr_u8(vattr));
 	}
+	if (vtb[BRIDGE_VLANDB_ENTRY_NEIGH_FORWARD_GRAT]) {
+		vattr = vtb[BRIDGE_VLANDB_ENTRY_NEIGH_FORWARD_GRAT];
+		print_on_off(PRINT_ANY, "neigh_forward_grat",
+			     "neigh_forward_grat %s ", rta_getattr_u8(vattr));
+	}
 	print_nl();
 	if (show_stats)
 		bridge_print_vlan_stats_only(&vstats);
man/man8/bridge.8 +14 -1
index aae6c75a..d2323521 100644
@@ -241,7 +241,8 @@ bridge \- show / manipulate bridge addresses and devices
 .IR MAX_GROUPS " ] [ "
 .B mcast_router
 .IR MULTICAST_ROUTER " ] [ "
-.BR neigh_suppress " { " on " | " off " } ]"
+.BR neigh_suppress " { " on " | " off " } ] [ "
+.BR neigh_forward_grat " { " on " | " off " } ]"
 
 .ti -8
 .BR "bridge vlan" " [ " show " | " tunnelshow " ] [ "
@@ -1486,6 +1487,18 @@ for a given VLAN on a given port. By default this flag is off.
 Note that this option only takes effect when \fBbridge link\fR option
 \fBneigh_vlan_suppress\fR is enabled for a given port.
 
+.TP
+.BR "neigh_forward_grat on " or " neigh_forward_grat off "
+Controls whether gratuitous ARP packets and unsolicited Neighbor Advertisement
+packets are forwarded when neighbor suppression is enabled for a given VLAN
+on a given port. By default this flag is off, meaning gratuitous ARP and
+unsolicited NA packets will be suppressed when neighbor suppression is enabled.
+Setting this flag to on allows these packets to be forwarded even when
+neighbor suppression is enabled.
+
+Note that this option only takes effect when \fBbridge link\fR option
+\fBneigh_vlan_suppress\fR is enabled for a given port.
+
 .SS bridge vlan show - list vlan configuration.
 
 This command displays the current VLAN filter table.
Signature · 1 line
2.51.0
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH iproute2-next 1/2] iplink: bridge_slave: Add support for neigh_forward_grat

In reply to Danielle Ratson
Quoted 12 lines · Danielle Ratson

Add support for controlling gratuitous ARP and unsolicited NA forwarding at the port level via the neigh_forward_grat option.

This allows configuring the option via:

$ ip link set dev <port> type bridge_slave neigh_forward_grat {on|off}

Or via the bridge command:

$ bridge link set dev <port> neigh_forward_grat {on|off}
Quoted 7 lines
---
 bridge/link.c            | 14 ++++++++++++++
 ip/iplink_bridge_slave.c | 10 ++++++++++
 man/man8/bridge.8        | 10 ++++++++++
 man/man8/ip-link.8.in    | 10 ++++++++++
 4 files changed, 44 insertions(+)
Acked-by on v1 2/2
#5 lore raw

Re: [PATCH iproute2-next 2/2] bridge: vlan: Add support for neigh_forward_grat

In reply to Danielle Ratson
Quoted 6 lines · Danielle Ratson

Add support for controlling gratuitous ARP and unsolicited NA forwarding at the per-VLAN level via the neigh_forward_grat option.

This allows configuring the option via:

$ bridge vlan set dev <port> vid <vlan> neigh_forward_grat {on|off}
Quoted 8 lines
---
 bridge/vlan.c     | 18 ++++++++++++++++++
 man/man8/bridge.8 | 15 ++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)
#8 lore raw
In reply to Danielle Ratson
This series was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Hello:

This series was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Quoted 5 lines · On Sun, 17 May 2026 11:24:59 +0300 you wrote:

The existing neighbor suppression unconditionally suppresses gratuitous ARP and unsolicited Neighbor Advertisements, which breaks legitimate use cases like Multi-Homing and EVPN where these announcements need to propagate across the VXLAN fabric.

Quoted 7 lines

This series adds a new neigh_forward_grat option that provides independent control of gratuitous ARP and unsolicited NA forwarding. When neigh_suppress is enabled and neigh_forward_grat is also enabled, regular neighbor discovery is suppressed while gratuitous announcements are forwarded.

[...]

Here is the summary with links:
- [iproute2-next,1/2] iplink: bridge_slave: Add support for neigh_forward_grat

    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=2c6d5e670539
  - [iproute2-next,2/2] bridge: vlan: Add support for neigh_forward_grat
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=5d8d82f60c52

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Acked-by on v1 1/2
#3 lore raw

Re: [PATCH iproute2-next 1/2] iplink: bridge_slave: Add support for neigh_forward_grat

In reply to Danielle Ratson
Quoted 12 lines · Danielle Ratson

Add support for controlling gratuitous ARP and unsolicited NA forwarding at the port level via the neigh_forward_grat option.

This allows configuring the option via:

$ ip link set dev <port> type bridge_slave neigh_forward_grat {on|off}

Or via the bridge command:

$ bridge link set dev <port> neigh_forward_grat {on|off}
Quoted 7 lines
---
 bridge/link.c            | 14 ++++++++++++++
 ip/iplink_bridge_slave.c | 10 ++++++++++
 man/man8/bridge.8        | 10 ++++++++++
 man/man8/ip-link.8.in    | 10 ++++++++++
 4 files changed, 44 insertions(+)
Acked-by on v1 2/2
#6 lore raw

Re: [PATCH iproute2-next 2/2] bridge: vlan: Add support for neigh_forward_grat

In reply to Danielle Ratson
Quoted 6 lines · Danielle Ratson

Add support for controlling gratuitous ARP and unsolicited NA forwarding at the per-VLAN level via the neigh_forward_grat option.

This allows configuring the option via:

$ bridge vlan set dev <port> vid <vlan> neigh_forward_grat {on|off}
Quoted 8 lines
---
 bridge/vlan.c     | 18 ++++++++++++++++++
 man/man8/bridge.8 | 15 ++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)
#7 lore raw

Re: [PATCH iproute2-next 2/2] bridge: vlan: Add support for neigh_forward_grat

Quoted 16 lines · Nikolay Aleksandrov
Quoted 6 lines · Danielle Ratson

Add support for controlling gratuitous ARP and unsolicited NA forwarding at the per-VLAN level via the neigh_forward_grat option.

This allows configuring the option via:

$ bridge vlan set dev <port> vid <vlan> neigh_forward_grat {on|off}
Quoted 8 lines
---
 bridge/vlan.c     | 18 ++++++++++++++++++
 man/man8/bridge.8 | 15 ++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)
Quoted 1 line

sorry for the noise, for some reason I saw these marked as new without any replies in mutt and reviewed them again. :)