qvm-firewall.rst 2.7 KB

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