summaryrefslogtreecommitdiff
path: root/roles/configure_static_routes/templates/ffmyk-iproute-up.j2
blob: 87e63a5011ea98600e7c6cafe3d0f3b56a9d7d36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

ip -4 rule add iif bat{{ item.name }} table ffmyk priority 10
ip -6 rule add iif bat{{ item.name }} table ffmyk priority 10
{% if item.net4 is defined %}
ip -4 rule add from {{ item.net4 }} table ffmyk priority 10
{% endif %}
{% if item.net6 is defined %}
ip -6 rule add from {{ item.net6 }} table ffmyk priority 10
{% endif %}

ip -4 rule add from all iif bat{{ item.name }} type unreachable priority 200
ip -6 rule add from all iif bat{{ item.name }} type unreachable priority 200

{% if item.net4 is defined %}
ip -4 route replace {{item.net4 }} dev bat{{ item.name }} proto static table ffmyk
{% endif %}
{% if item.net6 is defined %}
ip -6 route replace {{item.net6 }} dev bat{{ item.name }} proto static table ffmyk
{% endif %}
{% if item.site_net6 is defined %}
ip -6 route replace {{item.site_net6 }} dev bat{{ item.name }} proto static table ffmyk
{% endif %}