On Windows
How To Allow a Port
- Open Windows Defender Firewall
- Go to Advanced Settings
- Click on Inbound Rules
- Action → New Rule
- Select Port
- Select UDP then specify your port, our example: 27960
- Ensure you Allow connection
- Choose which network profile. Usually this would not matter for a desktop at home. Select all.
- Give it a name and click Finish
- Correctly added and opened, will show a green icon next to your new rule
How To Block a Program
- Open Windows Defender Firewall
- Go to Advanced Settings
- Click on Outbound Rules
- Action → New Rule
- Select Program
- Click Browse and select the executable you want to block
- Ensure you tick Block the connection
- Choose which network profile. Usually this would not matter for a desktop at home. Select all.
- Give it a name and click Finish
On Linux
Blocking Outbound Traffic
UFW can also control outbound traffic. By default, UFW allows all outbound connections. You can change this to block specific outbound traffic or deny all outbound traffic by default. To deny all outbound connections by default:sudo ufw default deny outgoing
To block outbound traffic to a specific port (example: SMTP on port 25 TCP):
sudo ufw deny out 25/tcp
To block outbound traffic to a specific IP address:
sudo ufw deny out to 192.168.1.100
To block outbound traffic to a specific IP and port:
sudo ufw deny out to 192.168.1.100 port 443 proto tcp
To block a specific protocol entirely (example: all outbound UDP):
sudo ufw deny out proto udp
Note: UFW does not block traffic by executable path. It filters by IP address, port number, and protocol (TCP/UDP).
Comments (0)
No comments yet. Be the first to comment!
Leave a Comment