git: 968b1ae64b83 - main - sysutils/cni-epair: New port: CNI plugin giving containers a LAN address via epair and bridge

From: Jesús Daniel Colmenares Oviedo <dtxdf_at_FreeBSD.org>
Date: Sat, 03 Oct 2026 21:30:20 UTC
The branch main has been updated by dtxdf:

URL: https://cgit.FreeBSD.org/ports/commit/?id=968b1ae64b83522f159bd57ab3cd85d79334f2f9

commit 968b1ae64b83522f159bd57ab3cd85d79334f2f9
Author:     Michael Johnson <ahze@ahze.net>
AuthorDate: 2026-10-03 17:55:54 +0000
Commit:     Jesús Daniel Colmenares Oviedo <dtxdf@FreeBSD.org>
CommitDate: 2026-10-03 21:29:17 +0000

    sysutils/cni-epair: New port: CNI plugin giving containers a LAN address via epair and bridge
    
    A CNI plugin that gives FreeBSD containers an address on a real LAN segment.
    
    FreeBSD has no macvlan. This plugin does the native equivalent: it creates an
    epair per container, attaches one end to a host bridge, moves the other into
    the container's jail, and applies the address supplied by IPAM.
    
    IPv4 and IPv6 are both supported, together or alone: a network configuration
    carrying a range for each gives the container an address and a default route
    in both families.
    
    It implements the ADD, DEL, CHECK and VERSION commands, and delegates address
    allocation to the IPAM plugin named in the network configuration.
    
    WWW: https://github.com/daemonless/cni-epair
    
    PR:             298571
---
 sysutils/Makefile            |  1 +
 sysutils/cni-epair/Makefile  | 44 ++++++++++++++++++++++++++++++++++++++++++++
 sysutils/cni-epair/distinfo  |  3 +++
 sysutils/cni-epair/pkg-descr | 12 ++++++++++++
 4 files changed, 60 insertions(+)

diff --git a/sysutils/Makefile b/sysutils/Makefile
index 425074e77d1c..46e60e0d2e2c 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -219,6 +219,7 @@
     SUBDIR += cmogstored
     SUBDIR += cmospwd
     SUBDIR += cni-dnsname
+    SUBDIR += cni-epair
     SUBDIR += colorize
     SUBDIR += conan
     SUBDIR += condy
diff --git a/sysutils/cni-epair/Makefile b/sysutils/cni-epair/Makefile
new file mode 100644
index 000000000000..0f2934347bc7
--- /dev/null
+++ b/sysutils/cni-epair/Makefile
@@ -0,0 +1,44 @@
+PORTNAME=	cni-epair
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.1.1
+CATEGORIES=	sysutils
+
+MAINTAINER=	michaeljohnson@ahze.net
+COMMENT=	CNI plugin giving containers a LAN address via epair and bridge
+WWW=		https://github.com/daemonless/cni-epair
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+RUN_DEPENDS=	${LOCALBASE}/libexec/cni/host-local:net/containernetworking-plugins
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	daemonless
+
+# A POSIX shell script: nothing to compile, nothing architecture specific.
+NO_ARCH=	yes
+NO_BUILD=	yes
+
+OPTIONS_DEFINE=	DOCS EXAMPLES
+OPTIONS_DEFAULT=	DOCS EXAMPLES
+
+PLIST_FILES=	libexec/cni/epair
+PORTDOCS=	README.md
+PORTEXAMPLES=	*
+
+post-patch:
+	${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g" ${WRKSRC}/epair
+
+do-install:
+	${MKDIR} ${STAGEDIR}${PREFIX}/libexec/cni
+	${INSTALL_SCRIPT} ${WRKSRC}/epair ${STAGEDIR}${PREFIX}/libexec/cni
+
+do-install-DOCS-on:
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
+
+do-install-EXAMPLES-on:
+	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+	${INSTALL_DATA} ${WRKSRC}/examples/* ${STAGEDIR}${EXAMPLESDIR}
+
+.include <bsd.port.mk>
diff --git a/sysutils/cni-epair/distinfo b/sysutils/cni-epair/distinfo
new file mode 100644
index 000000000000..5d7eb7753573
--- /dev/null
+++ b/sysutils/cni-epair/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1789894440
+SHA256 (daemonless-cni-epair-v1.1.1_GH0.tar.gz) = f2e00504dba433b1ca55c87079ba87277a50470fae14eb810020ed44d85a5a21
+SIZE (daemonless-cni-epair-v1.1.1_GH0.tar.gz) = 10228
diff --git a/sysutils/cni-epair/pkg-descr b/sysutils/cni-epair/pkg-descr
new file mode 100644
index 000000000000..19a3721fa682
--- /dev/null
+++ b/sysutils/cni-epair/pkg-descr
@@ -0,0 +1,12 @@
+A CNI plugin that gives FreeBSD containers an address on a real LAN segment.
+
+FreeBSD has no macvlan. This plugin does the native equivalent: it creates an
+epair per container, attaches one end to a host bridge, moves the other into
+the container's jail, and applies the address supplied by IPAM.
+
+IPv4 and IPv6 are both supported, together or alone: a network configuration
+carrying a range for each gives the container an address and a default route
+in both families.
+
+It implements the ADD, DEL, CHECK and VERSION commands, and delegates address
+allocation to the IPAM plugin named in the network configuration.