Saltstack Official IPTables Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.rst 2.2KB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ================
  2. iptables formula
  3. ================
  4. Iptables is used to set up, maintain, and inspect the tables of IPv4 packet
  5. filter rules in the Linux kernel. Several different tables may be defined.
  6. Each table contains a number of built-in chains and may also contain
  7. user-defined chains. Each chain is a list of rules which can match a set of
  8. packets. Each rule specifies what to do with a packet that matches. This is
  9. called a `target`, which may be a jump to a user-defined chain in the same
  10. table.
  11. Sample pillars
  12. ==============
  13. Most common rules - allow traffic on localhost, accept related,established and
  14. ping
  15. .. code-block:: yaml
  16. parametetrs:
  17. iptables:
  18. service:
  19. chain:
  20. INPUT:
  21. rules:
  22. - in_interface: lo
  23. jump: ACCEPT
  24. - connection_state: RELATED,ESTABLISHED
  25. match: state
  26. jump: ACCEPT
  27. - protocol: icmp
  28. jump: ACCEPT
  29. Accept connections on port 22
  30. .. code-block:: yaml
  31. parametetrs:
  32. iptables:
  33. service:
  34. chain:
  35. INPUT:
  36. rules:
  37. - destination_port: 22
  38. protocol: tcp
  39. jump: ACCEPT
  40. Set drop policy on INPUT chain:
  41. .. code-block:: yaml
  42. parametetrs:
  43. iptables:
  44. service:
  45. chain:
  46. INPUT:
  47. policy: DROP
  48. Redirect privileged port 443 to 8081
  49. .. code-block:: yaml
  50. parameters:
  51. iptables:
  52. service:
  53. chain:
  54. PREROUTING:
  55. filter: nat
  56. destination_port: 443
  57. to_port: 8081
  58. protocol: tcp
  59. jump: REDIRECT
  60. Allow access from local network
  61. .. code-block:: yaml
  62. parameters:
  63. iptables:
  64. service:
  65. chain:
  66. INPUT:
  67. rules:
  68. - protocol: tcp
  69. destination_port: 22
  70. source_network: 192.168.1.0/24
  71. jump: ACCEPT
  72. Read more
  73. =========
  74. * http://docs.saltstack.com/en/latest/ref/states/all/salt.states.iptables.html
  75. * https://help.ubuntu.com/community/IptablesHowTo
  76. * http://wiki.centos.org/HowTos/Network/IPTables