Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
n2x-cli / usr / share / doc / n2x-cli
  ..
  LICENSE
  README.md
  SECURITY.md
  SUPPORT.md
Size: Mime:

n2x.io

Discord GitHub Discussions X Mastodon

Open source projects from n2x.io.

n2x-cli

Go Report Card Release GitHub

This repository contains n2xctl, a tool for managing the n2x 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.

Documentation

For the complete n2x platform documentation visit n2x.io/docs.

Installation

Binary Downloads

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

  1. Download the latest release.

    curl -LO "https://dl.n2x.io/binaries/stable/latest/linux/amd64/n2xctl"
    
  2. 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
    
  3. 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
    

Package Repository

n2x provides a package repository that contains both DEB and RPM downloads.

For DEB-based platforms (e.g. Ubuntu and Debian) run the following to set up 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

For RPM-based platforms (e.g. RHEL, CentOS) use the following to create a 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

Homebrew installation on Linux

If you are on Linux and using Homebrew package manager, you can install the n2x CLI with Homebrew.

  1. Run the installation command:

    brew install n2x-io/tap/n2x-cli
    
  2. Test to ensure the version you installed is up-to-date:

    n2xctl version show
    

macOS Installation

macOS binary installation with curl

  1. 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"
    
  2. 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
    
  3. Make the n2xctl binary executable.

    chmod +x n2xctl
    
  4. 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.

Homebrew installation on macOS

If you are on macOS and using Homebrew package manager, you can install the n2x CLI with Homebrew.

  1. Run the installation command:

    brew install n2x-io/tap/n2x-cli
    
  2. Test to ensure the version you installed is up-to-date:

    n2xctl version show
    

Windows Installation

Windows binary installation with curl

  1. Open the Command Prompt as Administrator and create a folder for n2x.

    mkdir 'C:\Program Files\n2x'
    
  2. Download the latest release into the n2x folder.

    curl -LO "https://dl.n2x.io/binaries/stable/latest/windows/amd64/n2xctl.exe"
    
  3. 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]
      
  4. Append or prepend the folder C:\Program Files\n2x to your PATH environment variable.

  5. Test to ensure the version of n2xctl is the same as downloaded.

    n2xctl version show
    

Artifacts Verification

Binaries

All artifacts are checksummed and the checksum file is signed with cosign.

  1. Download the files you want and the checksums.txt, checksum.txt.pem and checksums.txt.sig files from the Releases page:

  2. Verify the signature:

    cosign verify-blob \
        --cert checksums.txt.pem \
        --signature checksums.txt.sig \
        checksums.txt
    
  3. 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

Configuration

The first time you run n2xctl, you will be assisted to generate your n2xctl.yml. This config file will be located by default at the $HOME/.n2x directory.

See the n2xctl configuration reference to find all the configuration options.

Usage

See usage with:

n2xctl help

Running with Docker

You can also run n2xctl as a Docker container. See the example below.

Registries:

  • ghcr.io/n2x-io/n2xctl
  • n2xdev/n2xctl

Example usage:

docker run --rm -ti -v $HOME/.n2x:/root/.n2x:ro ghcr.io/n2x-io/n2xctl help

Community

Have questions, need support and or just want to talk?

Get in touch with the n2x community!

Discord GitHub Discussions X Mastodon

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.

FOSSA Status