pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin private pastebin - collaborative debugging tool What's a private pastebin?

Posted by frymaster on Thu 12th Apr 17:17
download | new post

  1. #!/bin/bash
  2. #iptables config script
  3. echo `date +%y-%m-%d--%H%M` "Running firewall rules"
  4.  
  5. IPTABLES='/sbin/iptables'
  6.  
  7.  
  8. ### start by reverting to defaults
  9.  
  10.  
  11. #Set default policy to allow all incoming and outgoing, and drop forwarding
  12. $IPTABLES -P INPUT ACCEPT
  13. $IPTABLES -P FORWARD DROP
  14. $IPTABLES -P OUTPUT ACCEPT
  15. $IPTABLES -t raw -P OUTPUT ACCEPT
  16. $IPTABLES -t raw -P PREROUTING ACCEPT
  17. $IPTABLES -t nat -P OUTPUT ACCEPT
  18. $IPTABLES -t nat -P PREROUTING ACCEPT
  19. $IPTABLES -t nat -P POSTROUTING ACCEPT
  20.  
  21. #Remove rules from all chains, and remove user-defined chains, in default and nat tables
  22. #If any other tables are used they should be added here
  23. $IPTABLES --flush
  24. $IPTABLES -t nat --flush
  25. $IPTABLES -t raw --flush
  26. $IPTABLES -X
  27. $IPTABLES -t nat -X
  28. $IPTABLES -t raw -X
  29.  
  30.  
  31.  
  32. ## THE ONLY TWO ACTUAL RULES IN THIS ENTIRE DAMN FILE
  33. $IPTABLES -t nat -A PREROUTING -d my.servers.ip -p tcp --dport alternatePortNumber -j DNAT --to-destination my.servers.ip:mumblePort
  34. $IPTABLES -t nat -A PREROUTING -d my.servers.ip -p udp --dport alternatePortNumber -j DNAT --to-destination my.servers.ip:mumblePort

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@


Remember my settings