Setup Firewall Using UFW
Restrict inbound traffic on your GPU instance with Uncomplicated Firewall.
Intro
While GPUnet Cloud does not currently provide any firewall rules through the platform, you can set up a firewall on the GPU instance using Uncomplicated Firewall (UFW).
Setting up UFW
1. Check that UFW is installed
Follow the QuickStart guide to create a GPU instance and SSH into it. Once you have terminal access, verify that UFW is installed. UFW comes pre-installed on all GPUnet Cloud instances.
sudo ufw status2. Add allow and deny rules
Use the ufw CLI to add allow and deny rules. You can specify a port or port range and the protocol, as well as blanket allows and denies.
sudo ufw allow 22/tcp # Allow TCP on port 22
sudo ufw allow 80/tcp # Allow TCP on port 80
sudo ufw allow 443/tcp # Allow TCP on port 443
sudo ufw allow 1194/udp # Allow UDP on port 1194
sudo ufw deny 25/tcp # Deny TCP on port 25
sudo ufw allow 3000:4000/tcp # Allow TCP on ports 3000-4000Don't lock yourself out
If you blanket deny all incoming traffic without an explicit allow rule for TCP on port 22, you will block your own SSH access and be locked out of the instance. For certain cloud providers, GPUnet Cloud can work with the underlying provider to disable UFW, but this is not guaranteed.
3. Enable UFW
Once you have configured all of your UFW policies, enable the service. Rules are only applied after UFW is enabled.
sudo ufw enableLast updated on