8748_VPN_Conntrack #81
|
@ -24,6 +24,13 @@ mangle_block: |
|
||||||
-A PREROUTING -p tcp -m policy --dir in --pol ipsec -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1361:1536 -j TCPMSS --set-mss 1360
|
-A PREROUTING -p tcp -m policy --dir in --pol ipsec -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1361:1536 -j TCPMSS --set-mss 1360
|
||||||
-A POSTROUTING -p tcp -m policy --dir out --pol ipsec -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1361:1536 -j TCPMSS --set-mss 1360
|
-A POSTROUTING -p tcp -m policy --dir out --pol ipsec -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1361:1536 -j TCPMSS --set-mss 1360
|
||||||
COMMIT
|
COMMIT
|
||||||
|
*filter
|
||||||
|
:INPUT ACCEPT [0:0]
|
||||||
|
:FORWARD ACCEPT [0:0]
|
||||||
|
:OUTPUT ACCEPT [0:0]
|
||||||
|
-A FORWARD -m conntrack --ctstate NEW,RELATED,ESTABLISHED -j ACCEPT
|
||||||
|
-A FORWARD -m conntrack --ctstate INVALID -j LOG --log-prefix "CT INVALID: "
|
||||||
|
COMMIT
|
||||||
config_and_logrotate:
|
config_and_logrotate:
|
||||||
- { src: vn.conf, dest: '/etc/strongswan.d/vn.conf' }
|
- { src: vn.conf, dest: '/etc/strongswan.d/vn.conf' }
|
||||||
- { src: charon, dest: '/etc/logrotate.d/charon' }
|
- { src: charon, dest: '/etc/logrotate.d/charon' }
|
||||||
|
|
|
@ -18,12 +18,12 @@ bind_config_templates:
|
||||||
- { src: 'dhcp.key', dest: '/etc/bind/keys/dhcp.key', mode: 'u=rw,g=r,o=' }
|
- { src: 'dhcp.key', dest: '/etc/bind/keys/dhcp.key', mode: 'u=rw,g=r,o=' }
|
||||||
- { src: 'isp1.ns', dest: '/root/scripts/switch-isp', mode: 'u=rw,g=rw,o=r' }
|
- { src: 'isp1.ns', dest: '/root/scripts/switch-isp', mode: 'u=rw,g=rw,o=r' }
|
||||||
- { src: 'isp2.ns', dest: '/root/scripts/switch-isp', mode: 'u=rw,g=rw,o=r' }
|
- { src: 'isp2.ns', dest: '/root/scripts/switch-isp', mode: 'u=rw,g=rw,o=r' }
|
||||||
|
- { src: 'delete.ns', dest: '/root/scripts/switch-isp', mode: 'u=rw,g=rw,o=r' }
|
||||||
directory:
|
directory:
|
||||||
- { path: '/root/scripts', owner: 'root', group: 'root', mode: 'u=rwx,g=rx,o=rx' }
|
- { path: '/root/scripts', owner: 'root', group: 'root', mode: 'u=rwx,g=rx,o=rx' }
|
||||||
- { path: '/etc/bind/keys', owner: 'root', group: 'bind', mode: 'u=rwx,g=rxs,o=rx' }
|
- { path: '/etc/bind/keys', owner: 'root', group: 'bind', mode: 'u=rwx,g=rxs,o=rx' }
|
||||||
- { path: '/root/scripts/switch-isp', owner: 'root', group: 'bind', mode: 'u=rwx,g=rxs,o=rx' }
|
- { path: '/root/scripts/switch-isp', owner: 'root', group: 'bind', mode: 'u=rwx,g=rxs,o=rx' }
|
||||||
required_files:
|
required_files:
|
||||||
- { src: 'delete.ns', dest: '/root/scripts/switch-isp', owner: 'root', group: 'bind', mode: 'u=rw,g=rw,o=r' }
|
|
||||||
- { src: 'switch-isp.sh', dest: '/root/scripts', owner: 'root', group: 'root', mode: 'u=rwx,g=rx,o=rx' }
|
- { src: 'switch-isp.sh', dest: '/root/scripts', owner: 'root', group: 'root', mode: 'u=rwx,g=rx,o=rx' }
|
||||||
- { src: 'sync-conf', dest: '/root/scripts', owner: 'root', group: 'root', mode: 'u=rwx,g=rx,o=rx' }
|
- { src: 'sync-conf', dest: '/root/scripts', owner: 'root', group: 'root', mode: 'u=rwx,g=rx,o=rx' }
|
||||||
- { src: 'gen-key.sh', dest: '/root/scripts', owner: 'root', group: 'bind', mode: 'u=rwx,g=rx,o=rx' }
|
- { src: 'gen-key.sh', dest: '/root/scripts', owner: 'root', group: 'bind', mode: 'u=rwx,g=rx,o=rx' }
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
update delete verdnatura.es A
|
|
||||||
update delete kube-proxy.verdnatura.es A
|
|
||||||
update delete smtp.verdnatura.es A
|
|
||||||
update delete imap.verdnatura.es A
|
|
||||||
update delete autodiscover.verdnatura.es A
|
|
||||||
update delete time1.verdnatura.es A
|
|
||||||
update delete time2.verdnatura.es A
|
|
||||||
update delete dc-ip01.verdnatura.es A
|
|
||||||
update delete dc-ip02.verdnatura.es A
|
|
||||||
update delete dc-ip03.verdnatura.es A
|
|
||||||
update delete dc-ip04.verdnatura.es A
|
|
||||||
update delete mailgw1.verdnatura.es A
|
|
||||||
update delete mailgw2.verdnatura.es A
|
|
||||||
send
|
|
|
@ -6,6 +6,13 @@
|
||||||
name: "{{ bind_packages }}"
|
name: "{{ bind_packages }}"
|
||||||
state: present
|
state: present
|
||||||
install_recommends: no
|
install_recommends: no
|
||||||
|
- name: Ensure BIND9 starts with IPv4 only (-4)
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/default/named
|
||||||
|
regexp: '^OPTIONS='
|
||||||
|
line: 'OPTIONS="-u bind -4"'
|
||||||
|
backrefs: yes
|
||||||
|
notify: restart-dns
|
||||||
- name: Create directory
|
- name: Create directory
|
||||||
file:
|
file:
|
||||||
path: "{{ item.path }}"
|
path: "{{ item.path }}"
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
{% for record in dns_records_delete %}
|
||||||
|
update delete {{ record.name.ljust(30) }} A
|
||||||
|
{% endfor %}
|
||||||
|
send
|
|
@ -15,17 +15,23 @@ options {
|
||||||
};
|
};
|
||||||
|
|
||||||
view "lan" {
|
view "lan" {
|
||||||
match-clients {
|
match-clients {
|
||||||
{% for item in key_match_clients_lan_master if item.startswith("!key") %}
|
{% for item in key_match_clients_lan_master if item.startswith("!key") %}
|
||||||
{{ item }};
|
{{ item }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for item in acl_match_clients %}
|
{% for item in acl_match_clients %}
|
||||||
{{ item }};
|
{{ item }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for item in key_match_clients_lan_master if not item.startswith("!key") %}
|
{% for item in key_match_clients_lan_master if not item.startswith("!key") %}
|
||||||
{{ item }};
|
{{ item }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin query "filter-aaaa.so" {
|
||||||
|
filter-aaaa-on-v4 yes;
|
||||||
|
filter-aaaa-on-v6 yes;
|
||||||
|
filter-aaaa { any; };
|
||||||
|
};
|
||||||
|
|
||||||
recursion yes;
|
recursion yes;
|
||||||
allow-recursion { any; };
|
allow-recursion { any; };
|
||||||
|
@ -34,14 +40,14 @@ view "lan" {
|
||||||
|
|
||||||
include "/etc/bind/named.conf.default-zones";
|
include "/etc/bind/named.conf.default-zones";
|
||||||
|
|
||||||
{% for zone in bind_zones.lan %}
|
{% for zone in bind_zones.lan %}
|
||||||
zone "{{ zone.name }}" {
|
zone "{{ zone.name }}" {
|
||||||
type master;
|
type master;
|
||||||
forwarders {};
|
forwarders {};
|
||||||
allow-update { key {{ zone.key }}; };
|
allow-update { key {{ zone.key }}; };
|
||||||
file "{{ zone.file }}";
|
file "{{ zone.file }}";
|
||||||
};
|
};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
};
|
};
|
||||||
|
|
||||||
view "wan" {
|
view "wan" {
|
||||||
|
@ -54,25 +60,26 @@ view "wan" {
|
||||||
notify explicit;
|
notify explicit;
|
||||||
|
|
||||||
also-notify {
|
also-notify {
|
||||||
{% for entry in bind_also_notify %}
|
{% for entry in bind_also_notify %}
|
||||||
{{ entry.ip }} key {{ entry.key }};
|
{{ entry.ip }} key {{ entry.key }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
};
|
};
|
||||||
|
|
||||||
{% for zone in bind_zones.wan %}
|
{% for zone in bind_zones.wan %}
|
||||||
{% if zone.in_view is defined %}
|
{% if zone.in_view is defined %}
|
||||||
{% for z in zone.in_view %}
|
{% for z in zone.in_view %}
|
||||||
zone "{{ z }}" {
|
zone "{{ z }}" {
|
||||||
in-view "lan";
|
in-view "lan";
|
||||||
};
|
};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
zone "{{ zone.name }}" {
|
zone "{{ zone.name }}" {
|
||||||
type master;
|
type master;
|
||||||
forwarders {};
|
forwarders {};
|
||||||
allow-update { key {{ zone.key }}; };
|
allow-update { key {{ zone.key }}; };
|
||||||
file "{{ zone.file }}";
|
file "{{ zone.file }}";
|
||||||
};
|
};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,22 @@ masters master-ips {
|
||||||
|
|
||||||
view "lan" {
|
view "lan" {
|
||||||
match-clients {
|
match-clients {
|
||||||
{% for item in key_match_clients_lan_master if item.startswith("!key") %}
|
{%- for item in key_match_clients_lan_master if item.startswith("!key") -%}
|
||||||
{{ item }};
|
{{ item }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for item in acl_match_clients %}
|
{%- for item in acl_match_clients -%}
|
||||||
{{ item }};
|
{{ item }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for item in key_match_clients_lan_slave if not item.startswith("!key") %}
|
{%- for item in key_match_clients_lan_slave if not item.startswith("!key") -%}
|
||||||
{{ item }};
|
{{ item }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin query "filter-aaaa.so" {
|
||||||
|
filter-aaaa-on-v4 yes;
|
||||||
|
filter-aaaa-on-v6 yes;
|
||||||
|
filter-aaaa { any; };
|
||||||
|
};
|
||||||
recursion yes;
|
recursion yes;
|
||||||
allow-recursion { any; };
|
allow-recursion { any; };
|
||||||
empty-zones-enable yes;
|
empty-zones-enable yes;
|
||||||
|
|
Loading…
Reference in New Issue