Prime Stake Pool
WebsiteTwitterTelegram
  • Home
  • About Us
  • Server Setup Basics
    • How to setup your Cloud Server securely
      • Create new user
      • Use ssh key pair to access your server
        • Create .ssh folder
        • Create rsa key pair (public/private)
        • Copy rsa public key to remote server
      • Disable root login,password and change default port 22
      • Install fail2ban
      • Firewall rules
      • Enable 2FA
      • Setup video
    • Linux Swap Space
      • Add Swap Space
      • Kernel cache pressure and swappiness
      • Add swap video
  • Server Settings
    • Setting Up chrony
    • Static IP using Netplan
    • Time Synchronization
    • Important Settings
    • TMUX
  • Linux Commands
    • Basic Commands
    • Important Uses
  • Node Setup Guide
    • Cardano
      • How to minimize missed slot leader checks / missed blocks
        • Garbage collection
        • Run node in multicore mode
        • Turn off TraceMempool
    • Ethereum
  • Monitoring
    • Raspberry Pi ARM
    • Linux System x64
  • Maintenance
  • Logical Volume Management (LVM)
    • Basic concepts
    • LVM Resize
      • Decrease an LVM partition
      • Increase an LVM partition
    • Add a new PV to VG
    • LVM Commands
    • LVM on Pi
  • Disk Check
  • Backup Disk
Powered by GitBook
On this page
  1. Server Setup Basics
  2. How to setup your Cloud Server securely

Firewall rules

Security Layer 6

PreviousInstall fail2banNextEnable 2FA

Last updated 2 years ago

Finally let us define the firewall rules for our server. For running Ethereum node you need to open port 30303 (TCP & UDP) and 9001 (TCP & UDP).

You can set up the firewall rules for your cloud server on your cloud service provider platform. But I personally prefer setting up using 'ufw' through command line interface. First let us check the status of the firewall.

sudo ufw status verbose

stauts: inactive

By default firewall is setup with 'deny incoming' and 'allow outgoing'. Now you can first define the firewall rules and then enable it or enable it first and then define the firewall rules. But I personally prefer defining firewall rules first and then enable it. Let's first open the ssh port 1234 and then ports for the Ethereum node.

sudo ufw allow 1234/tcp

Rules updated

Rules updated (v6)

sudo ufw allow 30303/tcp

Rules updated

Rules updated (v6)

sudo ufw allow 9001/tcp

Rules updated

Rules updated (v6)

sudo ufw enable

Command may disrupt existing ssh connection. Proceed with operation (y/n)? y

Firewall is active and enabled on system startup

Always remember to first change the default port 22 through which ssh connection has been made to port 1234 in 'sshd_config' file then only you must open port 1234 for incoming in ufw firewall settings, otherwise you may end up with trouble logging in to your server.