From 963364d4e93ba2a0001227546f7a495d57d8bd5a Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 27 Nov 2024 10:09:57 +0100 Subject: [PATCH] confd: allow setting IP address directly on dot1Q bridges This patch drops a needless restriction of IP addresses on VLAN filtering bridges from 2024-03-06. The obvious use-case is when the bridge is an untagged member of a VLAN and only ony management VLAN is required. Signed-off-by: Joachim Wiberg --- doc/networking.md | 15 +++++++++---- src/confd/yang/confd.inc | 2 +- src/confd/yang/containers.inc | 2 +- src/confd/yang/infix-if-bridge.yang | 22 +++++-------------- src/confd/yang/infix-interfaces.yang | 4 ++++ ....yang => infix-interfaces@2024-11-27.yang} | 0 6 files changed, 23 insertions(+), 22 deletions(-) rename src/confd/yang/{infix-interfaces@2024-11-15.yang => infix-interfaces@2024-11-27.yang} (100%) diff --git a/doc/networking.md b/doc/networking.md index 146048f9..479b3251 100644 --- a/doc/networking.md +++ b/doc/networking.md @@ -219,10 +219,15 @@ admin@example:/config/interface/br0/> set bridge vlans vlan 10 tagged br0 admin@example:/config/interface/br0/> set bridge vlans vlan 20 tagged br0 ``` +To route or to manage via a VLAN, a VLAN interface needs to be created +on top of the bridge, see section [VLAN Interfaces](#vlan-interfaces) +below for more on this topic. + > [!NOTE] -> To route or to manage via a VLAN, a VLAN interface needs to be created -> on top of the bridge, see section [VLAN Interfaces](#vlan-interfaces) -> below for more on this topic. +> In some use-cases only a single management VLAN on the bridge is used. +> For the example above, if the bridge itself is an untagged member only +> in VLAN 10, IP addresses can be set directly on the bridge without the +> need for dedicated VLAN interfaces on top of the bridge. #### Multicast Filtering and Snooping @@ -465,7 +470,9 @@ As conventions, a VLAN interface for VID 20 on top of an Ethernet interface *eth0* is named *eth0.20*, and a VLAN interface for VID 10 on top of a bridge interface *br0* is named *vlan10*. -> **Note:** If you name your VLAN interface `foo0.N` or `vlanN`, where `N` is a number, Infix will set the interface type automatically for you. +> [!NOTE] +> If you name your VLAN interface `foo0.N` or `vlanN`, where `N` is a +> number, Infix will set the interface type automatically for you. ### Physical Ethernet Interfaces diff --git a/src/confd/yang/confd.inc b/src/confd/yang/confd.inc index 84ee4ae8..80e64b41 100644 --- a/src/confd/yang/confd.inc +++ b/src/confd/yang/confd.inc @@ -37,7 +37,7 @@ MODULES=( "ieee802-ethernet-interface@2019-06-21.yang" "infix-ethernet-interface@2024-02-27.yang" "infix-factory-default@2023-06-28.yang" - "infix-interfaces@2024-11-15.yang -e vlan-filtering" + "infix-interfaces@2024-11-27.yang -e vlan-filtering" # from rousette "ietf-restconf@2017-01-26.yang" diff --git a/src/confd/yang/containers.inc b/src/confd/yang/containers.inc index 0a5d891d..6ef7e607 100644 --- a/src/confd/yang/containers.inc +++ b/src/confd/yang/containers.inc @@ -1,6 +1,6 @@ # -*- sh -*- # REMEMBER TO UPDATE infix-interfaces ALSO IN confd.inc MODULES=( - "infix-interfaces@2024-11-15.yang -e vlan-filtering -e containers" + "infix-interfaces@2024-11-27.yang -e vlan-filtering -e containers" "infix-containers@2024-11-15.yang" ) diff --git a/src/confd/yang/infix-if-bridge.yang b/src/confd/yang/infix-if-bridge.yang index c85d4195..7a02f36c 100644 --- a/src/confd/yang/infix-if-bridge.yang +++ b/src/confd/yang/infix-if-bridge.yang @@ -26,6 +26,12 @@ submodule infix-if-bridge { contact "kernelkit@googlegroups.com"; description "Linux bridge extension for ietf-interfaces."; + revision 2024-11-27 { + description "Drop must() expressions for IP addres on VLAN bridges. + If a bridge is untagged member of a VLAN it should be + possible to set an IP address on the bridge."; + reference "internal"; + } revision 2024-11-15 { description "Fix pyang linter warnings, drop unused imports."; reference "internal"; @@ -424,22 +430,6 @@ submodule infix-if-bridge { } } - deviation "/if:interfaces/if:interface/ip:ipv4/ip:enabled" { - deviate add { - must "not(.) or count(../../infix-if:bridge/infix-if:vlans/infix-if:vlan) = 0" { - error-message "IPv4 address is not supported on VLAN filtering bridges."; - } - } - } - - deviation "/if:interfaces/if:interface/ip:ipv6/ip:enabled" { - deviate add { - must "not(.) or count(../../infix-if:bridge/infix-if:vlans/infix-if:vlan) = 0" { - error-message "IPv6 address is not supported on VLAN filtering bridges."; - } - } - } - augment "/if:interfaces/if:interface/infix-if:port" { when "derived-from-or-self(if:type,'ianaift:bridge') or "+ "derived-from-or-self(if:type,'ianaift:ethernetCsmacd') or "+ diff --git a/src/confd/yang/infix-interfaces.yang b/src/confd/yang/infix-interfaces.yang index dccaf7d7..a97c2b20 100644 --- a/src/confd/yang/infix-interfaces.yang +++ b/src/confd/yang/infix-interfaces.yang @@ -23,6 +23,10 @@ module infix-interfaces { contact "kernelkit@googlegroups.com"; description "Linux bridge and lag extensions for ietf-interfaces."; + revision 2024-11-27 { + description "Allow IP addresses directly on VLAN filtering bridges."; + reference "internal"; + } revision 2024-11-15 { description "Two changes: - Limit name 1-15 chars, Linux limitation diff --git a/src/confd/yang/infix-interfaces@2024-11-15.yang b/src/confd/yang/infix-interfaces@2024-11-27.yang similarity index 100% rename from src/confd/yang/infix-interfaces@2024-11-15.yang rename to src/confd/yang/infix-interfaces@2024-11-27.yang