Compare commits
No commits in common. "24fc864e63889ab9652f259d9960120065dfbdbd" and "9b03b002f78bf05feaa3794e0494824f5259edc1" have entirely different histories.
24fc864e63
...
9b03b002f7
5 changed files with 16 additions and 20 deletions
|
@ -2,6 +2,10 @@
|
||||||
command: ifup --auto
|
command: ifup --auto
|
||||||
when: "'handler' not in ansible_skip_tags"
|
when: "'handler' not in ansible_skip_tags"
|
||||||
|
|
||||||
|
- name: mkinitfs
|
||||||
|
command: mkinitfs
|
||||||
|
when: "'handler' not in ansible_skip_tags"
|
||||||
|
|
||||||
- name: reboot
|
- name: reboot
|
||||||
reboot:
|
reboot:
|
||||||
when: "'handler' not in ansible_skip_tags"
|
when: "'handler' not in ansible_skip_tags"
|
||||||
|
|
|
@ -7,6 +7,13 @@
|
||||||
name: bash,bonding,iproute2
|
name: bash,bonding,iproute2
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
|
- name: Tell mdev to rename network interfaces
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/mdev.conf
|
||||||
|
line: '-net/.* root:root 600 @/sbin/nameif -s'
|
||||||
|
insertafter: '^# net devices'
|
||||||
|
notify: mkinitfs
|
||||||
|
|
||||||
- name: Tell ifupdown to also rename network interfaces
|
- name: Tell ifupdown to also rename network interfaces
|
||||||
copy:
|
copy:
|
||||||
dest: /etc/network/if-pre-up.d/nameif
|
dest: /etc/network/if-pre-up.d/nameif
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{% set addrs = interfaces | selectattr('name', '==', 'lo') | map(attribute='ip_addresses') | first -%}
|
{% set addrs = interfaces | selectattr('name', '==', 'lo') | map(attribute='ip_addresses') | first -%}
|
||||||
|
|
||||||
|
source-directory /etc/network/interfaces.d
|
||||||
|
|
||||||
auto lo
|
auto lo
|
||||||
iface lo
|
iface lo inet loopback
|
||||||
|
address {{ wg_ip }}
|
||||||
{% for address in addrs %}
|
{% for address in addrs %}
|
||||||
address {{ address.address }}
|
address {{ address.address }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
source-directory /etc/network/interfaces.d
|
|
||||||
|
|
|
@ -146,19 +146,6 @@ table inet filter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
table inet wireguard {
|
|
||||||
chain input {
|
|
||||||
type filter hook prerouting priority raw; policy accept
|
|
||||||
udp dport 51820 notrack \
|
|
||||||
comment "Disable connection tracking for wireguard"
|
|
||||||
}
|
|
||||||
chain output {
|
|
||||||
type route hook output priority raw; policy accept
|
|
||||||
meta mark 51820 meta nfproto ipv4 ip saddr set {{ wg_ip | ipaddr('address') }} notrack \
|
|
||||||
comment "Disable connection tracking and set anycast source IP for wireguard"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
table ip nat {
|
table ip nat {
|
||||||
include "/etc/nftables.d/interfaces.nft"
|
include "/etc/nftables.d/interfaces.nft"
|
||||||
include "/etc/nftables.d/networks.nft"
|
include "/etc/nftables.d/networks.nft"
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
iface lo
|
|
||||||
address {{ wg_ip }}
|
|
||||||
|
|
||||||
auto wg
|
auto wg
|
||||||
iface wg
|
iface wg inet static
|
||||||
use wireguard
|
use wireguard
|
||||||
{% if wg_net is defined %}
|
{% if wg_net is defined %}
|
||||||
address {{ wg_net }}
|
address {{ wg_net }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue