Port Configuration in Ubuntu
🔌 Why Ports Are Needed in a Node and How They Affect It
Each node is a separate process that communicates with other nodes over the network. To do this, it opens specific ports, through which it:
Accepts incoming connections (e.g., from other peers),
Handles API requests (e.g., REST or RPC),
Sends data to other participants in the network (peer-to-peer).
A port is like a "door" on your server. Each process (in this case, each node) must have its own unique door, otherwise conflicts occur. Two processes cannot listen on the same port.
⚠️ System Ports
22
SSH (Secure Shell)
Used for remote server access. It's crucial not to block or change this port if you're using SSH to manage your server.
53
DNS (Domain Name System)
Used for resolving domain names into IP addresses. This port is often occupied by local or system DNS services.
To check for open ports on a server, you can use several commands. Here are some popular methods:
1. Using netstat
netstat
The netstat
command allows you to view all open ports and active connections:
Set it up:
In this example, it is shown that the nodes are installed on port 8080 (Gaianet) and port 8008 (Pipe Network). These are custom ports for the nodes to communicate with other peers. Meanwhile, port 22 and port 53 is a system port
2. Using ss
ss
The ss
command is a more modern alternative to netstat
:
The parameters are the same as for netstat
, and the output will be similar.
Last updated