diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml
index 6a217d9cae..a9ebd153b8 100644
--- a/man/systemd.netdev.xml
+++ b/man/systemd.netdev.xml
@@ -1017,6 +1017,17 @@
+
+
+ MinSourcePort=
+
+ Specifies the lowest value of the UDP tunnel source UDP port (in range 1…65535).
+ Defaults to unset.
+
+
+
+
+
diff --git a/src/network/netdev/bareudp.c b/src/network/netdev/bareudp.c
index 1df886573b..fdde881520 100644
--- a/src/network/netdev/bareudp.c
+++ b/src/network/netdev/bareudp.c
@@ -34,6 +34,12 @@ static int netdev_bare_udp_fill_message_create(NetDev *netdev, Link *link, sd_ne
if (r < 0)
return r;
+ if (u->min_port > 0) {
+ r = sd_netlink_message_append_u16(m, IFLA_BAREUDP_SRCPORT_MIN, u->min_port);
+ if (r < 0)
+ return r;
+ }
+
return 0;
}
diff --git a/src/network/netdev/bareudp.h b/src/network/netdev/bareudp.h
index a8a33b3e4d..6672cbde75 100644
--- a/src/network/netdev/bareudp.h
+++ b/src/network/netdev/bareudp.h
@@ -23,6 +23,7 @@ struct BareUDP {
BareUDPProtocol iftype;
uint16_t dest_port;
+ uint16_t min_port;
};
DEFINE_NETDEV_CAST(BAREUDP, BareUDP);
diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf
index 8325c8779d..2ac92e061f 100644
--- a/src/network/netdev/netdev-gperf.gperf
+++ b/src/network/netdev/netdev-gperf.gperf
@@ -238,6 +238,7 @@ Bridge.FDBMaxLearned, config_parse_bridge_fdb_max_learned,
VRF.TableId, config_parse_uint32, 0, offsetof(Vrf, table) /* deprecated */
VRF.Table, config_parse_uint32, 0, offsetof(Vrf, table)
BareUDP.DestinationPort, config_parse_ip_port, 0, offsetof(BareUDP, dest_port)
+BareUDP.MinSourcePort, config_parse_ip_port, 0, offsetof(BareUDP, min_port)
BareUDP.EtherType, config_parse_bare_udp_iftype, 0, offsetof(BareUDP, iftype)
WireGuard.FirewallMark, config_parse_unsigned, 0, offsetof(Wireguard, fwmark)
WireGuard.FwMark, config_parse_unsigned, 0, offsetof(Wireguard, fwmark) /* deprecated */