Commit graph

755 commits

Author SHA1 Message Date
Yu Watanabe 59d475ba40 network/radv: introduce ReachableTimeSec= setting
To make the reachable time in the RA header sent by networkd
configurable.
2024-04-22 18:41:37 +09:00
Yu Watanabe 418f2dc755 network: introduce network- and protocol-independent default for UseDomains=
Follow-up for fb57300743.

Prompted by #32273.
2024-04-20 12:01:53 +09:00
Yu Watanabe 769f9744b7 network/ndisc: disable Neighbor discovery client if RADV is enabled
Running both sd-ndisc and sd-radv should be mostly a misconfiguration,
but may not. So, let's only disable sd-ndisc by default when sd-radv is
enabled, but allow when both are explicitly requested.
2024-04-18 09:40:23 +09:00
Henry Li fb57300743 network: add mechanism to configure default UseDomains= setting, update man page and add test 2024-04-13 16:54:31 -07:00
Yu Watanabe 6df0059441 network/ndisc: add basic support for Redirect message
Closes #31438.
2024-04-05 05:57:54 +09:00
Yu Watanabe a3ed665a29 network/dhcp-server: introduce PersistLeases= setting
Requested at https://github.com/systemd/systemd/pull/31772#issuecomment-2000053357.
2024-03-27 13:21:15 +00:00
cunshunxia cc59d1014f man: fix a few issues in manpage
fix: #31482

Signed-off-by: cunshunxia <cunshunxia@tencent.com>
2024-03-20 15:24:11 +01:00
Yu Watanabe 5582b36c38 network/dhcp-server: save leases in state directory
Then, we can read the lease file on restart, and the DHCP server will be
able to manage previously assigned addresses.

To save leases in the state directory /var/lib/systemd/network/, this
adds systemd-networkd-dhcp-server.service, and by default
systemd-networkd does not start the DHCP server without the heler
service started.

Closes #29991.
2024-03-12 01:57:17 +09:00
Yu Watanabe 39af486a7f network/ndisc: drop redundant sd_ndisc_router_get_icmp6_ratelimit()
This effectively reverts 9175002864.

The retrans time field in RA message is for neighbor solicitation,
and the commit d4c8de21a0 makes the value
assigned to the correct sysctl property.

Let's deprecate the option, and drop the redundant functions.
2024-02-28 11:05:00 +00:00
Yu Watanabe 3976c43092 network: introduce per-interface IP forwarding settings
This deprecates IPForward= setting, which unconditionally controled
the global setting, even though it is a setting in .network file.

Instead, this introduces new IPv4Forwarding= and IPv6Forwarding=
settings both in .network and networkd.conf.
If these settings are specified in a .network file, then the
per-interface forwarding setting will be configured.
If specified in networkd.conf, then the global IP forwarding setting will
be configured.

Closes #30648.
2024-02-22 19:24:12 +00:00
Martin Ivicic ea932bd34d networkd: support setting dhcp server port 2024-02-21 19:33:27 +09:00
Yu Watanabe 1452d49741 network/ndisc: set IPv6 neighbor reachable time
Closes #31402.
2024-02-20 15:31:39 +09:00
Yu Watanabe 6a32108812 man: add missing "=" after setting name
Follow-up for b93bf1bf9f.
2024-02-09 19:03:56 +09:00
Yu Watanabe 7dc431839e network/dhcp4: disable IPv6OnlyMode= by default
As explained in #30891, IPv6OnlyMode= should be enabled with 464XLAT
support, but we do not support it yet. Let's disable by default.

Fixes #30891.
2024-02-07 23:30:17 +00:00
Yu Watanabe a853cc99e6 network: adjust default RequiredForOnline= and RequiredFamilyForOnline= setting
E.g. a bonding port does not support addressing, hence the default
should be 'enslaved'.

Follow-up for 3255bda698.

Closes #27724.
2024-02-02 15:38:30 +09:00
Yu Watanabe c89efaf9e5 man: fix default behavior of RequiredFamilyForOnline= 2024-02-02 15:38:30 +09:00
Matt Muggeridge d4c8de21a0 IPv6 RA: Support the Retrans Timer field (IPv6 Conformance Test: v6LC.2.1.5)
The RA's Retransmission Timer field was being ignored. This resolves the IPv6
Core Conformance test, v6LC.2.1.5 [1].

Retransmission Timer is a 32-bit unsigned integer. The time, in milliseconds,
between retransmitted Neighbor Solicitation messages. Used by the Address
Resolution and Neighbor Unreachability Detection (NUD) algorithm.

Support setting a default value for the neighbour retransmission timer value with:

    [Network]
    IPv6RetransmissionTimeSec=<int>

By default, upon receiving a Router Advertisement with the Retransmission Timer
field set to a non-zero value, it will update the kernel's retransmit timer value.
To disable this behaviour, configure the UseIPv6RetransmissionTime= under the
[IPv6AcceptRA] section.

    [IPv6AcceptRA]
    UseIPv6RetransmissionTime=<bool>

RFC4861: Neighbor Discovery in IPv6
  * Section 4.2 RA Message Format.
  * Section 6.3.4 Processing Received Router Advertisements

A Router Advertisement field (e.g., Cur Hop Limit, Reachable Time,
and Retrans Timer) may contain a value denoting that it is
unspecified. In such cases, the parameter should be ignored and the
host should continue using whatever value it is already using. In
particular, a host MUST NOT interpret the unspecified value as
meaning change back to the default value that was in use before the
first Router Advertisement was received.

The RetransTimer variable SHOULD be copied from the Retrans Timer
field, if the received value is non-zero.

References
[1] IPv6 Core Conformance Spec (PDF)
2024-01-23 03:18:01 +09:00
Nick Cao 4be1fc8443 network: Add L3MasterDevice= into routing policy 2024-01-19 00:17:50 +00:00
Yu Watanabe 3255bda698 network: make 'carrier' as the default required operational state for CAN device
As CAN devices do not support IP address, hence the state never goes to
higher than 'carrier'.

Prompted by https://github.com/linux-can/can-utils/issues/68#issuecomment-1327987724.
2024-01-17 04:05:43 +09:00
Yu Watanabe cb0a3b8c14 network/route: drop TTL propagate support for MPLS routes
This effectively reverts 9b88f20aba.

We do not support MPLS routes, only IPv4 or IPv6 routes are supported.
2024-01-03 08:41:53 +09:00
David Tardon eea10b26f7 man: use same version in public and system ident. 2023-12-25 15:51:47 +01:00
David Tardon 617b85d10e man: use <warning> for warnings 2023-12-25 10:00:43 +01:00
Raito Bezarius b49595503d networkd: support proxy_arp_pvlan sysctl
The proxy ARP private VLAN sysctl is useful for VLAN aggregation, see
https://sysctl-explorer.net/net/ipv4/proxy_arp_pvlan/ for details.
2023-12-24 03:40:03 +09:00
David Tardon 13a69c120b man: use <simplelist> for 'See also' sections
This is just a slight markup improvement; there should be no difference
in rendering.
2023-12-23 08:28:57 +01:00
Yu Watanabe a61738b3a6 network/address: make Address= in [Network] support an empty string
Closes #30485.
2023-12-21 04:08:53 +09:00
Yu Watanabe 03a46b5eca man,NEWS: mention that all previously assigned VLAN IDs are cleared
Addresses https://github.com/systemd/systemd/pull/29987#issuecomment-1863934902.
2023-12-20 19:22:53 +09:00
Yu Watanabe b9e6e92510 man: fix indentation 2023-12-20 19:21:11 +09:00
Yu Watanabe bbc05bec98 network/nexthop: introduce ManageForeignNextHops= boolean setting
Closes #29034.
2023-12-12 23:51:10 +09:00
Zbigniew Jędrzejewski-Szmek bfa95c369a
Merge pull request #29987 from yuwata/network-bridge-vlan
network: remove unnecessary bridge vlan IDs
2023-12-06 22:25:42 +01:00
Дамјан Георгиевски 51219be992 man: typo, it's DHCP not DCHP in DHCPPrefixDelegation= 2023-11-29 04:00:15 +09:00
Yu Watanabe cf289b1415 network/dhcp: disable RapidCommit= by default when AllowList=/DenyList= is specified
AllowList= and DenyList= filter only DHCPOFFER messages. So, if
RapidCommit= is enabled, then networkd unconditionally accepts a rapid
ACK message even if its sender is filtered out by the lists.

As AllowList=/DenyList= implemented earlier than RapidCommit=, so
enabling RapidCommit= unconditionally by default may break existing
setups that use AllowList=/DenyList=.

Let's disable RapidCommit= by default when AllowList=/DenyList= is
enabled. Still the setting can be enabled by setting explicitly even
AllowList=/DenyList= is also specified.
2023-11-22 05:24:18 +09:00
Yu Watanabe 24bb67ed12 man: [DHCPv4] RapidCommit= is disabled when Anonymize=yes 2023-11-22 04:57:05 +09:00
Yu Watanabe 228693af47 network/brvlan: remove unnecessary bridge vlan IDs
When an interface is being reconfigured with different bridge vlan
settings, this makes old vlan IDs on the interface removed.

This also makes the PVID= setting support negative boolean value, e.g. "no",
in which case, the currently assigned PVID (typically, assigned by the
kernel when an interface is joined to a bridge) is dropped.
This feature is requested by #15291.

Note, if a .network file has no settings about bridge vlan, networkd
keeps the currently assigned vlan IDs. That's intended, to make not
break existing setups.
When a .network file has only PVID=no line in [BridgeVLAN] section, then
all assigned vlan IDs are removed.

Fixes #29975.
Closes #15291.
2023-11-13 03:58:46 +09:00
Yu Watanabe f269016c3e network/brvlan: make [BridgeVLAN] settings support an empty string
This also renames Network.pvid and friends.
2023-11-13 03:58:46 +09:00
Yu Watanabe 1fa0a4eff7 network: add [DHCPServer] RapidCommit= setting 2023-11-08 02:42:03 +09:00
Zbigniew Jędrzejewski-Szmek bf63dadbc6 man: more hyperlinks and other fixes
Closes https://github.com/systemd/systemd/issues/29814.
2023-11-06 20:16:34 +01:00
Yu Watanabe 986e182352 network: do not try to set invalid value for IPv6 hop limit 2023-11-06 15:53:25 +09:00
Lennart Poettering fe1f83e559
Merge pull request #29827 from yuwata/network-install-default-configs
network: add meson option to install default configs
2023-11-03 11:37:04 +01:00
Yu Watanabe 45a7ef454e man: mention DHCPv4 Router option is ignored when Classless Static Routes option is received
For #29564.
2023-11-03 10:14:59 +00:00
Yu Watanabe 2c4534854a man: mention that network files should be prefixed with number smaller than 70 2023-11-03 11:42:19 +09:00
Yu Watanabe 2a94838b98 man: fix typo
Follow-up for ba87a61d05.
2023-11-01 18:38:57 +09:00
Yu Watanabe ba87a61d05 network: support ID_NET_MANAGED_BY udev property
If the property is set, networkd manages the interface only when its
value is "io.systemd.Network".

Closes #29768.
2023-11-01 10:14:27 +01:00
Ronan Pigott b90480c80d network: introduce SendHostname/Hostname DHCPv6 options
These options were previously reused by the DHCPv6 client from the
DHCPv4 client settings. Let's separate them for consistency.
2023-10-30 11:04:10 +00:00
Ronan Pigott 808b65a087 network: implement RFC4039 DHCP Rapid Commit
This implements the DHCPv4 equivalent of the DHCPv6 Rapid Commit option,
enabling a lease to be selected in an accelerated 2-message exchange
instead of the typical 4-message exchange.
2023-10-26 15:26:50 -07:00
Yu Watanabe fc35a9f8d1 network/dhcp4: support IPv6 only mode (RFC 8925)
Co-authored-by: Susant Sahani <ssahani@gmail.com>
2023-10-11 21:42:13 +09:00
Susant Sahani 34bea0a1e9 network/dhcp-server: allow to configure IPv6 only preferred option
Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2023-10-11 21:42:13 +09:00
Yu Watanabe b93bf1bf9f network: introduce [DHCPv4] RequestAddress= setting
This may be useful when requesting a specific address.

Closes #29437.
2023-10-05 06:58:08 +09:00
Yu Watanabe fcf17d693c man: update the list of ignored options by Anonymize=yes
Closes #29362.
2023-10-03 10:02:02 +01:00
Abderrahim Kitouni aefdc1124f man: update version information
As I noticed a lot of missing information when trying to implement checking
for missing info. I reimplemented the version information script to be more
robust, and here is the result.

Follow up to ec07c3c80b
2023-09-19 00:37:37 +01:00
Luca Boccassi 23bef849d9
Merge pull request #29119 from yuwata/network-dhcp-server-allow-null-server-address
network/dhcp-server: allow null server address
2023-09-17 12:36:33 +01:00