Setup Firewall
It is imperative that all nodes have the P2P port 5120
open for both incoming and outgoing connections on TCP and UDP. This P2P port facilitates communication between nodes, thereby forming a network.
5120/tcp
5120/udp
API Node
To operate an API node, it's necessary to enable the API ports 8545
and 8546
for incoming TCP connections.
Incoming
8545/tcp
RPC connections8546/tcp
Websocket connections
System Firewall
Your system may have a firewall enabled. Usually, it is ufw
on Ubuntu and firewalld
on Redhat.
Check the status of your firewall.
sudo ufw status
sudo firewall-cmd --state
If the firewall is not running, you can skip this step.
Open the P2P port for incoming and outgoing connections.
sudo ufw allow 5120/udp
sudo ufw allow 5120/tcp
sudo firewall-cmd --add-port=5120/tcp --permanent
sudo firewall-cmd --add-port=5120/udp --permanent
Optional: Open the API ports if you're running an API node.
sudo ufw allow 8545/tcp
sudo ufw allow 8546/tcp
sudo firewall-cmd --add-port=8545/tcp --permanent
sudo firewall-cmd --add-port=8546/tcp --permanent
Cloud Firewall
If you are running your node on a cloud provider, you may have a cloud firewall enabled.
Each cloud provider has a different way of managing their firewall. Please refer to your cloud provider's documentation on how to open ports.
- AWS: Security Groups
- Azure: Network Security Groups
- Google Cloud: Firewall Rules
- Digital Ocean: Cloud Firewalls
- Alibaba Cloud: Security Groups
- Hetzner Cloud: Firewalls