Skip to content

Instantly share code, notes, and snippets.

@OPVL
Created January 8, 2026 14:23
Show Gist options
  • Select an option

  • Save OPVL/3dd486e7b57d857d3a92e6af046f83ce to your computer and use it in GitHub Desktop.

Select an option

Save OPVL/3dd486e7b57d857d3a92e6af046f83ce to your computer and use it in GitHub Desktop.
Fedora Steam Link Firewall Rules
#!/bin/bash
# Author: OPVL (08/01/2026)
# This script is designed for Fedora users to manage Steam ports in the firewall.
# You will need to run this script if you've been able to pair your Steam Link
# but unable to run a network test. You will have seen a message like:
# Network Test Failed - Couldn't connect to {HOSTNAME} on port 27031
# USAGE:
# - Download the script to your Fedora machine
# - Make it executable: chmod +x unblock_steam_ports.sh
# - Run the script with sudo privileges to unblock the ports:
# ./unblock_steam_ports.sh unblock
# - To block the ports again, run:
# ./unblock_steam_ports.sh block
# No warranty is provided. Use at your own risk.
function unblock_steam_ports() {
echo "Unblocking Ports: 27031/udp, 27036/udp, 27036/tcp, 27037/tcp"
read -p "Do you wish to continue? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Operation cancelled."
exit 0
fi
sudo firewall-cmd --permanent --zone=public --add-port=27031/udp
sudo firewall-cmd --permanent --zone=public --add-port=27036/udp
sudo firewall-cmd --permanent --zone=public --add-port=27036/tcp
sudo firewall-cmd --permanent --zone=public --add-port=27037/tcp
sudo firewall-cmd --reload
echo "Changes applied & firewall reloaded. Please restart Steam for the changes to take effect."
}
function block_steam_ports() {
echo "Blocking Steam ports in the firewall..."
read -p "Do you wish to continue? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Operation cancelled."
exit 0
fi
sudo firewall-cmd --permanent --zone=public --remove-port=27031/udp
sudo firewall-cmd --permanent --zone=public --remove-port=27036/udp
sudo firewall-cmd --permanent --zone=public --remove-port=27036/tcp
sudo firewall-cmd --permanent --zone=public --remove-port=27037/tcp
sudo firewall-cmd --reload
echo "Changes applied & firewall reloaded. You will no longer be able to use Steam Link."
}
case "$1" in
unblock)
unblock_steam_ports
;;
block)
block_steam_ports
;;
*)
echo "Usage: $0 {unblock|block}"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment