<commit_before>#!stateconf
{% from 'states/openvpn/map.jinja' import openvpn as openvpn_map with context %}

.params:
    stateconf.set: []
# --- end of state config ---

{% for vpn in params.vpns %}
{% set chain = 'VPN_' + vpn.name|upper %}

openvpn-access-vpn-{{ vpn.name }}:
  iptables.append:
    - table: filter
    - chain: ZONE_PUBLIC
    - proto: udp
    - jump: ACCEPT
    - dport: {{ vpn.port|default(openvpn_map.default_port) }}
    - family: ipv4
    - save: True
    - match: comment
    - comment: OpenVPN {{ vpn.name }}
    - require:
      - iptables: chain_zone_public_ipv4

openvpn-chain-vpn-{{ vpn.name }}:
  iptables.chain_present:
    - name: {{ chain }}

openvpn-jump_forward_inbound_vpn_{{ vpn.name }}:
  iptables.append:
    - table: filter
    - chain: FORWARD
    - in-interface: {{ vpn.devname }}
    - jump: {{ chain }}
    - save: true
    - require:
      - iptables: openvpn-chain-vpn-{{ vpn.name }}

openvpn-jump_forward_outbound_vpn_{{ vpn.name }}:
  iptables.append:
    - table: filter
    - chain: FORWARD
    - out-interface: {{ vpn.devname }}
    - jump: {{ chain }}
    - save: true
    - require:
      - iptables: openvpn-chain-vpn-{{ vpn.name }}

openvpn-allow_forward_all_vpn_{{ vpn.name }}:
  iptables.append:
    - table: filter
    - chain: {{ chain }}
    - jump: ACCEPT
    - save: true
    - require:
      - iptables: openvpn-chain-vpn-{{ vpn.name }}
{% endfor %}<commit_msg>openvpn: Add ipv6 iptables rules for server.<commit_after>#!stateconf
{% from 'states/openvpn/map.jinja' import openvpn as openvpn_map with context %}

.params:
    stateconf.set: []
# --- end of state config ---

{% for vpn in params.vpns %}
{% for family in ['ipv4', 'ipv6'] %}
{% set chain = 'VPN_' + vpn.name|upper %}

openvpn-iptables-{{ family }}-access-vpn-{{ vpn.name }}:
  iptables.append:
    - table: filter
    - chain: ZONE_PUBLIC
    - proto: udp
    - jump: ACCEPT
    - dport: {{ vpn.port|default(openvpn_map.default_port) }}
    - family: {{ family }}
    - save: True
    - match: comment
    - comment: OpenVPN {{ vpn.name }}
    - require:
      - iptables: chain_zone_public_{{ family }}

openvpn-iptables-{{ family }}-chain-vpn-{{ vpn.name }}:
  iptables.chain_present:
    - name: {{ chain }}
    - family: {{ family }}

openvpn-iptables-{{ family }}-jump_forward_inbound_vpn_{{ vpn.name }}:
  iptables.append:
    - table: filter
    - chain: FORWARD
    - in-interface: {{ vpn.devname }}
    - jump: {{ chain }}
    - family: {{ family }}
    - save: true
    - require:
      - iptables: openvpn-iptables-{{ family }}-chain-vpn-{{ vpn.name }}

openvpn-iptables-{{ family }}-jump_forward_outbound_vpn_{{ vpn.name }}:
  iptables.append:
    - table: filter
    - chain: FORWARD
    - out-interface: {{ vpn.devname }}
    - jump: {{ chain }}
    - family: {{ family }}
    - save: true
    - require:
      - iptables: openvpn-iptables-{{ family }}-chain-vpn-{{ vpn.name }}

openvpn-iptables-{{ family }}-allow_forward_all_vpn_{{ vpn.name }}:
  iptables.append:
    - table: filter
    - chain: {{ chain }}
    - jump: ACCEPT
    - family: {{ family }}
    - save: true
    - require:
      - iptables: openvpn-iptables-{{ family }}-chain-vpn-{{ vpn.name }}
{% endfor %}
{% endfor %}
{'fraction_non_alphanumeric': 0.16929743113587126, 'fraction_numerical': 0.0015475085112968121, 'mean_word_length': 2.520697167755991, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1976465', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1209, 'n_words': 243}