So definieren Sie die ip6tables-Regel in Ansible richtig

So definieren Sie die ip6tables-Regel in Ansible richtig

Auf dem aktuellen System habe ich diese Regel für ip6tables

-A INPUT -d <ip6address> -p udp -m udp --dport <port> -m state --state NEW -j ACCEPT

Für das neue System habe ich ein Ansible-Playbook geschrieben:

- name: Allow someport for ipv6
  ansible.builtin.iptables:
    chain: INPUT
    protocol: udp
    match: udp
    ip_version: ipv6
    ctstate: NEW
    destination_port: 'port'
    destination: 'ip6address'
    jump: ACCEPT
  tags:
    - iptables6

Aber wenn ich versuche, dies abzuspielen, erhalte ich eine Fehlermeldung:

{... "stderr_lines": ["ip6tables v1.8.7 (nf_tables): unknown option \"--destination-port\"", "Try `ip6tables -h' or 'ip6tables --help' for more information."], "stdout": "", "stdout_lines": []}
  • Ansible 2.10.8
  • Debian 11

Wie definiert man diese Regel richtig?

verwandte Informationen