SHARE
TWEET

Rawr TF2 Server Junk

a guest May 24th, 2013 75 Never
  1. updating/installing the tf2 server
  2. ./steamcmd.sh +login anonymous +force_install_dir ../tf2/ +app_update 232250 validate +quit
  3.  
  4. starting the server
  5. ./tf2/srcds_run -steam_dir steamcmd/ -steamcmd_script steamcmd/steamcmd.sh -console +hostname xxxxxxx -ip xxx.xxx.xxx -port xxxxx -game tf +map cp_dustbowl -maxplayers 24
  6.  
  7. adding bots
  8. tf_bot_add 4
  9.  
  10. iptables found on the internet
  11.  
  12. stop DDOS attacks
  13. iptables -A INPUT -p tcp --destination-port 27015 -j LOG --log-prefix "SRCDS-RCON " -m limit --limit 1/m --limit-burst 1
  14. iptables -A INPUT -p tcp --destination-port 27015 -j DROP
  15. iptables -A INPUT -p udp --destination-port 27015 -m length --length 0:32 -j LOG --log-prefix "SRCDS-XSQUERY " --log-ip-options -m limit --limit 1/m --limit-burst 1
  16. iptables -A INPUT -p udp --destination-port 27015 -m length --length 0:32 -j DROP
  17. iptables -A INPUT -p udp --destination-port 27015 -m length --length 2521:65535 -j LOG --log-prefix "SRCDS-XLFRAG " --log-ip-options -m limit --limit 1/m --limit-burst 1
  18. iptables -A INPUT -p udp --destination-port 27015 -m length --length 2521:65535 -j DROP
  19. -m hashlimit --hashlimit-mode dstport,dstip --hashlimit-name StopFlood --hashlimit 330/s --hashlimit-burst 66
  20. iptables -A INPUT -p udp -m state --state ESTABLISH -j ACCEPT
  21. iptables -A INPUT -p udp -m state --state NEW -m hashlimit --hashlimit-mode srcip,dstport --hashlimit-name StopDoS --hashlimit 1/s --hashlimit-burst 3 -j ACCEPT
  22. iptables -A INPUT -p udp -m state --state NEW -m hashlimit --hashlimit-mode srcip --hashlimit-name StopDoS --hashlimit 1/s --hashlimit-burst 3 -j ACCEPT
  23. iptables -A INPUT -p udp -j LOG --log-prefix "UDP-SPAM " --log-ip-options -m limit --limit 1/m --limit-burst 1
  24. iptables -A INPUT -p udp -j DROP
  25.  
  26. Steam iptables form SteamCmd page
  27. iptables -A INPUT -p udp -m udp --sport 27000:27030 --dport 1025:65355 -j ACCEPT
  28. iptables -A INPUT -p udp -m udp --sport 4380 --dport 1025:65355 -j ACCEPT
  29.  
  30. Debian iptables
  31. *filter
  32.  
  33. #  Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
  34. -A INPUT -i lo -j ACCEPT
  35. -A INPUT -d 127.0.0.0/8 -j REJECT
  36.  
  37. #  Accept all established inbound connections
  38. -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  39.  
  40. #  Allow all outbound traffic - you can modify this to only allow certain traffic
  41. -A OUTPUT -j ACCEPT
  42.  
  43. #  Allow HTTP and HTTPS connections from anywhere (the normal ports for websites and SSL).
  44. -A INPUT -p tcp --dport 80 -j ACCEPT
  45. -A INPUT -p tcp --dport 443 -j ACCEPT
  46.  
  47. #  Allow SSH connections
  48. #
  49. #  The -dport number should be the same port number you set in sshd_config
  50. #
  51. -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
  52.  
  53. #  Allow ping
  54. -A INPUT -p icmp -j ACCEPT
  55.  
  56. #  Log iptables denied calls
  57. -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
  58.  
  59. #  Drop all other inbound - default deny unless explicitly allowed policy
  60. -A INPUT -j DROP
  61. -A FORWARD -j DROP
  62.  
  63. COMMIT
  64.  
  65.  
  66. iptables form some webfourms
  67. # Accept anything from localhost
  68. iptables -A INPUT -s 127.0.0.1/32 --jump ACCEPT
  69.  
  70. # FTP
  71. iptables -A INPUT -p tcp --dport 21 --jump ACCEPT
  72.  
  73. #SSH
  74. iptables -A INPUT -p tcp --dport ssh --jump ACCEPT
  75.  
  76. #MySql
  77. iptables -A INPUT -p tcp --dport 3306 --jump ACCEPT
  78.  
  79. #Steam Friends Service
  80. iptables -A INPUT -p udp --dport 1200 --jump ACCEPT
  81.  
  82. #Steam Main UDP
  83. iptables -A INPUT -p udp --dport 27000 --jump ACCEPT
  84.  
  85. #Steam Main TCP
  86. iptables -A INPUT -p tcp --dport 27020 --jump ACCEPT
  87. iptables -A INPUT -p tcp --dport 27039 --jump ACCEPT
  88.  
  89. #Steam Dedicated Server HLTV
  90. iptables -A INPUT -p udp --dport 27020 --jump ACCEPT
  91.  
  92. #your server info go's here
  93. iptables -A INPUT -p udp -d server-IP --dport server-port
  94.  
  95. #allow rcon to thoes servers
  96. iptables -A INPUT -p tcp -d server-ip --dport server-port --jump ACCEPT
  97.  
  98. #now to drop all other traffic :)
  99. iptables -A INPUT -p tcp --dport 1:1023 --jump DROP
  100. iptables -A INPUT -p udp --dport 1:1023 --jump DROP
  101.  
  102. # Creation channel rejection flood udp 28
  103. iptables -N REJECT_FLOOD28
  104. iptables -A REJECT_FLOOD28 -j LOG --log-prefix 'IPTABLES-FLOOD LENGTH 28: ' --log-level info
  105. iptables -A REJECT_FLOOD28 -j DROP
  106.  
  107. # Creation channel rejection flood udp 46
  108. iptables -N REJECT_FLOOD46
  109. iptables -A REJECT_FLOOD46 -j LOG --log-prefix 'IPTABLES-FLOOD LENGTH 46: ' --log-level info
  110. iptables -A REJECT_FLOOD46 -j DROP
  111.  
  112. iptables -A INPUT -i eth0 -p udp --dport your_port -m length --length 28 -j REJECT_FLOOD28
  113.  
  114. iptables -A INPUT -i eth0 -p udp --dport your_port -m length --length 46 -j REJECT_FLOOD46
  115.  
  116. -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 27000:27015 -j ACCEPT
  117. -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 27000:27015 -j ACCEPT
  118.  
  119.  
  120. *filter
  121. :FORWARD ACCEPT [0:0]
  122. :INPUT DROP [0:0]
  123. :OUTPUT ACCEPT [0:0]
  124. -A INPUT -p tcp -m tcp -d ***.***.***.*** --dport 10000 -j ACCEPT
  125. -A INPUT -p tcp -m tcp -d ***.***.***.*** --dport 8443 -j ACCEPT
  126. -A INPUT -p tcp -m tcp --dport 21:22 -j ACCEPT
  127. -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
  128. -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
  129. -A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
  130. -A INPUT -p tcp -m tcp --dport 8009 -j ACCEPT
  131. -A INPUT -p tcp -m tcp -m multiport -j ACCEPT --dports 27070,27085,27100,27115
  132. -A INPUT -p udp -m udp -m multiport -j ACCEPT --dports 27070,27085,27100,27115
  133. -A INPUT -p udp -m udp --dport 27020:27022 -j ACCEPT
  134. -A INPUT -p udp -m udp --dport 26901:27009 -j ACCEPT
  135. -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
  136. -A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
  137. -A INPUT -p udp -m udp -d ***.***.***.*** --dport 10000 -j ACCEPT
  138. -A INPUT -p tcp -m tcp --dport 106 -j ACCEPT
  139. -A INPUT -p tcp -m tcp --dport 27030:27039 --sport 27030:27039 -j ACCEPT
  140. -A INPUT -p udp -m udp --dport 27000:27020 -j ACCEPT
  141. -A INPUT -p udp -m udp --dport 1200 -j ACCEPT
  142. -A OUTPUT -j ACCEPT
  143. -A OUTPUT -p tcp -m tcp --dport 27020:27050 --sport 27020:27050 -j ACCEPT
RAW Paste Data
Top