

Open source projects from n2x.io.
n2x-cli

This repository contains n2xctl, a tool for managing the n2x.io SASE platform from the command line.
n2xctl is available for a variety of Linux platforms, macOS and Windows.
Minimun Requirements
n2xctl has the same minimum requirements as Go:
- Linux kernel version 2.6.23 or later
- Windows 7 or later
- FreeBSD 11.2 or later
- MacOS 10.11 El Capitan or later
Getting Started
See Quick Start to learn how to start building your n2x cloud-agnostic architecture.
See Installation for more details and other platforms.
Documentation
For the complete n2x.io platform documentation visit n2x.io/docs.
Installation
Download Binaries
Linux, macOS and Windows binary downloads are available from the Releases page.
You can download the pre-compiled binaries and install them with the appropriate tools.
Linux Installation
Linux binary installation with curl
-
Download the latest release.
curl -LO "https://dl.n2x.io/binaries/stable/latest/linux/amd64/n2xctl"
-
Validate the binary (optional).
Download the n2xctl checksum file:
curl -LO "https://dl.n2x.io/binaries/stable/latest/linux/amd64/n2xctl_checksum.sha256"
Validate the n2xctl binary against the checksum file:
sha256sum --check < n2xctl_checksum.sha256
If valid, the output must be:
n2xctl: OK
If the check fails, sha256 exits with nonzero status and prints output similar to:
n2xctl: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match
-
Install n2xctl.
sudo install -o root -g root -m 0755 n2xctl /usr/local/bin/n2xctl
Note:
If you do not have root access on the target system, you can still install n2xctl to the ~/.local/bin directory:
chmod +x n2xctl
mkdir -p ~/.local/bin
mv ./n2xctl ~/.local/bin/n2xctl
# and then append (or prepend) ~/.local/bin to $PATH
-
Verify that the installed version is the latest:
n2xctl version show
Package Repository
n2x.io provides a package repository that contains both DEB and RPM downloads.
Debian/Ubuntu
-
Run the following to setup a new APT sources.list entry and install n2x-cli:
echo 'deb [trusted=yes] https://repo.n2x.io/apt/ /' | sudo tee /etc/apt/sources.list.d/n2x.list
sudo apt update
sudo apt install n2x-cli
-
Verify that the installed version is the latest:
n2xctl version show
RHEL/CentOS
-
Run the following to create a n2x.repo file and install n2x-cli:
cat <<EOF | sudo tee /etc/yum.repos.d/n2x.repo
[n2x]
name=n2x repository - stable
baseurl=https://repo.n2x.io/yum
enabled=1
gpgcheck=0
EOF
sudo yum install n2x-cli
-
Verify that the installed version is the latest:
n2xctl version show
Homebrew installation on Linux
If you are on Linux and using Homebrew package manager, you can install the n2x.io CLI with Homebrew.
-
Run the installation command:
brew install n2x-io/tap/n2x-cli
-
Verify that the installed version is the latest:
n2xctl version show
macOS Installation
macOS binary installation with curl
-
Download the latest release.
Intel:
curl -LO "https://dl.n2x.io/binaries/stable/latest/darwin/amd64/n2xctl"
Apple Silicon:
curl -LO "https://dl.n2x.io/binaries/stable/latest/darwin/arm64/n2xctl"
-
Validate the binary (optional).
Download the n2xctl checksum file:
Intel:
curl -LO "https://dl.n2x.io/binaries/stable/latest/darwin/amd64/n2xctl_checksum.sha256"
Apple Silicon:
curl -LO "https://dl.n2x.io/binaries/stable/latest/darwin/arm64/n2xctl_checksum.sha256"
Validate the n2xctl binary against the checksum file:
shasum --algorithm 256 --check n2xctl_checksum.sha256
If valid, the output must be:
n2xctl: OK
If the check fails, sha256 exits with nonzero status and prints output similar to:
n2xctl: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match
-
Make the n2xctl binary executable.
chmod +x n2xctl
-
Move the n2xctl binary to a file location on your system PATH.
sudo mkdir -p /usr/local/bin
sudo mv n2xctl /usr/local/bin/n2xctl
sudo chown root: /usr/local/bin/n2xctl
Note: Make sure /usr/local/bin is in your PATH environment variable.
-
Verify that the installed version is the latest:
n2xctl version show
Homebrew installation on macOS
If you are on macOS and using Homebrew package manager, you can install the n2x.io CLI with Homebrew.
-
Run the installation command:
brew install n2x-io/tap/n2x-cli
-
Verify that the installed version is the latest:
n2xctl version show
Windows Installation
Windows binary installation with curl
-
Open the Windows PowerShell as Administrator and create the n2x folder.
mkdir 'C:\Program Files\n2x'
-
Download the latest release into the n2x folder.
curl -LO "https://dl.n2x.io/binaries/stable/latest/windows/amd64/n2xctl.exe"
-
Validate the binary (optional).
Download the n2xctl.exe checksum file:
curl -LO "https://dl.n2x.io/binaries/stable/latest/windows/amd64/n2xctl.exe_checksum.sha256"
Validate the n2xctl.exe binary against the checksum file:
-
Using Command Prompt to manually compare CertUtil's output to the checksum file downloaded:
CertUtil -hashfile n2xctl.exe SHA256
type n2xctl.exe_checksum.sha256
-
Using PowerShell to automate the verification using the -eq operator to get a True or False result:
$($(CertUtil -hashfile n2xctl.exe SHA256)[1] -replace " ", "") -eq $(type n2xctl.exe_checksum.sha256).split(" ")[0]
-
Add the folder C:\Program Files\n2x to your PATH environment variable. You can either append or prepend it to the existing value.
$ENV:PATH="$ENV:PATH;C:\Program Files\n2x"
-
Verify that the installed version is the latest:
n2xctl version show
Running with Docker
You can also run n2xctl as a Docker container.
Registry:
Example usage:
docker run --rm -ti -v $HOME/.n2x:/root/.n2x:ro ghcr.io/n2x-io/n2xctl help
Artifacts Verification
Binaries
All artifacts are checksummed and the checksum file is signed with cosign.
-
Download the files you want and the checksums.txt, checksum.txt.pem and checksums.txt.sig files from the Releases page:
-
Verify the signature:
cosign verify-blob \
--cert checksums.txt.pem \
--signature checksums.txt.sig \
checksums.txt
-
If the signature is valid, you can then verify the SHA256 sums match the downloaded binary:
sha256sum --ignore-missing -c checksums.txt
Docker Images
Our Docker images are signed with cosign.
Verify the signatures:
COSIGN_EXPERIMENTAL=1 cosign verify ghcr.io/n2x-io/n2xctl
Usage
To view a list of available commands and options, simply run:
n2xctl help
For in-depth information about specific commands and their usage, refer to our dedicated CLI Command Reference guide.
Uninstall
Uninstall n2x-cli in Linux
To remove n2xctl from the system, use the following commands:
Binary
sudo rm /usr/local/bin/n2xctl
sudo rm -f $HOME/.n2x
Package Repository
Debian/Ubuntu
sudo apt-get -y remove n2x-cli
sudo rm -f $HOME/.n2x
RHEL/Centos
sudo yum -y remove n2x-cli
sudo rm -f $HOME/.n2x
Uninstall n2x-cli in macOS
To remove n2xctl from the system, use the following commands:
sudo rm /usr/local/bin/n2xctl
sudo rm -f $HOME/.n2x
Uninstall n2x-cli in macOS
To remove n2xctl from the system, open the Windows PowerShell as Administrator and use the following commands:
rm 'C:\Program Files\n2x' -r -force
Have questions, need support and or just want to talk?
Get in touch with the n2x community!

Code of Conduct
Participation in the n2x community is governed by the Contributor Covenant Code of Conduct. Please make sure to read and observe this document.
Please make sure to read and observe this document. By participating, you are expected to uphold this code.
License
The n2x open source projects are licensed under the Apache 2.0 License.
