|
|
|
#!/bin/bash
|
|
|
|
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 %}
|
|
|
|
bridge fdb append 00:00:00:00:00:00 dev vx{{ item.name }} dst {{ site.wireguard_mesh_address }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
{% 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
|
|
|
|
{% 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 %}
|