diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 1c26609917..126accaca9 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -4420,6 +4420,15 @@ ServerAddress=192.168.0.1/24
+
+ Preference=
+
+ Specifies the preference of the route option. Takes one of high,
+ medium, or low. Defaults to medium.
+
+
+
+
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index 09a718efda..bf91f2c4c1 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -429,6 +429,7 @@ IPv6Prefix.RouteMetric, config_parse_prefix_metric,
IPv6Prefix.Token, config_parse_prefix_token, 0, 0
IPv6RoutePrefix.Route, config_parse_route_prefix, 0, 0
IPv6RoutePrefix.LifetimeSec, config_parse_route_prefix_lifetime, 0, 0
+IPv6RoutePrefix.Preference, config_parse_route_prefix_preference, 0, 0
IPv6PREF64Prefix.Prefix, config_parse_pref64_prefix, 0, 0
IPv6PREF64Prefix.LifetimeSec, config_parse_pref64_prefix_lifetime, 0, 0
LLDP.MUDURL, config_parse_mud_url, 0, offsetof(Network, lldp_mudurl)
diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c
index 9b1bd1287a..fbf87091a3 100644
--- a/src/network/networkd-radv.c
+++ b/src/network/networkd-radv.c
@@ -1134,6 +1134,37 @@ int config_parse_route_prefix_lifetime(
return 0;
}
+int config_parse_route_prefix_preference(
+ const char *unit,
+ const char *filename,
+ unsigned line,
+ const char *section,
+ unsigned section_line,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ _cleanup_(route_prefix_free_or_set_invalidp) RoutePrefix *p = NULL;
+ Network *network = ASSERT_PTR(userdata);
+ int r;
+
+ assert(filename);
+
+ r = route_prefix_new_static(network, filename, section_line, &p);
+ if (r < 0)
+ return log_oom();
+
+ r = config_parse_router_preference(unit, filename, line, section, section_line,
+ lvalue, ltype, rvalue, &p->route.preference, NULL);
+ if (r <= 0)
+ return r;
+
+ TAKE_PTR(p);
+ return 0;
+}
+
int config_parse_pref64_prefix(
const char *unit,
const char *filename,
diff --git a/src/network/networkd-radv.h b/src/network/networkd-radv.h
index afde1fcfe2..3f0a374632 100644
--- a/src/network/networkd-radv.h
+++ b/src/network/networkd-radv.h
@@ -86,6 +86,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_radv_dns);
CONFIG_PARSER_PROTOTYPE(config_parse_radv_search_domains);
CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix);
CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_lifetime);
+CONFIG_PARSER_PROTOTYPE(config_parse_route_prefix_preference);
CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix);
CONFIG_PARSER_PROTOTYPE(config_parse_pref64_prefix_lifetime);
CONFIG_PARSER_PROTOTYPE(config_parse_router_home_agent_lifetime);