Firewall Setup ​
To secure your server and ensure only NeoProtect IPs can access your services, follow this guide to configure your firewall using UFW, iptables, or the automatic Setup script.
1. Using UFW ​
Step 1: Install UFW ​
bash
sudo apt update
sudo apt install ufwStep 2: Block all incoming traffic ​
bash
sudo ufw default deny incomingStep 3: Allow NeoProtect IPs ​
Retrieve the current NeoProtect IP list
Use the following commands for each NeoProtect IP:
bash
sudo ufw allow from <ip>Step 4: Allow SSH connections ​
bash
sudo ufw allow sshStep 5: Enable UFW ​
bash
sudo ufw enable2. Using iptables ​
Step 1: Block all incoming traffic ​
bash
sudo iptables -P INPUT DROPStep 2: Allow NeoProtect IPs ​
Retrieve the current NeoProtect IP list
Use the following commands for each NeoProtect IP:
bash
sudo iptables -A INPUT -s <ip> -j ACCEPTStep 3: Allow SSH connections ​
bash
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPTStep 4: Save iptables Rules ​
bash
sudo iptables-save > /etc/iptables/rules.v43. Using NeoProtect Script ​
You can simplify this process by using our automated script. Download and execute the script:
bash
curl -sSf https://neoprotect.net/firewall | bashThis will automatically configure your firewall to allow traffic from NeoProtect IPs.
4. Verify Firewall Settings ​
After setup, verify the rules are active:
- UFW: Run sudo ufw status
- iptables: Run sudo iptables -L
Make sure only the NeoProtect IPs have access. And remember to allow your own IP for SSH connections.
