How to Deploy a n2x-node in GCP
This article offers a step-by-step guide on setting up a n2x-node
in GCP, including creating all the necessary infrastructure within the cloud service provider.
Prerequisites
To complete this tutorial, you must meet the following requirements:
-
An GCP account.
-
The Compute Engine API should be enabled.
-
A n2x.io account and one subnet with
10.254.1.0/24
prefix.
Architecture
This section provides a basic architectural blueprint to guide you through deploying a n2x-node
within the Google Cloud Platform (GCP). This modular design offers versatility and can be reused for various deployment goals, including achieving High Availability (HA) for your n2x.io nodes within your network.

Step-by-step Guide
Step 1 - Creating and Configuring the GCP VPC
-
Create the VPC using the values as shown in the following table. For more information, see VPC Networks.
VPC Settings
Name MTU Subnets Mode IPv6 Range edge-vpc 1460 Custom Disabled -
Create a custom subnet in the VPCs as described in the following table. For more information, see Subnets.
Subnet Settings
Name Description Region IPv4 range edge-pub-net Edge Public Subnet us-east1 10.0.1.0/28 -
Now let's create the firewall rules required by n2x.io. Select the
edge-vpc
we have just created, go to theFirewalls
tab and selectAdd Firewall Rule
. For more information, see FirewallsCreate firewall rules as described on the table below.
Name Network Priority Direction of traffic Action on match Target tags Protocol: Port Range Source Target n2x-data-plane-inbound edge-vpc 1000 Ingress Allow n2x-node TCP:57775 / UDP:57775 0.0.0.0/0 0.0.0.0/0 ssh-vm-management-inbound edge-vpc 1001 Ingress Allow n2x-node TCP:22 0.0.0.0/0 0.0.0.0/0 n2x-control-plane-https-outbound edge-vpc 2000 Egress Allow n2x-node TCP:443 0.0.0.0/0 0.0.0.0/0 n2x-control-plane-mqtt-outbound edge-vpc 2001 Egress Allow n2x-node TCP:1883 0.0.0.0/0 0.0.0.0/0 n2x-data-plane-outbound edge-vpc 2002 Egress Allow n2x-node TCP:57775 / UDP:57775 0.0.0.0/0 0.0.0.0/0 Info
For direct communication between n2x.io nodes, open inbound connections to ports 57775 TCP/UDP. (See direct connection for details).
Note
Open inbound connectivity to ports
SSH
orRDP
(or both) for remote VM management, as needed.Let's create the first rule as an example:
Repeat the steps above for each rule in the table. Once completed, the table will look like this:
Step 2 - Launching a VM instance
-
Launch a VM instance to support the n2x-node selecting the region where we have created the VPC previously:
Open
Advanced options
, onNetworking
add the n2x-node onNetwork tag
field:Select the
edge-vpc
network andedge-pub-net
subnet under Network interfaces section, then clickDONE
:Finally, click
Create
to start creating the VM instance.
Note
Please note that this tutorial uses a Linux OS with an Ubuntu 22.04
(Jammy Jellyfish) but you can choose any OS supported by n2x.io and GCP Compute Engine.
Step 3 - Connecting VM to our n2x.io Network Topology
To connect your VM to the n2x.io network topology, you'll need to:
- Add a new connected node to your subnet.
- Install the n2x-node agent on the EC2 instance.
Step 4 - Verification
Let's confirm that everything is operational:
-
Check the
n2x-node
service status onn2x-node-01
using:systemctl status n2x-node
-
Verify that the
n2x0
interface onn2x-node-01
is active and has an IP address assigned by using the following command:ip addr show dev n2x0
-
(Optional) To verify connectivity within the n2x.io subnet, you can perform a simple test if another node is present. In this example, we'll use
test-node-01
which has the IP address10.254.1.209
.ping -c 5 10.254.1.209
Conclusion
We've provided a comprehensive guide for launching a n2x-node
in GCP. Feel free to adapt this foundation to meet your specific needs and implement more complex scenarios.