Mullvad - wireguard - install/configure

This commit is contained in:
unman 2022-08-08 00:02:20 +00:00
parent f194056115
commit 5497693e26
No known key found for this signature in database
GPG Key ID: FDD1B8244731B36C
5 changed files with 86 additions and 0 deletions

37
mullvad/configure.sls Normal file
View File

@ -0,0 +1,37 @@
/rw/config/rc.local:
file.append:
- text: wg-quick up /rw/config/wireguard.conf
/rw/config/qubes-firewall-user-script:
file.append:
- text:
- nft insert rule filter FORWARD tcp flags syn tcp option maxseg size set rt mtu
- nft insert rule filter FORWARD oifname eth0 drop
- nft insert rule filter FORWARD iifname eth0 drop
/rw/config/network-hooks.d/flush.sh:
file.managed:
- source:
- salt://mullvad/flush.sh
- user: root
- group: root
- makedirs: True
- mode: 755
/rw/config/network-hooks.d/flush:
file.managed:
- source:
- salt://mullvad/flush
- user: root
- group: root
- makedirs: True
- mode: 755
/home/user/install.sh:
file.managed:
- source:
- salt://mullvad/install.sh
- user: root
- mode: '0755'
- replace: True

5
mullvad/flush Normal file
View File

@ -0,0 +1,5 @@
#!/usr/sbin/nft -f
define vpndns1 = 10.64.0.1
flush chain nat PR-QBS
insert rule nat PR-QBS tcp dport 53 dnat to $vpndns1
insert rule nat PR-QBS udp dport 53 dnat to $vpndns1

2
mullvad/flush.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
nft -f /rw/config/network-hooks.d/flush

37
mullvad/install.sls Normal file
View File

@ -0,0 +1,37 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
#
#
#
{% if grains['nodename'] != 'dom0' %}
{% if salt['qvm.exists']('cacher') %}
/etc/apt/sources.list:
file.replace:
- names:
- /etc/apt/sources.list
- /etc/apt/sources.list.d/qubes-r4.list
- pattern: 'https:'
- repl: 'http://HTTPS/'
- flags: [ 'IGNORECASE', 'MULTILINE' ]
{% endif %}
mullvad:
pkg.uptodate:
- refresh: True
installed:
pkg.installed:
- pkgs:
- qubes-core-agent-networking
- qubes-core-agent-passwordless-root
- iproute2
- libnotify-bin
- mate-notification-daemon
- resolvconf
- unzip
- wireguard
- wireguard-tools
- zenity
{% endif %}

5
mullvad/install.top Normal file
View File

@ -0,0 +1,5 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
base:
'*':
- mullvad.install