qvm-firewall.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. .. program:: qvm-firewall
  2. :program:`qvm-firewall` -- Manage VM outbound firewall
  3. ======================================================
  4. Synopsis
  5. --------
  6. :command:`qvm-firewall` [-h] [--verbose] [--quiet] [--reload] *VMNAME* add *RULE*
  7. :command:`qvm-firewall` [-h] [--verbose] [--quiet] [--reload] *VMNAME* del [--rule-no=*RULE_NUMBER*] [*RULE*]
  8. :command:`qvm-firewall` [-h] [--verbose] [--quiet] [--reload] *VMNAME* list [--raw]
  9. :command:`qvm-firewall` [-h] [--verbose] [--quiet] [--reload] *VMNAME* policy {accept,drop}
  10. Options
  11. -------
  12. .. option:: --help, -h
  13. show help message and exit
  14. .. option:: --verbose, -v
  15. increase verbosity
  16. .. option:: --quiet, -q
  17. decrease verbosity
  18. .. option:: --reload, -r
  19. force reload of rules even when unchanged
  20. .. option:: --raw
  21. in combination with :option:`--list`, print raw rules
  22. Actions description
  23. -------------------
  24. Available actions:
  25. * add - add specified rule. See `Rule syntax` section below.
  26. * del - delete specified rule. The rule to remove can be selected either by rule number using :option:`--rule-no`
  27. or by specifying the rule itself using the same syntax used for adding it.
  28. * list - list all the rules for a given VM.
  29. * policy - set default action if no rule matches.
  30. Rule syntax
  31. -----------
  32. A single rule is built from:
  33. - action - either ``drop`` or ``accept``
  34. - zero or more matches
  35. Selected action is applied to packets when all specified matches match,
  36. further rules are not evaluated. If none of the rules match, the default action
  37. (``policy``) is applied.
  38. Supported matches:
  39. - ``dsthost`` - destination host or network. Can be either IP address in CIDR
  40. notation, or a host name. Both IPv4 and IPv6 are supported by the rule syntax.
  41. In order to allow reuse of ``--raw`` output, ``dst4`` and ``dst6`` are accepted
  42. as synonyms.
  43. - ``dst4`` - see ``dsthost``
  44. - ``dst6`` - see ``dsthost``
  45. - ``proto`` - specific IP protocol. Supported values: ``tcp``, ``udp``,
  46. ``icmp``.
  47. - ``dstports`` - destination port or ports range. Can be either a single port
  48. or a range separated by ``-``. Valid only together with ``proto=udp`` or
  49. ``proto=tcp``.
  50. - ``icmptype`` - ICMP message type, specified as numeric value. Valid only
  51. together with ``proto=icmp``.
  52. - ``specialtarget`` - predefined target. Currently the only supported value is
  53. ``dns``. This can be combined with other matches to narrow it down.
  54. - ``expire`` - the rule matches only until the specified time and is then
  55. automatically removed. The time can be given either as number of seconds
  56. since 1/1/1970 or as ``+seconds``, a relative time (``+300`` means 5
  57. minutes from now).
  58. Authors
  59. -------
  60. | Joanna Rutkowska <joanna at invisiblethingslab dot com>
  61. | Rafal Wojtczuk <rafal at invisiblethingslab dot com>
  62. | Marek Marczykowski <marmarek at invisiblethingslab dot com>
  63. | Wojtek Porczyk <woju at invisiblethingslab dot com>
  64. .. vim: ts=3 sw=3 et tw=80