diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 8b401eeaf9..f06ce2eb79 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -1263,9 +1263,12 @@
Scope=
- The scope of the route, which can be global,
- link or host. Defaults to
- global.
+ The scope of the route, which can be global, site,
+ link, host, or nowhere. For IPv4 route,
+ defaults to host if Type= is local
+ or nat, and link if Type= is
+ broadcast, multicast, or anycast.
+ In other cases, defaults to global.
@@ -1277,10 +1280,14 @@
- Table=num
+ Table=
- The table identifier for the route (a number between 1 and 4294967295, or 0 to unset).
- The table can be retrieved using ip route show table num.
+ The table identifier for the route. Takes default,
+ main, local or a number between 1 and 4294967295.
+ The table can be retrieved using ip route show table num.
+ If unset and Type= is local, broadcast,
+ anycast, or nat, then local is used.
+ In other cases, defaults to main.
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index 85df5d9395..592de4e430 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -1494,16 +1494,14 @@ int route_section_verify(Route *route, Network *network) {
route->section->filename, route->section->line);
}
- if (route->family != AF_INET6) {
- if (!route->table_set && IN_SET(route->type, RTN_LOCAL, RTN_BROADCAST, RTN_ANYCAST, RTN_NAT))
- route->table = RT_TABLE_LOCAL;
+ if (!route->table_set && IN_SET(route->type, RTN_LOCAL, RTN_BROADCAST, RTN_ANYCAST, RTN_NAT))
+ route->table = RT_TABLE_LOCAL;
- if (!route->scope_set) {
- if (IN_SET(route->type, RTN_LOCAL, RTN_NAT))
- route->scope = RT_SCOPE_HOST;
- else if (IN_SET(route->type, RTN_BROADCAST, RTN_ANYCAST))
- route->scope = RT_SCOPE_LINK;
- }
+ if (!route->scope_set && route->family != AF_INET6) {
+ if (IN_SET(route->type, RTN_LOCAL, RTN_NAT))
+ route->scope = RT_SCOPE_HOST;
+ else if (IN_SET(route->type, RTN_BROADCAST, RTN_ANYCAST, RTN_MULTICAST))
+ route->scope = RT_SCOPE_LINK;
}
if (network->n_static_addresses == 0 &&