To enable inbound and outbound TCP traffic specifically for port 18917 using ufw
on Debian 12, follow these steps:
- Allow inbound TCP traffic on port 18917:
sudo ufw allow 18917/tcp
- Allow outbound TCP traffic on port 18917 (if you have restricted outgoing traffic):
sudo ufw allow out to any port 18917 proto tcp
- Check the UFW status to confirm the rules have been applied:
sudo ufw status verbose
If you’re using firewalld
instead of ufw
, the equivalent commands are:
- Allow inbound TCP traffic on port 18917:
sudo firewall-cmd --zone=public --add-port=18917/tcp --permanent
- Allow outbound TCP traffic on port 18917:
sudo firewall-cmd --zone=public --add-forward-port=port=18917:proto=tcp:toport=18917 --permanent
- Reload firewalld to apply the changes:
sudo firewall-cmd --reload
- Verify the settings:
sudo firewall-cmd --list-all
This should allow TCP traffic on port 18917 in both directions.