diff --git a/NEWS b/NEWS
index f5d0df58b5..b1e7779b60 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,12 @@ CHANGES WITH 256 in spe:
Announcements of Future Feature Removals and Incompatible Changes:
+ * Previously, systemd-networkd did not explicitly remove any bridge VLAN
+ IDs assigned on bridge master and ports. Since v256, if a .network
+ file for an interface has at least one valid settings in [BridgeVLAN]
+ section, then all assigned VLAN IDs on the interface that are not
+ configured in the .network file are removed.
+
CHANGES WITH 255:
Announcements of Future Feature Removals and Incompatible Changes:
diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 0bad731b0d..7dc447d0a7 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -3978,9 +3978,9 @@ ServerAddress=192.168.0.1/24
-
+
-
+
[IPv6Prefix] Section Options
One or more [IPv6Prefix] sections contain the IPv6 prefixes that are announced via Router
Advertisements. See RFC 4861 for further
@@ -4055,9 +4055,9 @@ ServerAddress=192.168.0.1/24
-
+
-
+
[IPv6RoutePrefix] Section Options
One or more [IPv6RoutePrefix] sections contain the IPv6
prefix routes that are announced via Router Advertisements. See
@@ -4087,9 +4087,9 @@ ServerAddress=192.168.0.1/24
-
+
-
+
[IPv6PREF64Prefix] Section Options
One or more [IPv6PREF64Prefix] sections contain the IPv6 PREF64 (or NAT64) prefixes that are announced via Router
Advertisements. See RFC 8781 for further
@@ -4116,480 +4116,486 @@ ServerAddress=192.168.0.1/24
-
-
-
- [Bridge] Section Options
- The [Bridge] section accepts the following keys:
-
-
- UnicastFlood=
-
- Takes a boolean. Controls whether the bridge should flood
- traffic for which an FDB entry is missing and the destination
- is unknown through this port. When unset, the kernel's default will be used.
-
-
-
-
-
-
- MulticastFlood=
-
- Takes a boolean. Controls whether the bridge should flood
- traffic for which an MDB entry is missing and the destination
- is unknown through this port. When unset, the kernel's default will be used.
-
-
-
-
-
-
- MulticastToUnicast=
-
- Takes a boolean. Multicast to unicast works on top of the multicast snooping feature of
- the bridge. Which means unicast copies are only delivered to hosts which are interested in it.
- When unset, the kernel's default will be used.
-
-
-
-
-
-
- NeighborSuppression=
-
- Takes a boolean. Configures whether ARP and ND neighbor suppression is enabled for
- this port. When unset, the kernel's default will be used.
-
-
-
-
-
-
- Learning=
-
- Takes a boolean. Configures whether MAC address learning is enabled for
- this port. When unset, the kernel's default will be used.
-
-
-
-
-
-
- HairPin=
-
- Takes a boolean. Configures whether traffic may be sent back out of the port on which it
- was received. When this flag is false, then the bridge will not forward traffic back out of the
- receiving port. When unset, the kernel's default will be used.
-
-
-
-
-
- Isolated=
-
- Takes a boolean. Configures whether this port is isolated or not. Within a bridge,
- isolated ports can only communicate with non-isolated ports. When set to true, this port can only
- communicate with other ports whose Isolated setting is false. When set to false, this port
- can communicate with any other ports. When unset, the kernel's default will be used.
-
-
-
-
-
- UseBPDU=
-
- Takes a boolean. Configures whether STP Bridge Protocol Data Units will be
- processed by the bridge port. When unset, the kernel's default will be used.
-
-
-
-
-
- FastLeave=
-
- Takes a boolean. This flag allows the bridge to immediately stop multicast
- traffic on a port that receives an IGMP Leave message. It is only used with
- IGMP snooping if enabled on the bridge. When unset, the kernel's default will be used.
-
-
-
-
-
- AllowPortToBeRoot=
-
- Takes a boolean. Configures whether a given port is allowed to
- become a root port. Only used when STP is enabled on the bridge.
- When unset, the kernel's default will be used.
-
-
-
-
-
- ProxyARP=
-
- Takes a boolean. Configures whether proxy ARP to be enabled on this port.
- When unset, the kernel's default will be used.
-
-
-
-
-
- ProxyARPWiFi=
-
- Takes a boolean. Configures whether proxy ARP to be enabled on this port
- which meets extended requirements by IEEE 802.11 and Hotspot 2.0 specifications.
- When unset, the kernel's default will be used.
-
-
-
-
-
- MulticastRouter=
-
- Configures this port for having multicast routers attached. A port with a multicast
- router will receive all multicast traffic. Takes one of no
- to disable multicast routers on this port, query to let the system detect
- the presence of routers, permanent to permanently enable multicast traffic
- forwarding on this port, or temporary to enable multicast routers temporarily
- on this port, not depending on incoming queries. When unset, the kernel's default will be used.
-
-
-
-
-
- Cost=
-
- Sets the "cost" of sending packets of this interface.
- Each port in a bridge may have a different speed and the cost
- is used to decide which link to use. Faster interfaces
- should have lower costs. It is an integer value between 1 and
- 65535.
-
-
-
-
-
- Priority=
-
- Sets the "priority" of sending packets on this interface.
- Each port in a bridge may have a different priority which is used
- to decide which link to use. Lower value means higher priority.
- It is an integer value between 0 to 63. Networkd does not set any
- default, meaning the kernel default value of 32 is used.
-
-
-
-
-
+
+
+ [Bridge] Section Options
+ The [Bridge] section accepts the following keys:
+
+
+
+ UnicastFlood=
+
+ Takes a boolean. Controls whether the bridge should flood
+ traffic for which an FDB entry is missing and the destination
+ is unknown through this port. When unset, the kernel's default will be used.
+
+
+
+
+
+
+ MulticastFlood=
+
+ Takes a boolean. Controls whether the bridge should flood
+ traffic for which an MDB entry is missing and the destination
+ is unknown through this port. When unset, the kernel's default will be used.
+
+
+
+
+
+
+ MulticastToUnicast=
+
+ Takes a boolean. Multicast to unicast works on top of the multicast snooping feature of
+ the bridge. Which means unicast copies are only delivered to hosts which are interested in it.
+ When unset, the kernel's default will be used.
+
+
+
+
+
+
+ NeighborSuppression=
+
+ Takes a boolean. Configures whether ARP and ND neighbor suppression is enabled for
+ this port. When unset, the kernel's default will be used.
+
+
+
+
+
+
+ Learning=
+
+ Takes a boolean. Configures whether MAC address learning is enabled for
+ this port. When unset, the kernel's default will be used.
+
+
+
+
+
+
+ HairPin=
+
+ Takes a boolean. Configures whether traffic may be sent back out of the port on which it
+ was received. When this flag is false, then the bridge will not forward traffic back out of the
+ receiving port. When unset, the kernel's default will be used.
+
+
+
+
+
+ Isolated=
+
+ Takes a boolean. Configures whether this port is isolated or not. Within a bridge,
+ isolated ports can only communicate with non-isolated ports. When set to true, this port can only
+ communicate with other ports whose Isolated setting is false. When set to false, this port
+ can communicate with any other ports. When unset, the kernel's default will be used.
+
+
+
+
+
+ UseBPDU=
+
+ Takes a boolean. Configures whether STP Bridge Protocol Data Units will be
+ processed by the bridge port. When unset, the kernel's default will be used.
+
+
+
+
+
+ FastLeave=
+
+ Takes a boolean. This flag allows the bridge to immediately stop multicast
+ traffic on a port that receives an IGMP Leave message. It is only used with
+ IGMP snooping if enabled on the bridge. When unset, the kernel's default will be used.
+
+
+
+
+
+ AllowPortToBeRoot=
+
+ Takes a boolean. Configures whether a given port is allowed to
+ become a root port. Only used when STP is enabled on the bridge.
+ When unset, the kernel's default will be used.
+
+
+
+
+
+ ProxyARP=
+
+ Takes a boolean. Configures whether proxy ARP to be enabled on this port.
+ When unset, the kernel's default will be used.
+
+
+
+
+
+ ProxyARPWiFi=
+
+ Takes a boolean. Configures whether proxy ARP to be enabled on this port
+ which meets extended requirements by IEEE 802.11 and Hotspot 2.0 specifications.
+ When unset, the kernel's default will be used.
+
+
+
+
+
+ MulticastRouter=
+
+ Configures this port for having multicast routers attached. A port with a multicast
+ router will receive all multicast traffic. Takes one of no
+ to disable multicast routers on this port, query to let the system detect
+ the presence of routers, permanent to permanently enable multicast traffic
+ forwarding on this port, or temporary to enable multicast routers temporarily
+ on this port, not depending on incoming queries. When unset, the kernel's default will be used.
+
+
+
+
+
+ Cost=
+
+ Sets the "cost" of sending packets of this interface.
+ Each port in a bridge may have a different speed and the cost
+ is used to decide which link to use. Faster interfaces
+ should have lower costs. It is an integer value between 1 and
+ 65535.
+
+
+
+
+
+ Priority=
+
+ Sets the "priority" of sending packets on this interface.
+ Each port in a bridge may have a different priority which is used
+ to decide which link to use. Lower value means higher priority.
+ It is an integer value between 0 to 63. Networkd does not set any
+ default, meaning the kernel default value of 32 is used.
+
+
+
+
+
+
+
[BridgeFDB] Section Options
- The [BridgeFDB] section manages the forwarding database table of a port and accepts the following
- keys. Specify several [BridgeFDB] sections to configure several static MAC table entries.
-
-
- MACAddress=
-
- As in the [Network] section. This key is mandatory.
+ The [BridgeFDB] section manages the forwarding database table of a port and accepts the following
+ keys. Specify several [BridgeFDB] sections to configure several static MAC table entries.
+
+
+
+ MACAddress=
+
+ As in the [Network] section. This key is mandatory.
-
-
-
- Destination=
-
- Takes an IP address of the destination VXLAN tunnel endpoint.
+
+
+
+ Destination=
+
+ Takes an IP address of the destination VXLAN tunnel endpoint.
-
-
-
- VLANId=
-
- The VLAN ID for the new static MAC table entry. If
- omitted, no VLAN ID information is appended to the new static MAC
- table entry.
+
+
+
+ VLANId=
+
+ The VLAN ID for the new static MAC table entry. If
+ omitted, no VLAN ID information is appended to the new static MAC
+ table entry.
-
-
-
-
- VNI=
-
- The VXLAN Network Identifier (or VXLAN Segment ID) to use to connect to
- the remote VXLAN tunnel endpoint. Takes a number in the range 1…16777215.
- Defaults to unset.
-
-
-
-
-
- AssociatedWith=
-
- Specifies where the address is associated with. Takes one of use,
- self, master or router.
- use means the address is in use. User space can use this option to
- indicate to the kernel that the fdb entry is in use. self means
- the address is associated with the port drivers fdb. Usually hardware. master
- means the address is associated with master devices fdb. router means
- the destination address is associated with a router. Note that it's valid if the referenced
- device is a VXLAN type device and has route shortcircuit enabled. Defaults to self.
+
+
+
+
+ VNI=
+
+ The VXLAN Network Identifier (or VXLAN Segment ID) to use to connect to
+ the remote VXLAN tunnel endpoint. Takes a number in the range 1…16777215.
+ Defaults to unset.
-
-
-
- OutgoingInterface=
-
- Specifies the name or index of the outgoing interface for the VXLAN device driver to
- reach the remote VXLAN tunnel endpoint. Defaults to unset.
+
+
+
+ AssociatedWith=
+
+ Specifies where the address is associated with. Takes one of use,
+ self, master or router.
+ use means the address is in use. User space can use this option to
+ indicate to the kernel that the fdb entry is in use. self means
+ the address is associated with the port drivers fdb. Usually hardware. master
+ means the address is associated with master devices fdb. router means
+ the destination address is associated with a router. Note that it's valid if the referenced
+ device is a VXLAN type device and has route shortcircuit enabled. Defaults to self.
-
-
-
-
+
+
+
+
+ OutgoingInterface=
+
+ Specifies the name or index of the outgoing interface for the VXLAN device driver to
+ reach the remote VXLAN tunnel endpoint. Defaults to unset.
+
+
+
+
+
+
[BridgeMDB] Section Options
- The [BridgeMDB] section manages the multicast membership entries forwarding database table of a port and accepts the following
- keys. Specify several [BridgeMDB] sections to configure several permanent multicast membership entries.
+ The [BridgeMDB] section manages the multicast membership entries forwarding database table of a port and accepts the following
+ keys. Specify several [BridgeMDB] sections to configure several permanent multicast membership entries.
-
-
- MulticastGroupAddress=
-
- Specifies the IPv4 or IPv6 multicast group address to add. This setting is mandatory.
+
+
+ MulticastGroupAddress=
+
+ Specifies the IPv4 or IPv6 multicast group address to add. This setting is mandatory.
-
-
-
- VLANId=
-
- The VLAN ID for the new entry. Valid ranges are 0 (no VLAN) to 4094. Optional, defaults to 0.
+
+
+
+ VLANId=
+
+ The VLAN ID for the new entry. Valid ranges are 0 (no VLAN) to 4094. Optional, defaults to 0.
-
-
-
+
+
+
[LLDP] Section Options
- The [LLDP] section manages the Link Layer Discovery Protocol (LLDP) and accepts the following
- keys:
-
-
- MUDURL=
-
- When configured, the specified Manufacturer Usage Descriptions (MUD) URL will be sent in
- LLDP packets. The syntax and semantics are the same as for MUDURL= in the
- [DHCPv4] section described above.
+ The [LLDP] section manages the Link Layer Discovery Protocol (LLDP) and accepts the following
+ keys:
- The MUD URLs received via LLDP packets are saved and can be read using the
- sd_lldp_neighbor_get_mud_url() function.
+
+
+ MUDURL=
+
+ When configured, the specified Manufacturer Usage Descriptions (MUD) URL will be sent in
+ LLDP packets. The syntax and semantics are the same as for MUDURL= in the
+ [DHCPv4] section described above.
-
-
-
-
+ The MUD URLs received via LLDP packets are saved and can be read using the
+ sd_lldp_neighbor_get_mud_url() function.
+
+
+
+
+
[CAN] Section Options
- The [CAN] section manages the Controller Area Network (CAN bus) and accepts the
- following keys:
-
-
- BitRate=
-
- The bitrate of CAN device in bits per second. The usual SI prefixes (K, M) with the base of 1000 can
- be used here. Takes a number in the range 1…4294967295.
-
-
-
-
-
- SamplePoint=
-
- Optional sample point in percent with one decimal (e.g. 75%,
- 87.5%) or permille (e.g. 875‰). This will be ignored when
- BitRate= is unspecified.
+ The [CAN] section manages the Controller Area Network (CAN bus) and accepts the
+ following keys:
+
+
+ BitRate=
+
+ The bitrate of CAN device in bits per second. The usual SI prefixes (K, M) with the base of 1000 can
+ be used here. Takes a number in the range 1…4294967295.
-
-
-
- TimeQuantaNSec=
- PropagationSegment=
- PhaseBufferSegment1=
- PhaseBufferSegment2=
- SyncJumpWidth=
-
- Specifies the time quanta, propagation segment, phase buffer segment 1 and 2, and the
- synchronization jump width, which allow one to define the CAN bit-timing in a hardware
- independent format as proposed by the Bosch CAN 2.0 Specification.
- TimeQuantaNSec= takes a timespan in nanoseconds.
- PropagationSegment=, PhaseBufferSegment1=,
- PhaseBufferSegment2=, and SyncJumpWidth= take number
- of time quantum specified in TimeQuantaNSec= and must be an unsigned
- integer in the range 0…4294967295. These settings except for
- SyncJumpWidth= will be ignored when BitRate= is
- specified.
+
+
+
+ SamplePoint=
+
+ Optional sample point in percent with one decimal (e.g. 75%,
+ 87.5%) or permille (e.g. 875‰). This will be ignored when
+ BitRate= is unspecified.
-
-
-
-
- DataBitRate=
- DataSamplePoint=
-
- The bitrate and sample point for the data phase, if CAN-FD is used. These settings are
- analogous to the BitRate= and SamplePoint= keys.
+
+
+
+
+ TimeQuantaNSec=
+ PropagationSegment=
+ PhaseBufferSegment1=
+ PhaseBufferSegment2=
+ SyncJumpWidth=
+
+ Specifies the time quanta, propagation segment, phase buffer segment 1 and 2, and the
+ synchronization jump width, which allow one to define the CAN bit-timing in a hardware
+ independent format as proposed by the Bosch CAN 2.0 Specification.
+ TimeQuantaNSec= takes a timespan in nanoseconds.
+ PropagationSegment=, PhaseBufferSegment1=,
+ PhaseBufferSegment2=, and SyncJumpWidth= take number
+ of time quantum specified in TimeQuantaNSec= and must be an unsigned
+ integer in the range 0…4294967295. These settings except for
+ SyncJumpWidth= will be ignored when BitRate= is
+ specified.
-
-
-
-
- DataTimeQuantaNSec=
- DataPropagationSegment=
- DataPhaseBufferSegment1=
- DataPhaseBufferSegment2=
- DataSyncJumpWidth=
-
- Specifies the time quanta, propagation segment, phase buffer segment 1 and 2, and the
- synchronization jump width for the data phase, if CAN-FD is used. These settings are
- analogous to the TimeQuantaNSec= or related settings.
-
-
-
-
-
- FDMode=
-
- Takes a boolean. When yes, CAN-FD mode is enabled for the interface.
- Note, that a bitrate and optional sample point should also be set for the CAN-FD data phase using
- the DataBitRate= and DataSamplePoint= keys, or
- DataTimeQuanta= and related settings.
+
+
+
+
+ DataBitRate=
+ DataSamplePoint=
+
+ The bitrate and sample point for the data phase, if CAN-FD is used. These settings are
+ analogous to the BitRate= and SamplePoint= keys.
-
-
-
- FDNonISO=
-
- Takes a boolean. When yes, non-ISO CAN-FD mode is enabled for the
- interface. When unset, the kernel's default will be used.
+
+
+
+ DataTimeQuantaNSec=
+ DataPropagationSegment=
+ DataPhaseBufferSegment1=
+ DataPhaseBufferSegment2=
+ DataSyncJumpWidth=
+
+ Specifies the time quanta, propagation segment, phase buffer segment 1 and 2, and the
+ synchronization jump width for the data phase, if CAN-FD is used. These settings are
+ analogous to the TimeQuantaNSec= or related settings.
+
+
+
+
+
+ FDMode=
+
+ Takes a boolean. When yes, CAN-FD mode is enabled for the interface.
+ Note, that a bitrate and optional sample point should also be set for the CAN-FD data phase using
+ the DataBitRate= and DataSamplePoint= keys, or
+ DataTimeQuanta= and related settings.
-
-
-
- RestartSec=
-
- Automatic restart delay time. If set to a non-zero value, a restart of the CAN controller will be
- triggered automatically in case of a bus-off condition after the specified delay time. Subsecond delays can
- be specified using decimals (e.g. 0.1s) or a ms or
- us postfix. Using infinity or 0 will turn the
- automatic restart off. By default automatic restart is disabled.
+
+
+
+ FDNonISO=
+
+ Takes a boolean. When yes, non-ISO CAN-FD mode is enabled for the
+ interface. When unset, the kernel's default will be used.
-
-
-
-
- Termination=
-
- Takes a boolean or a termination resistor value in ohm in the range 0…65535. When
- yes, the termination resistor is set to 120 ohm. When
- no or 0 is set, the termination resistor is disabled.
- When unset, the kernel's default will be used.
+
+
+
+
+ RestartSec=
+
+ Automatic restart delay time. If set to a non-zero value, a restart of the CAN controller will be
+ triggered automatically in case of a bus-off condition after the specified delay time. Subsecond delays can
+ be specified using decimals (e.g. 0.1s) or a ms or
+ us postfix. Using infinity or 0 will turn the
+ automatic restart off. By default automatic restart is disabled.
-
-
-
-
- TripleSampling=
-
- Takes a boolean. When yes, three samples (instead of one) are used to determine
- the value of a received bit by majority rule. When unset, the kernel's default will be used.
+
+
+
+
+ Termination=
+
+ Takes a boolean or a termination resistor value in ohm in the range 0…65535. When
+ yes, the termination resistor is set to 120 ohm. When
+ no or 0 is set, the termination resistor is disabled.
+ When unset, the kernel's default will be used.
+
+
+
+
+
+ TripleSampling=
+
+ Takes a boolean. When yes, three samples (instead of one) are used to determine
+ the value of a received bit by majority rule. When unset, the kernel's default will be used.
-
-
-
- BusErrorReporting=
-
- Takes a boolean. When yes, reporting of CAN bus errors is activated
- (those include single bit, frame format, and bit stuffing errors, unable to send dominant bit,
- unable to send recessive bit, bus overload, active error announcement, error occurred on
- transmission). When unset, the kernel's default will be used. Note: in case of a CAN bus with a
- single CAN device, sending a CAN frame may result in a huge number of CAN bus errors.
+
+
+
+ BusErrorReporting=
+
+ Takes a boolean. When yes, reporting of CAN bus errors is activated
+ (those include single bit, frame format, and bit stuffing errors, unable to send dominant bit,
+ unable to send recessive bit, bus overload, active error announcement, error occurred on
+ transmission). When unset, the kernel's default will be used. Note: in case of a CAN bus with a
+ single CAN device, sending a CAN frame may result in a huge number of CAN bus errors.
-
-
-
- ListenOnly=
-
- Takes a boolean. When yes, listen-only mode is enabled. When the
- interface is in listen-only mode, the interface neither transmit CAN frames nor send ACK
- bit. Listen-only mode is important to debug CAN networks without interfering with the
- communication or acknowledge the CAN frame. When unset, the kernel's default will be used.
-
+
+
+
+ ListenOnly=
+
+ Takes a boolean. When yes, listen-only mode is enabled. When the
+ interface is in listen-only mode, the interface neither transmit CAN frames nor send ACK
+ bit. Listen-only mode is important to debug CAN networks without interfering with the
+ communication or acknowledge the CAN frame. When unset, the kernel's default will be used.
+
-
-
-
- Loopback=
-
- Takes a boolean. When yes, loopback mode is enabled. When the
- loopback mode is enabled, the interface treats messages transmitted by itself as received
- messages. The loopback mode is important to debug CAN networks. When unset, the kernel's
- default will be used.
+
+
+
+ Loopback=
+
+ Takes a boolean. When yes, loopback mode is enabled. When the
+ loopback mode is enabled, the interface treats messages transmitted by itself as received
+ messages. The loopback mode is important to debug CAN networks. When unset, the kernel's
+ default will be used.
-
-
-
- OneShot=
-
- Takes a boolean. When yes, one-shot mode is enabled. When unset,
- the kernel's default will be used.
+
+
+
+ OneShot=
+
+ Takes a boolean. When yes, one-shot mode is enabled. When unset,
+ the kernel's default will be used.
-
-
-
- PresumeAck=
-
- Takes a boolean. When yes, the interface will ignore missing CAN
- ACKs. When unset, the kernel's default will be used.
+
+
+
+ PresumeAck=
+
+ Takes a boolean. When yes, the interface will ignore missing CAN
+ ACKs. When unset, the kernel's default will be used.
-
-
-
- ClassicDataLengthCode=
-
- Takes a boolean. When yes, the interface will handle the 4bit data
- length code (DLC). When unset, the kernel's default will be used.
+
+
+
+ ClassicDataLengthCode=
+
+ Takes a boolean. When yes, the interface will handle the 4bit data
+ length code (DLC). When unset, the kernel's default will be used.
-
-
-
+
+
+
[IPoIB] Section Options
- The [IPoIB] section manages the IP over Infiniband and accepts the following keys:
-
-
-
-
+ The [IPoIB] section manages the IP over Infiniband and accepts the following keys:
+
+
+
+
+
@@ -4603,7 +4609,7 @@ ServerAddress=192.168.0.1/24
Specifies the parent Queueing Discipline (qdisc). Takes one of clsact
or ingress. This is mandatory.
-
+
@@ -5859,47 +5865,54 @@ ServerAddress=192.168.0.1/24
[BridgeVLAN] Section Options
- The [BridgeVLAN] section manages the VLAN ID configuration of a bridge port and accepts the
- following keys. Specify several [BridgeVLAN] sections to configure several VLAN entries. The
- VLANFiltering= option has to be enabled, see the [Bridge] section in
- systemd.netdev5.
+
+ The [BridgeVLAN] section manages the VLAN ID configurations of a bridge master or port, and accepts the
+ following keys. To make the settings in this section take an effect,
+ VLANFiltering= option has to be enabled on the bridge master, see the [Bridge]
+ section in
+ systemd.netdev5.
+ If at least one valid settings specified in this section in a .network file for an interface, all
+ assigned VLAN IDs on the interface that are not configured in the .network file will be removed. If
+ VLAN IDs on an interface need to be managed by other tools, then the settings in this section cannot
+ be used in the matching .network file.
+
-
-
- VLAN=
-
- The VLAN ID allowed on the port. This can be either a single ID or a range M-N. Takes an
- integer in the range 1…4094. This setting can be specified multiple times. If an empty string is
- assigned, then the all previous assignments are cleared.
+
+
+ VLAN=
+
+ The VLAN ID allowed on the port. This can be either a single ID or a range M-N. Takes an
+ integer in the range 1…4094. This setting can be specified multiple times. If an empty string is
+ assigned, then the all previous assignments are cleared.
-
-
-
-
- EgressUntagged=
-
- The VLAN ID specified here will be used to untag frames on egress. Configuring
- EgressUntagged= implicates the use of VLAN= above and will
- enable the VLAN ID for ingress as well. This can be either a single ID or a range M-N. This
- setting can be specified multiple times. If an empty string is assigned, then the all previous
- assignments are cleared.
+
+
+
+
+ EgressUntagged=
+
+ The VLAN ID specified here will be used to untag frames on egress. Configuring
+ EgressUntagged= implicates the use of VLAN= above and will
+ enable the VLAN ID for ingress as well. This can be either a single ID or a range M-N. This
+ setting can be specified multiple times. If an empty string is assigned, then the all previous
+ assignments are cleared.
-
-
-
-
- PVID=
-
- The port VLAN ID specified here is assigned to all untagged frames at ingress. Takes an
- VLAN ID or negative boolean value (e.g. no). When false, the currently
- assigned port VLAN ID will be dropped. Configuring PVID= implicates the use of
- VLAN= setting in the above and will enable the VLAN ID for ingress as well.
- Defaults to unset, and will keep the assigned port VLAN ID if exists.
+
+
+
+
+ PVID=
+
+ The port VLAN ID specified here is assigned to all untagged frames at ingress. Takes an
+ VLAN ID or negative boolean value (e.g. no). When false, the currently
+ assigned port VLAN ID will be dropped. Configuring PVID= implicates the use of
+ VLAN= setting in the above and will enable the VLAN ID for ingress as well.
+ Defaults to unset, and will keep the assigned port VLAN ID if exists.
-
-
-
-
+
+
+
+
diff --git a/src/network/networkd-bridge-vlan.c b/src/network/networkd-bridge-vlan.c
index d84b6b34f6..3c05267521 100644
--- a/src/network/networkd-bridge-vlan.c
+++ b/src/network/networkd-bridge-vlan.c
@@ -27,9 +27,18 @@ static void set_bit(unsigned nr, uint32_t *addr) {
addr[nr / 32] |= (UINT32_C(1) << (nr % 32));
}
-static int add_single(sd_netlink_message *m, uint16_t id, bool untagged, bool is_pvid) {
+static int add_single(sd_netlink_message *m, uint16_t id, bool untagged, bool is_pvid, char **str) {
assert(m);
assert(id < BRIDGE_VLAN_BITMAP_MAX);
+
+ if (DEBUG_LOGGING)
+ (void) strextendf_with_separator(str, ",", "%u%s%s%s%s%s", id,
+ (untagged || is_pvid) ? "(" : "",
+ untagged ? "untagged" : "",
+ (untagged && is_pvid) ? "," : "",
+ is_pvid ? "pvid" : "",
+ (untagged || is_pvid) ? ")" : "");
+
return sd_netlink_message_append_data(m, IFLA_BRIDGE_VLAN_INFO,
&(struct bridge_vlan_info) {
.vid = id,
@@ -39,7 +48,7 @@ static int add_single(sd_netlink_message *m, uint16_t id, bool untagged, bool is
sizeof(struct bridge_vlan_info));
}
-static int add_range(sd_netlink_message *m, uint16_t begin, uint16_t end, bool untagged) {
+static int add_range(sd_netlink_message *m, uint16_t begin, uint16_t end, bool untagged, char **str) {
int r;
assert(m);
@@ -47,7 +56,10 @@ static int add_range(sd_netlink_message *m, uint16_t begin, uint16_t end, bool u
assert(end < BRIDGE_VLAN_BITMAP_MAX);
if (begin == end)
- return add_single(m, begin, untagged, /* is_pvid = */ false);
+ return add_single(m, begin, untagged, /* is_pvid = */ false, str);
+
+ if (DEBUG_LOGGING)
+ (void) strextendf_with_separator(str, ",", "%u-%u%s", begin, end, untagged ? "(untagged)" : "");
r = sd_netlink_message_append_data(m, IFLA_BRIDGE_VLAN_INFO,
&(struct bridge_vlan_info) {
@@ -95,6 +107,7 @@ static uint16_t link_get_pvid(Link *link, bool *ret_untagged) {
}
static int bridge_vlan_append_set_info(Link *link, sd_netlink_message *m) {
+ _cleanup_free_ char *str = NULL;
uint16_t pvid, begin = UINT16_MAX;
bool untagged, pvid_is_untagged;
int r;
@@ -112,14 +125,14 @@ static int bridge_vlan_append_set_info(Link *link, sd_netlink_message *m) {
if (begin != UINT16_MAX) {
assert(begin < k);
- r = add_range(m, begin, k - 1, untagged);
+ r = add_range(m, begin, k - 1, untagged, &str);
if (r < 0)
return r;
begin = UINT16_MAX;
}
- r = add_single(m, pvid, pvid_is_untagged, /* is_pvid = */ true);
+ r = add_single(m, pvid, pvid_is_untagged, /* is_pvid = */ true, &str);
if (r < 0)
return r;
@@ -131,7 +144,7 @@ static int bridge_vlan_append_set_info(Link *link, sd_netlink_message *m) {
if (begin != UINT16_MAX) {
assert(begin < k);
- r = add_range(m, begin, k - 1, untagged);
+ r = add_range(m, begin, k - 1, untagged, &str);
if (r < 0)
return r;
@@ -151,7 +164,7 @@ static int bridge_vlan_append_set_info(Link *link, sd_netlink_message *m) {
continue;
/* Tagging flag is changed from the previous bits. Finish them. */
- r = add_range(m, begin, k - 1, untagged);
+ r = add_range(m, begin, k - 1, untagged, &str);
if (r < 0)
return r;
@@ -170,10 +183,13 @@ static int bridge_vlan_append_set_info(Link *link, sd_netlink_message *m) {
* the above loop, we run 0…4095. */
assert_cc(BRIDGE_VLAN_BITMAP_MAX > VLANID_MAX);
assert(begin == UINT16_MAX);
+
+ log_link_debug(link, "Setting Bridge VLAN IDs: %s", strna(str));
return 0;
}
static int bridge_vlan_append_del_info(Link *link, sd_netlink_message *m) {
+ _cleanup_free_ char *str = NULL;
uint16_t pvid, begin = UINT16_MAX;
int r;
@@ -192,7 +208,7 @@ static int bridge_vlan_append_del_info(Link *link, sd_netlink_message *m) {
if (begin != UINT16_MAX) {
assert(begin < k);
- r = add_range(m, begin, k - 1, /* untagged = */ false);
+ r = add_range(m, begin, k - 1, /* untagged = */ false, &str);
if (r < 0)
return r;
@@ -211,6 +227,8 @@ static int bridge_vlan_append_del_info(Link *link, sd_netlink_message *m) {
/* No pending bit sequence. */
assert(begin == UINT16_MAX);
+
+ log_link_debug(link, "Removing Bridge VLAN IDs: %s", strna(str));
return 0;
}