You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.2 KiB
Plaintext

#!/bin/bash
3 years ago
ip -6 link add vx{{ item.name }} type vxlan id {{ item.vxlan_id }} dstport 8472 local {{ item.wireguard_mesh_address }} dev wg{{ item.name }}
ip link set mtu 1280 dev vx{{ item.name }}
ip link set address {{ item.wireguard_mesh_mac }} dev vx{{ item.name }}
ip link set up dev vx{{ item.name }}
batctl meshif bat{{ item.name }} if add vx{{ item.name }}
{% for host in groups['fastd'] %}
{% for site in hostvars[host]['sites'] if site.name == item.name and site.wireguard_mesh_number != item.wireguard_mesh_number %}
3 years ago
bridge fdb append 00:00:00:00:00:00 dev vx{{ item.name }} dst {{ site.wireguard_mesh_address }}
{% endfor %}
{% endfor %}
3 years ago
{% if item.net4 is defined %}
batctl meshif bat{{ item.name }} gw server 1000000/1000000
batctl meshif bat{{ item.name }} it 10000
batctl meshif bat{{ item.name }} mm 1
batctl meshif bat{{ item.name }} hop_penalty 64
netctl start bat{{ item.name }}
systemctl restart dhcpd4.service
systemctl restart named.service
3 years ago
{% else %}
batctl meshif bat{{ item.name }} gw client
batctl meshif bat{{ item.name }} it 10000
batctl meshif bat{{ item.name }} mm 1
batctl meshif bat{{ item.name }} hop_penalty 64
netctl start bat{{ item.name }}
{% endif %}