From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC PATCH ifupdown2 6/7] d/patches: add patch for adding IPv6 vxlan-local-tunnelip
Date: Wed, 23 Apr 2025 12:45:35 +0200 [thread overview]
Message-ID: <20250423104556.644234-7-c.heiss@proxmox.com> (raw)
In-Reply-To: <20250423104556.644234-1-c.heiss@proxmox.com>
This patch makes it possible to use an IPv6 address for the local VXLAN
tunnel address.
Upstream-Link: https://github.com/CumulusNetworks/ifupdown2/pull/315
Suggested-by: Stefan Hanreich <s.hanreich@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
Stefan suggested the inclusion of this patch, as it's been a fairly
requested features.
Split it off completely from the other changes and marked it as RFC tho,
as upstream still doesn't seem to have decided if the attribute should
be renamed to `vxlan-local-tunnelip6`. Pulling it in now would mean that
we're "stuck" with that name, if we don't want to break users later on,
if the attribute is really renamed.
(Or we could support both styles in that case.)
debian/patches/series | 1 +
...upport-for-IPv6-vxlan-local-tunnelip.patch | 127 ++++++++++++++++++
2 files changed, 128 insertions(+)
create mode 100644 debian/patches/upstream/0002-vxlan-Add-support-for-IPv6-vxlan-local-tunnelip.patch
diff --git a/debian/patches/series b/debian/patches/series
index eab43d8..c74322a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
upstream/0001-add-IPv6-SLAAC-support-inet6-auto-and-router-adverti.patch
+upstream/0002-vxlan-Add-support-for-IPv6-vxlan-local-tunnelip.patch
pve/0001-don-t-remove-tap-veth-fwpr-interfaces-from-bridge-on.patch
pve/0002-add-dummy-mtu-bridgevlanport-modules.patch
pve/0003-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch
diff --git a/debian/patches/upstream/0002-vxlan-Add-support-for-IPv6-vxlan-local-tunnelip.patch b/debian/patches/upstream/0002-vxlan-Add-support-for-IPv6-vxlan-local-tunnelip.patch
new file mode 100644
index 0000000..84bcd00
--- /dev/null
+++ b/debian/patches/upstream/0002-vxlan-Add-support-for-IPv6-vxlan-local-tunnelip.patch
@@ -0,0 +1,127 @@
+From acd3065a3c509a57be7077c38c19536c78e351f6 Mon Sep 17 00:00:00 2001
+From: Wido den Hollander <wido@widodh.nl>
+Date: Thu, 17 Apr 2025 10:44:44 +0200
+Subject: [PATCH] vxlan: Add support for IPv6 vxlan-local-tunnelip
+
+This commit adds the option to pass an IPv6 address instead of an IPv4 address to use as
+local tunnel IP address. With this change it's possible to use IPv6 as the underlay for
+a VXLAN based network without the need for IPv4.
+
+Upstream-Link: https://github.com/CumulusNetworks/ifupdown2/pull/315
+---
+ ifupdown2/addons/vxlan.py | 12 +++++++-----
+ ifupdown2/lib/iproute2.py | 23 ++++++++++++++++-------
+ 2 files changed, 23 insertions(+), 12 deletions(-)
+
+diff --git a/ifupdown2/addons/vxlan.py b/ifupdown2/addons/vxlan.py
+index 4cab0332..2f9174f8 100644
+--- a/ifupdown2/addons/vxlan.py
++++ b/ifupdown2/addons/vxlan.py
+@@ -51,7 +51,7 @@ class vxlan(Vxlan, moduleBase):
+ },
+ "vxlan-local-tunnelip": {
+ "help": "vxlan local tunnel ip",
+- "validvals": ["<ipv4>"],
++ "validvals": ["<ipv4>", "<ipv6>"],
+ "example": ["vxlan-local-tunnelip 172.16.20.103"]
+ },
+ "vxlan-svcnodeip": {
+@@ -547,7 +547,7 @@ class vxlan(Vxlan, moduleBase):
+
+ if local:
+ try:
+- local = ipnetwork.IPv4Address(local)
++ local = ipnetwork.IPAddress(local)
+
+ if local.initialized_with_prefixlen:
+ self.logger.warning("%s: vxlan-local-tunnelip %s: netmask ignored" % (ifname, local))
+@@ -1182,7 +1182,8 @@ class vxlan(Vxlan, moduleBase):
+ vxlan_physdev,
+ user_request_vxlan_info_data.get(Link.IFLA_VXLAN_PORT),
+ vxlan_vnifilter,
+- vxlan_ttl
++ vxlan_ttl,
++ local.version
+ )
+ elif ifaceobj.link_privflags & ifaceLinkPrivFlags.L3VXI:
+ self.iproute2.link_add_l3vxi(
+@@ -1192,7 +1193,8 @@ class vxlan(Vxlan, moduleBase):
+ group.ip if group else None,
+ vxlan_physdev,
+ user_request_vxlan_info_data.get(Link.IFLA_VXLAN_PORT),
+- vxlan_ttl
++ vxlan_ttl,
++ local.version
+ )
+ else:
+ try:
+@@ -1245,7 +1247,7 @@ class vxlan(Vxlan, moduleBase):
+ if remoteips:
+ try:
+ for remoteip in remoteips:
+- ipnetwork.IPv4Address(remoteip)
++ ipnetwork.IPAddress(remoteip)
+ except Exception as e:
+ self.log_error('%s: vxlan-remoteip: %s' % (ifaceobj.name, str(e)))
+ else:
+diff --git a/ifupdown2/lib/iproute2.py b/ifupdown2/lib/iproute2.py
+index 5f1d6006..d40f51d9 100644
+--- a/ifupdown2/lib/iproute2.py
++++ b/ifupdown2/lib/iproute2.py
+@@ -283,7 +283,12 @@ class IPRoute2(Cache, Requirements):
+
+ ###
+
+- def link_add_single_vxlan(self, link_exists, ifname, ip, group, physdev, port, vnifilter="off", ttl=None):
++ def link_add_single_vxlan(self, link_exists, ifname, ip, group, physdev, port, vnifilter="off", ttl=None, ipversion=4):
++ cmd = []
++
++ if ipversion == 6:
++ cmd.append("-6")
++
+ if link_exists:
+ self.logger.info("updating single vxlan device: %s" % ifname)
+
+@@ -291,11 +296,10 @@ class IPRoute2(Cache, Requirements):
+ # drop the external keyword:
+ # $ ip link set dev vxlan0 type vxlan external local 27.0.0.242 dev ipmr-lo
+ # Error: vxlan: cannot change COLLECT_METADATA flag.
+- cmd = ["link set dev %s type vxlan" % ifname]
++ cmd.append("link set dev %s type vxlan" % ifname)
+ else:
+ self.logger.info("creating single vxlan device: %s" % ifname)
+-
+- cmd = ["link add dev %s type vxlan external" % ifname]
++ cmd.append("link add dev %s type vxlan external" % ifname)
+
+ # when changing local ip, if we specify vnifilter we get:
+ # Error: vxlan: cannot change flag.
+@@ -321,17 +325,22 @@ class IPRoute2(Cache, Requirements):
+ self.__execute_or_batch(utils.ip_cmd, " ".join(cmd))
+ self.__update_cache_after_link_creation(ifname, "vxlan")
+
+- def link_add_l3vxi(self, link_exists, ifname, ip, group, physdev, port, ttl=None):
++ def link_add_l3vxi(self, link_exists, ifname, ip, group, physdev, port, ttl=None, ipversion=4):
+ self.logger.info("creating l3vxi device: %s" % ifname)
+
++ cmd = []
++
++ if ipversion == 6:
++ cmd.append("-6")
++
+ if link_exists:
+ # When updating an SVD we need to use `ip link set` and we have to
+ # drop the external keyword:
+ # $ ip link set dev vxlan0 type vxlan external local 27.0.0.242 dev ipmr-lo
+ # Error: vxlan: cannot change COLLECT_METADATA flag.
+- cmd = ["link set dev %s type vxlan" % ifname]
++ cmd.append("link set dev %s type vxlan" % ifname)
+ else:
+- cmd = ["link add dev %s type vxlan external vnifilter" % ifname]
++ cmd.append("link add dev %s type vxlan external vnifilter" % ifname)
+ # when changing local ip, if we specify vnifilter we get:
+ # Error: vxlan: cannot change flag.
+ # So we are only setting this attribute on vxlan creation
+--
+2.48.1
+
--
2.49.0
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-04-23 10:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 10:45 [pve-devel] [PATCH ifupdown2 0/7] bump to upstream 3.9.0 release Christoph Heiss
2025-04-23 10:45 ` [pve-devel] [PATCH ifupdown2 1/7] gitignore: add dpkg build artifacts Christoph Heiss
2025-04-23 10:45 ` [pve-devel] [PATCH ifupdown2 2/7] update submodule to 3.9.0 Christoph Heiss
2025-04-23 10:45 ` [pve-devel] [PATCH ifupdown2 3/7] d/changelog: merge in upstream changelog Christoph Heiss
2025-04-23 10:45 ` [pve-devel] [PATCH ifupdown2 4/7] d/patches: revert broken bridge-fd `validrange` clamping Christoph Heiss
2025-04-23 10:45 ` [pve-devel] [PATCH ifupdown2 5/7] bump version to 3.9.0-1+pmx1 Christoph Heiss
2025-04-23 10:45 ` Christoph Heiss [this message]
2025-04-23 10:45 ` [pve-devel] [RFC PATCH ifupdown2 7/7] bump version to 3.9.0-1+pmx2 Christoph Heiss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250423104556.644234-7-c.heiss@proxmox.com \
--to=c.heiss@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal