summaryrefslogtreecommitdiffstats
path: root/roles/wireguard_gateway
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-09-01 02:16:40 +0200
committerAhmed Abdelhalim <[email protected]>2025-09-01 02:16:40 +0200
commit16dce63ea4027390b152e7064b8b4e6bf1a18518 (patch)
tree08246637935a9711c5738cd6c064765651db422c /roles/wireguard_gateway
parentd19d82e68c05d3a62b68175fbc774681426c675a (diff)
Fix wireguard_gateway role being slow
The pihole lookup DNS queries when the VPN connection is up was slow. One of the culprits was the quad9 servers were taking long time when using VPN The other issue was the previous routing tables that used to work with the fritzbox (with DHCP) which wasn't fully working was conflicting with the VPN route tables and causing loops and delays. Now most of the VPN queries are working fast but some requests are taking some time, probably due to the VPN trying to check/block ads and malware! Also minor fixing to the pre tasks and documentation
Diffstat (limited to 'roles/wireguard_gateway')
-rw-r--r--roles/wireguard_gateway/tasks/main.yml23
1 files changed, 0 insertions, 23 deletions
diff --git a/roles/wireguard_gateway/tasks/main.yml b/roles/wireguard_gateway/tasks/main.yml
index 2b82ff66..a4fb43d8 100644
--- a/roles/wireguard_gateway/tasks/main.yml
+++ b/roles/wireguard_gateway/tasks/main.yml
@@ -20,29 +20,6 @@
net.ipv6.conf.all.forwarding=1
notify: "Reload sysctl"
-- name: "Configure VPN gateway routing"
- become: true
- ansible.builtin.shell: |
- {% if wireguard_gateway_enabled %}
- # Add routes to custom table
- ip route add default dev {{ wireguard_autostart_connection }} table 100 || true
- ip -6 route add default dev {{ wireguard_autostart_connection }} table 100 || true
- # Remove any incorrect policy routing rules first
- ip -6 rule del iif {{ ansible_default_ipv6.interface }} table 100 || true
- # Add correct policy routing rules
- ip rule add iif {{ ansible_default_ipv4.interface }} table 100 priority 200 || true
- ip -6 rule add iif {{ ansible_default_ipv4.interface }} table 100 priority 200 || true
- {% else %}
- # Remove policy routing rules
- ip rule del iif {{ ansible_default_ipv4.interface }} table 100 || true
- ip -6 rule del iif {{ ansible_default_ipv4.interface }} table 100 || true
- # Remove routes from custom table
- ip route del default dev {{ wireguard_autostart_connection }} table 100 || true
- ip -6 route del default dev {{ wireguard_autostart_connection }} table 100 || true
- {% endif %}
- failed_when: false
- changed_when: false
-
# IPv4 iptables rules
- name: "Add IPv4 NAT masquerading for traffic through VPN"
become: true