Merge pull request 'Removed data not related to WireGuard' (#7) from fix/wireguard into main

Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
2026-10-25 21:10:04 +03:00
10 changed files with 9 additions and 184 deletions
+8 -33
View File
@@ -2,50 +2,25 @@
wireguard_port: 51820
wireguard_interface: wg0
wireguard_address: 100.222.11.1
wireguard_network: 100.222.11.0/24
wireguard_dns: 100.222.11.1
wireguard_remote_address: 95.165.172.12
wireguard_address: 10.0.0.1 # <-- wireguard address in wireguard network
wireguard_network: 10.0.0.0/24 # <-- wireguard subnet
wireguard_dns: 1.1.1.1 # <-- dns server
wireguard_remote_address: 192.168.0.1 # <-- public ip address
wireguard_config_dir: /etc/wireguard
wireguard_client_config_dir: /opt/wireguard-clients
wireguard_clients:
- name: apache2
address: 100.222.11.2
allowed_ips: 100.222.11.0/24
- name: laptop
address: 100.222.11.3
allowed_ips: 100.222.11.0/24
- name: phone_poco-x5-pro-5g
address: 100.222.11.4
allowed_ips: 100.222.11.0/24
subdomains:
- ai
- pve
- dockge
- kuma
- lidarr
- sonarr
- radarr
- truenas
- qbittorrent
- mirror
- suwayomi
#wireguard_clients:
# - name: apache2
# address: 100.222.11.2
# allowed_ips: 100.222.11.0/24
default_packages:
- qemu-guest-agent
- vim
- git
- curl
- wget
- qrencode
- tcpdump
- iperf3
- bind9
- bind9-dnsutils
- bind9-utils
wireguard_packages:
- wireguard
-10
View File
@@ -4,13 +4,3 @@
ansible.builtin.systemd:
name: "wg-quick@{{ wireguard_interface }}"
state: restarted
- name: "restart nftables"
ansible.builtin.systemd:
name: "nftables"
state: restarted
- name: "restart bind9"
ansible.builtin.systemd:
name: "bind9"
state: restarted
@@ -1,20 +0,0 @@
---
- name: "Import named.conf.local"
tags: bind9
ansible.builtin.template:
src: named.conf.local.j2
dest: /etc/bind/named.conf.local
owner: root
group: bind
mode: '0644'
- name: "Import data base domain serti.fun"
tags: bind9
ansible.builtin.template:
src: db.serti.fun.j2
dest: /etc/bind/db.serti.fun
owner: root
group: bind
mode: '0644'
notify: "restart bind9"
@@ -6,12 +6,3 @@
value: 1
state: present
reload: yes
- name: "Upload nftable"
ansible.builtin.template:
src: nftables.conf.j2
dest: /etc/nftables.conf
owner: root
group: root
mode: '0644'
notify: "restart nftables"
@@ -1,13 +1,5 @@
---
- name: "Change repos"
ansible.builtin.template:
src: mirror-yandex.ru.j2
dest: /etc/apt/sources.list
owner: root
group: root
mode: '0744'
- name: "Install packages"
ansible.builtin.apt:
name: "{{ default_packages + wireguard_packages }}"
-16
View File
@@ -30,24 +30,8 @@
mode: '0600'
notify: "restart wireguard"
- name: "Configure bind9"
tags: bind9
ansible.builtin.include_tasks: configure_bind9.yml
- name: "Enable and start nftables"
ansible.builtin.systemd:
name: "nftables"
state: started
enabled: yes
- name: "Enable and start wireguard"
ansible.builtin.systemd:
name: "wg-quick@{{ wireguard_interface }}"
state: started
enabled: yes
- name: "Enable and start bind9"
ansible.builtin.systemd:
name: "bind9"
state: started
enabled: yes
@@ -1,22 +0,0 @@
$TTL 3600
@ IN SOA wireguard.serti.fun. admin.serti.fun. (
1 ; serial
3600 ; refresh
1800 ; retry
604800 ; expire
3600 ; minimum
)
; Name servers
@ IN NS wireguard.serti.fun.
; A records
wireguard IN A {{ wireguard_address }}
@ IN A {{ wireguard_remote_address }}
{% set apache2 = wireguard_clients | selectattr('name', 'equalto', 'apache2') | first %}
{% for sub in subdomains %}
{{ sub }} IN A {{ apache2.address }}
{% endfor %}
* IN A {{ wireguard_remote_address }}
@@ -1,8 +0,0 @@
deb http://mirror.yandex.ru/debian/ trixie main non-free-firmware
#deb-src http://mirror.yandex.ru/debian/ trixie main non-free-firmware
deb http://mirror.yandex.ru/debian-security trixie-security main non-free-firmware
#deb-src http://mirror.yandex.ru/debian-security trixie-security main non-free-firmware
deb http://mirror.yandex.ru/debian/ trixie-updates main non-free-firmware
#deb-src http://mirror.yandex.ru/debian/ trixie-updates main non-free-firmware
@@ -1,10 +0,0 @@
zone "serti.fun" {
type primary;
file "/etc/bind/db.serti.fun";
allow-transfer { none; };
allow-update { none; };
allow-query {
127.0.0.1;
{{ wireguard_network }};
};
};
@@ -1,47 +0,0 @@
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
set home_net {
type ipv4_addr
flags interval
comment "Home subnet"
elements = {100.222.5.0/24}
}
set iot_net {
type ipv4_addr
flags interval
comment "iOT subnet"
elements = {100.222.6.0/24}
}
set vpn_net {
type ipv4_addr
flags interval
comment "iOT subnet"
elements = {100.222.11.0/24}
}
chain input {
type filter hook input priority filter; policy drop;
iif lo accept comment "Accept any localhost trafic"
ct state invalid drop comment "Drop invalid connection"
fib daddr . iif type != {local, broadcast, multicast} drop
ct state { established, related } accept
#meta l4proto { icmp, ipv6-icmp } accept comment "Accept ICMP"
tcp dport 22 accept comment "Allow ssh connection from home subnet"
ip saddr @vpn_net tcp dport 53 accept comment "Allow ssh connection from home subnet"
ip saddr @vpn_net udp dport 53 accept comment "Allow ssh connection from home subnet"
udp dport {{ wireguard_port }} accept comment "Wireguard port"
}
chain forward {
type filter hook forward priority filter;
}
chain output {
type filter hook output priority filter;
}
}