Recomended VPS Providers: https://Lihat.info/contabohttps://Lihat.info/interserverhttps://Lihat.info/vultr
Running a coins validator nodes or any blockchain nodes are always need require port configuration to secure the server from various outside threats.
there are many software that can be used to perform port management, but here I will discuss only firewalld,
Firewalld is frontend controller for nftables (or its older counterpart, iptables) used to implement persistent network traffic rules. It provides command line and graphical interfaces and is available in the repositories of most Linux distributions.
While firewalld is a frontend for nftables/iptables and allows easier management of firewall rules, it is not a direct replacement for these utilities. Using nftables directly may provide you with more control. When using firewalld, its recommended to use firewall-cmd commands (instead of nftables or iptables commands) to interface directly with firewalld.
- Installing Firewalld (Ubuntu & Debian)
sudo apt update && sudo apt install firewalld
- Disable Any other firewall configuration software
sudo ufw disable
- Managing Firewalld
- Starting Firewalld
sudo systemctl start firewalldsudo systemctl enable firewalld
- Stop & Disable Firewalld
sudo systemctl stop firewalldsudo systemctl disable firewalld
- Check firewalld status
sudo firewall-cmd --state
- Check firewalld Daemon Status
sudo systemctl status firewalld
- Reload / Restart Firewalld Configuration
sudo firewall-cmd --reload
- Set Default Zone
sudo firewall-cmd --set-default-zone=public
- Open New Port
sudo firewall-cmd --zone=public --add-port=YOUR_PORT/tcp --permanent
- **change the YOUR_PORT to any port you want to open
open port 22 example:sudo firewall-cmd --zone=public --add-port=22/tcp --permanent
- List All Port
sudo firewall-cmd --list-all
- Remove Port
sudo firewall-cmd --zone=public --remove-port=YOUR_PORT/tcp --permanent
- **change the YOUR_PORT to any port you want to remove
- Forward Port on Same Server
sudo firewall-cmd --zone="public" --add-forward-port=port=FROM_PORT:proto=tcp:toport=TO_PORT
- **Change your FROM_PORT and TO_PORT
- Starting Firewalld
The reload command drops all runtime configurations and applies a permanent configuration. Because firewalld manages the ruleset dynamically, it won’t break an existing connection and session.
Join My Discord (MoneyCamp) Server: https://discord.gg/xKTBGs9fMF
Join My Telegram Group (CodeBlockLabs): https://t.me/codeblocklabs
Subscribe My Youtube Channel: https://www.youtube.com/c/pramonoutomo