summaryrefslogtreecommitdiff
path: root/interface-definitions
diff options
context:
space:
mode:
authorl0crian1 <ryan.claridge13@gmail.com>2025-08-28 15:24:45 -0400
committerl0crian1 <ryan.claridge13@gmail.com>2025-08-28 15:24:45 -0400
commit86b3b035b8559ee5dd8da8d4a57a11c041b32882 (patch)
tree2e67aca37d6e1eb6d3b60e8ad8ed06b9bc1a99ec /interface-definitions
parent133cb0c65d5aa2ca5a96feba6ab7adc3a8f1de58 (diff)
downloadvyos-1x-86b3b035b8559ee5dd8da8d4a57a11c041b32882.tar.gz
vyos-1x-86b3b035b8559ee5dd8da8d4a57a11c041b32882.zip
container: T7186: Add macvlan network type for containers
Modified: - interface-definitions/container.xml.in: - Add macvlan network type - Add gateway option - python/vyos/utils/network.py: - Add gen_mac function to generate mac address - smoketest/scripts/cli/test_container.py: - Add test for container network types - src/conf_mode/container.py: - Add support for macvlan network type - Add gateway option
Diffstat (limited to 'interface-definitions')
-rw-r--r--interface-definitions/container.xml.in74
1 files changed, 74 insertions, 0 deletions
diff --git a/interface-definitions/container.xml.in b/interface-definitions/container.xml.in
index f20fd7690..d4efc08be 100644
--- a/interface-definitions/container.xml.in
+++ b/interface-definitions/container.xml.in
@@ -566,6 +566,24 @@
<children>
#include <include/generic-description.xml.i>
#include <include/interface/mtu-68-16000.xml.i>
+ <leafNode name="gateway">
+ <properties>
+ <help>Gateway address to use for this network</help>
+ <valueHelp>
+ <format>ipv4</format>
+ <description>IPv4 gateway address</description>
+ </valueHelp>
+ <valueHelp>
+ <format>ipv6</format>
+ <description>IPv6 gateway address</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ip-address"/>
+ <validator name="ipv6-address"/>
+ </constraint>
+ <multi/>
+ </properties>
+ </leafNode>
<leafNode name="prefix">
<properties>
<help>Prefix which allocated to that network</help>
@@ -590,6 +608,62 @@
<valueless/>
</properties>
</leafNode>
+ <node name="type">
+ <properties>
+ <help>Network type (default: bridge)</help>
+ </properties>
+ <children>
+ <leafNode name="bridge">
+ <properties>
+ <help>Bridge network</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ <node name="macvlan">
+ <properties>
+ <help>MACVLAN network</help>
+ </properties>
+ <children>
+ <leafNode name="mode">
+ <properties>
+ <help>MACVLAN mode</help>
+ <completionHelp>
+ <list>bridge private vepa</list>
+ </completionHelp>
+ <valueHelp>
+ <format>bridge</format>
+ <description>Containers act as separate hosts on the parent network</description>
+ </valueHelp>
+ <valueHelp>
+ <format>private</format>
+ <description>Containers are isolated from the host and each other</description>
+ </valueHelp>
+ <valueHelp>
+ <format>vepa</format>
+ <description>Containers send all traffic through the parent switch for forwarding</description>
+ </valueHelp>
+ <constraint>
+ <regex>bridge|private|vepa</regex>
+ </constraint>
+ <constraintErrorMessage>Invalid mode</constraintErrorMessage>
+ </properties>
+ </leafNode>
+ <leafNode name="parent">
+ <properties>
+ <help>Parent network interface</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces --type ethernet --type bonding --type bridge</script>
+ </completionHelp>
+ <constraint>
+ <regex>((bond|br|eth)[0-9]+(\.[0-9]+)?)</regex>
+ </constraint>
+ <constraintErrorMessage>Invalid parent interface</constraintErrorMessage>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </node>
#include <include/interface/vrf.xml.i>
</children>
</tagNode>