diff options
Diffstat (limited to 'roles/install_wireguard_backbone/templates')
-rw-r--r-- | roles/install_wireguard_backbone/templates/down.sh.j2 | 8 | ||||
-rw-r--r-- | roles/install_wireguard_backbone/templates/up.sh.j2 | 14 | ||||
-rw-r--r-- | roles/install_wireguard_backbone/templates/wg.conf.j2 | 8 |
3 files changed, 15 insertions, 15 deletions
diff --git a/roles/install_wireguard_backbone/templates/down.sh.j2 b/roles/install_wireguard_backbone/templates/down.sh.j2 index fbdd387..6b78d2e 100644 --- a/roles/install_wireguard_backbone/templates/down.sh.j2 +++ b/roles/install_wireguard_backbone/templates/down.sh.j2 @@ -1,5 +1,5 @@ #!/bin/bash -ip -4 rule del iif bb{{ item.name }} table ffmyk -ip -6 rule del iif bb{{ item.name }} table ffmyk -ip link set down dev bb{{ item.name }} -ip link del bb{{ item.name }} +ip -4 rule del iif bb{{ hostvars[item]['wireguard_bb_name'] }} table ffmyk +ip -6 rule del iif bb{{ hostvars[item]['wireguard_bb_name'] }} table ffmyk +ip link set down dev bb{{ hostvars[item]['wireguard_bb_name'] }} +ip link del bb{{ hostvars[item]['wireguard_bb_name'] }} diff --git a/roles/install_wireguard_backbone/templates/up.sh.j2 b/roles/install_wireguard_backbone/templates/up.sh.j2 index 38b3c26..5af1a81 100644 --- a/roles/install_wireguard_backbone/templates/up.sh.j2 +++ b/roles/install_wireguard_backbone/templates/up.sh.j2 @@ -1,8 +1,8 @@ #!/bin/bash -ip link add bb{{ item.name }} type wireguard -wg setconf bb{{ item.name }} /etc/wireguard/wgbb{{ item.name }}.conf -ip addr add {{ item.address6 }} dev bb{{ item.name }} -ip addr add {{ wireguard_bb_ipv4 }}/32 peer {{ item.address }}/32 dev bb{{ item.name }} -ip link set up dev bb{{ item.name }} -ip -4 rule add iif bb{{ item.name }} table ffmyk priority 10 -ip -6 rule add iif bb{{ item.name }} table ffmyk priority 10 +ip link add bb{{ hostvars[item]['wireguard_bb_name'] }} type wireguard +wg setconf bb{{ hostvars[item]['wireguard_bb_name'] }} /etc/wireguard/wgbb{{ hostvars[item]['wireguard_bb_name'] }}.conf +ip addr add {{ wireguard_bb_ipv6 }} dev bb{{ hostvars[item]['wireguard_bb_name'] }} +ip addr add {{ wireguard_bb_ipv4 }}/32 peer {{ hostvars[item]['wireguard_bb_ipv4'] }}/32 dev bb{{ hostvars[item]['wireguard_bb_name'] }} +ip link set up dev bb{{ hostvars[item]['wireguard_bb_name'] }} +ip -4 rule add iif bb{{ hostvars[item]['wireguard_bb_name'] }} table ffmyk priority 10 +ip -6 rule add iif bb{{ hostvars[item]['wireguard_bb_name'] }} table ffmyk priority 10 diff --git a/roles/install_wireguard_backbone/templates/wg.conf.j2 b/roles/install_wireguard_backbone/templates/wg.conf.j2 index de0e1fb..a52655c 100644 --- a/roles/install_wireguard_backbone/templates/wg.conf.j2 +++ b/roles/install_wireguard_backbone/templates/wg.conf.j2 @@ -1,9 +1,9 @@ [Interface] -ListenPort = {{ item.local_port }} -PrivateKey = {{ wireguard_bb_key }} +ListenPort = {{ hostvars[item]['wireguard_bb_port'] }} +PrivateKey = {{ wireguard_bb_priv_key }} [Peer] -PublicKey = {{ item.key }} +PublicKey = {{ hostvars[item]['wireguard_bb_pub_key'] }} AllowedIPs = 0.0.0.0/0,::/0 -Endpoint = [{{ item.endpoint }}]:{{ item.remote_port }} +Endpoint = [{{ hostvars[item]['wireguard_bb_endpoint'] }}]:{{ wireguard_bb_port }} PersistentKeepalive = 30 |