Skip to content

Instantly share code, notes, and snippets.

@hpcorona
Created April 28, 2013 03:03
Show Gist options
  • Save hpcorona/5475690 to your computer and use it in GitHub Desktop.
Save hpcorona/5475690 to your computer and use it in GitHub Desktop.
IP tables rules for l4d2 server
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p udp -m udp --dport 27000:27030 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 27014:27050 -j ACCEPT
-A INPUT -p udp -m udp --dport 4380 -j ACCEPT
-A INPUT -p udp -m udp --dport 3478 -j ACCEPT
-A INPUT -p udp -m udp --dport 4379 -j ACCEPT
-A INPUT -p udp -m udp --dport 4380 -j ACCEPT
-A INPUT -j DROP
-A OUTPUT -p tcp -m tcp --sport 22 -j ACCEPT
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment