Commit graph

736 commits

Author SHA1 Message Date
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
Tj ecac48783c doc: Scope is automatic for IPv6 address
The kernel automatically sets the scope of IPv6 addresses. That is
0 (global), 254 (host), 253 (link).
2023-09-15 16:12:11 +02:00
Yu Watanabe e443a88a9a man: update [DHCPServer] ServerAddress= 2023-09-08 20:03:40 +09:00
Susant Sahani 6e8f5e4c1f network: ndisc - Allow to parse PREF64 prefix 2023-09-04 23:41:02 +09:00
Susant Sahani 6a6d27bc5b network: sd-radv - Allow to configure Mobile IPv6 Home Agent 2023-09-04 23:40:40 +09:00
Yu Watanabe c97f268f29 man: mention version info for NFTSet= setting
Follow-up for fc289dd0ad.
2023-09-01 13:29:27 +01:00
Yu Watanabe 1d4c874d3c
Merge pull request #24570 from topimiettinen/nft-sets-v2
network: firewall integration with NFT sets
2023-09-01 20:13:39 +09:00
Abderrahim Kitouni ec07c3c80b man: add version info
This tries to add information about when each option was added. It goes
back to version 183.

The version info is included from a separate file to allow generating it,
which would allow more control on the formatting of the final output.
2023-08-29 14:07:24 +01:00
Topi Miettinen fc289dd0ad
network: firewall integration with NFT sets
New directive `NFTSet=` provides a method for integrating network configuration
into firewall rules with NFT sets. The benefit of using this setting is that
static network configuration or dynamically obtained network addresses can be
used in firewall rules with the indirection of NFT set types. For example,
access could be granted for hosts in the local subnetwork only. Firewall rules
using IP address of an interface are also instantly updated when the network
configuration changes, for example via DHCP.

This option expects a whitespace separated list of NFT set definitions. Each
definition consists of a colon-separated tuple of source type (one of
"address", "prefix", or "ifindex"), NFT address family (one of "arp", "bridge",
"inet", "ip", "ip6", or "netdev"), table name and set name. The names of tables
and sets must conform to lexical restrictions of NFT table names. The type of
the element used in the NFT filter must match the type implied by the
directive ("address", "prefix" or "ifindex") and address type (IPv4 or IPv6)
as shown type implied by the directive ("address", "prefix" or "ifindex") and
address type (IPv4 or IPv6) must also match the set definition.

When an interface is configured with IP addresses, the addresses, subnetwork
masks or interface index will be appended to the NFT sets. The information will
be removed when the interface is deconfigured. systemd-networkd only inserts
elements to (or removes from) the sets, so the related NFT rules, tables and
sets must be prepared elsewhere in advance. Failures to manage the sets will be
ignored.

/etc/systemd/network/eth.network
```
[DHCPv4]
...
NFTSet=prefix:netdev:filter:eth_ipv4_prefix
```

Example NFT rules:
```
table netdev filter {
        set eth_ipv4_prefix {
                type ipv4_addr
                flags interval
        }
        chain eth_ingress {
                type filter hook ingress device "eth0" priority filter; policy drop;
                ip saddr != @eth_ipv4_prefix drop
                accept
        }
}
```
```
$ sudo nft list set netdev filter eth_ipv4_prefix
table netdev filter {
        set eth_ipv4_prefix {
                type ipv4_addr
                flags interval
                elements = { 10.0.0.0/24 }
        }
}
```
2023-08-26 21:37:09 +03:00
Susant Sahani 1925f829ab network: sd-radv - Introduce pref64 support (RFC8781)
Implements: https://datatracker.ietf.org/doc/html/rfc8781

```

[IPv6PREF64Prefix]
Prefix=2003:da8:1:0::/64
ValidLifetimeSec=30m

Frame 16: 126 bytes on wire (1008 bits), 126 bytes captured (1008 bits) on interface veth99, id 0
Ethernet II, Src: 06:c7:41:95:1d:7f (06:c7:41:95:1d:7f), Dst: IPv6mcast_01 (33:33:00:00:00:01)
Internet Protocol Version 6, Src: fe80::4c7:41ff:fe95:1d7f, Dst: ff02::1
Internet Control Message Protocol v6
    Type: Router Advertisement (134)
    Code: 0
    Checksum: 0x0ca0 [correct]
    [Checksum Status: Good]
    Cur hop limit: 0
    Flags: 0x00, Prf (Default Router Preference): Medium
    Router lifetime (s): 1800
    Reachable time (ms): 0
    Retrans timer (ms): 0
    ICMPv6 Option (Source link-layer address : 06:c7:41:95:1d:7f)
    ICMPv6 Option (Prefix information : 2002:da8:1::/64)
    ICMPv6 Option (PREF64 Option)
        Type: PREF64 Option (38)
        Length: 2 (16 bytes)
        0000 0111 0000 1... = Scaled Lifetime: 225
        .... .... .... .001 = PLC (Prefix Length Code): 64 bits prefix length (0x1)
        Prefix: 64:ff9b::

```
2023-08-25 15:13:06 +02:00
Susant Sahani b26c345279 network: radv - Allow to send hop limit 2023-08-23 14:06:14 +09:00
Susant Sahani fdc4c67c2a
network/radv: allow to configure the time between retransmitted Neighbor Solicitation (#28888) 2023-08-23 12:37:44 +09:00
Yu Watanabe 9475e23c90 network: several follow-ups for TCP-RTO setting
- rename TCPRetransmissionTimeOutSec= -> TCPRetransmissionTimeoutSec,
- refuse infinity,
- fix the input value verifier (USEC_PER_SEC -> USEC_PER_MSEC),
- use DIV_ROUND_UP() when assigning the value.

Follow-ups for 1412d4a4fe.
Closes #28898.
2023-08-22 15:02:59 +02:00
Yu Watanabe 08801318e8 network: fix log message and man page for HopLimit=
Follow-up for 88c0642358.
Closes #28899.
2023-08-22 12:10:39 +02:00
Susant Sahani 9175002864 network: ndisc - Allow to use ICMP6 rate limit from received RA 2023-08-21 11:14:42 +02:00
Susant Sahani 88c0642358 network: static route - Allow to configure per route hop liimt 2023-08-18 14:46:37 +05:30
Susant Sahani 1412d4a4fe network: Route - allow to set TCP RTO 2023-08-17 23:47:13 +05:30
Susant Sahani f141b2c053 network: ndisc - Honour CurHopLimit
RFC4861 Neighbor Discovery – Sections 4.2 and 6.3.4

From section 4.2. Router Advertisement Message Format:

Cur Hop Limit        8-bit unsigned integer.  The default value that
                     should be placed in the Hop Count field of the IP
                     header for outgoing IP packets.  A value of zero
                     means unspecified (by this router).
2023-07-30 14:37:21 +01:00
Yu Watanabe d8f19e03c0 network,dhcp: drop support of ClientIdentifier=duid-only
The setting has not been never worked, not tested, and should not been
used. As the option is RFC incompliant. Let's drop it.

Closes #25562.
2023-07-29 18:51:09 +09:00
Susant Sahani 9c72e8f8bc networkd: allow setting rp_filter for an interface 2023-07-28 14:38:27 +05:30