Skip to contentSkip to conversation

ip: add OVPN device mode support

PATCH Applied Marco Baffo 2 participants 2 messages Jul 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ip: add OVPN device mode support

ovpn devices (OpenVPN data channel offload, kernel v6.16) can already be created with "ip link add ovpn0 type ovpn", but the mode is always left to the kernel default (p2p mode).

Add ovpn link type support so that point-to-point (p2p) or multi-peer (mp) mode can be selected at creation time and shown by "ip -d link show".

Example:

  $ ip link add ovpn0 type ovpn mode mp

---

Changes in v2:
- Created a mode table to use for both parsing and printing.
- Used strcmp() instead of matches().

 ip/Makefile           |  2 +-
 ip/iplink.c           |  2 +-
 ip/iplink_ovpn.c      | 92 +++++++++++++++++++++++++++++++++++++++++++
 man/man8/ip-link.8.in | 24 +++++++++++
 4 files changed, 118 insertions(+), 2 deletions(-)
 create mode 100644 ip/iplink_ovpn.c
ip/Makefile +1 -1
index 3535ba78..978f6841 100644
@@ -13,7 +13,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
     ipvrf.o iplink_xstats.o ipseg6.o iplink_netdevsim.o iplink_rmnet.o \
     ipnexthop.o ipmptcp.o iplink_bareudp.o iplink_wwan.o ipioam6.o \
     iplink_amt.o iplink_batadv.o iplink_gtp.o iplink_virt_wifi.o \
-    iplink_netkit.o ipstats.o
+    iplink_netkit.o ipstats.o iplink_ovpn.o
 
 RTMONOBJ=rtmon.o
 
ip/iplink.c +1 -1
index 3f0b46c9..c6aee8b6 100644
@@ -42,7 +42,7 @@ void iplink_types_usage(void)
 		"          ifb | ip6erspan | ip6gre | ip6gretap | ip6tnl |\n"
 		"          ipip | ipoib | ipvlan | ipvtap |\n"
 		"          macsec | macvlan | macvtap | netdevsim |\n"
-		"          netkit | nlmon | pfcp | rmnet | sit | team | team_slave |\n"
+		"          netkit | nlmon | ovpn | pfcp | rmnet | sit | team | team_slave |\n"
 		"          vcan | veth | vlan | vrf | vti | vxcan | vxlan | wwan |\n"
 		"          xfrm | virt_wifi }\n");
 }
ip/iplink_ovpn.c new file +92 -0

92 lines not on this page · raw message

man/man8/ip-link.8.in +24 -0
index fc7f0248..d54d2fbc 100644
@@ -287,6 +287,7 @@ ip-link \- network device configuration
 .BR netdevsim " |"
 .BR netkit " |"
 .BR nlmon " |"
+.BR ovpn " |"
 .BR pfcp " |"
 .BR rmnet " |"
 .BR sit " |"
@@ -430,6 +431,9 @@ Link types:
 .BR nlmon
 - Netlink monitoring device
 .sp
+.BR ovpn
+- OpenVPN Data Channel Offload device
+.sp
 .BR pfcp
 - Packet Forwarding Control Protocol device
 .sp
@@ -1349,6 +1353,26 @@ the following additional arguments are supported:
 .BI  mode " MODE "
 - specifies the mode (datagram or connected) to use.
 
+.TP
+OVPN Type Support
+For a link of type
+.I OVPN
+the following additional arguments are supported:
+
+.BI "ip link add " DEVICE
+.BR "type ovpn " [ " mode " "{ " p2p " | " mp " }" " ]"
+
+.in +8
+.sp
+.BR mode " { " p2p " | " mp " }"
+- selects the OpenVPN device mode. The default,
+.BR p2p ,
+creates a point-to-point device for a single peer. The
+.B mp
+mode creates a multi-peer device.
+
+.in -8
+
 .TP
 ERSPAN Type Support
 For a link of type
Signature · 1 line
2.43.0
#1 lore raw
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Quoted 9 lines · On Thu, 9 Jul 2026 12:28:19 +0200 you wrote:

ovpn devices (OpenVPN data channel offload, kernel v6.16) can already be created with "ip link add ovpn0 type ovpn", but the mode is always left to the kernel default (p2p mode).

Add ovpn link type support so that point-to-point (p2p) or multi-peer (mp) mode can be selected at creation time and shown by "ip -d link show".

[...]

Here is the summary with links:
- [iproute2-next,v2] ip: add OVPN device mode support

    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=92f89d0e66b2

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html