Skip to content

Instantly share code, notes, and snippets.

@shoaibi
Created June 25, 2015 14:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shoaibi/3f2d2b9b21bc4238c19f to your computer and use it in GitHub Desktop.
Save shoaibi/3f2d2b9b21bc4238c19f to your computer and use it in GitHub Desktop.
Block Steam's internet access using iptables
#!/bin/sh
# Block Steam's internet access using iptables
# Script must be run as a user with root (or one that has
# permissions to play with iptables)
#
#
# Why did i need it? Even when running in offline mode
# steam would keep trying to login and then once every
# while it'd end my dota bota match saying "Connection
# Lost".
iptables -A OUTPUT -p udp --dport 27000:27050 -j DROP
iptables -A OUTPUT -p tcp --dport 27000:27050 -j DROP
iptables -A OUTPUT -p tcp --destination 79.140.94.16 -j DROP
iptables -A OUTPUT -p tcp --destination 79.140.94.18 -j DROP
iptables -A OUTPUT -p tcp --destination 162.254.192.18 -j DROP
iptables -A OUTPUT -p tcp --destination 8.254.43.254 -j DROP
iptables -A OUTPUT -p tcp --destination 8.254.130.126 -j DROP
iptables -A OUTPUT -p tcp --destination 162.254.192.16 -j DROP
@dimithras
Copy link

Tried it on a router, steam login and downloads still work

@shoaibi
Copy link
Author

shoaibi commented May 5, 2020

Given the script was created 5 years ago, I am almost sure that the current IPs that steam client uses have changed in the mean while.
Perhaps try a sniffer to see which IPs steam client connects with and block them?
Or you can run steamclient under a different user and block all network access for processes owned by that user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment