Role network-routing: use same ip rules for table mwu on all hosts

This commit is contained in:
Julian Labus 2019-01-16 18:41:04 +01:00
parent 2880d72c00
commit bc3af84cf8
No known key found for this signature in database
GPG key ID: 8AF209F2C6B3572A
2 changed files with 2 additions and 22 deletions

View file

@ -3,7 +3,6 @@
# {{ ansible_managed }}
#
{% if ffmwu_server_type == 'gateway' %}
# Priority 7 - lookup rt_table mwu for all incoming traffic of freifunk related interfaces
{% for mesh in meshes %}
ip -4 rule add from {{ mesh.ipv4_network | ipaddr('network') }}/16 lookup mwu priority 7
@ -20,6 +19,7 @@ ip -6 rule add to {{ public }} lookup mwu priority 7
ip -6 rule add from all oif {{ mesh.id }}br lookup mwu priority 7
{% endfor %}
{% if ffmwu_server_type == 'gateway' %}
# Priority 23 - lookup rt_table icvpn for all incoming traffic of freifunk bridges
{% for mesh in meshes %}
ip -4 rule add from {{ mesh.ipv4_network | ipaddr('network') }}/16 lookup icvpn priority 23
@ -79,16 +79,6 @@ ip -4 rule add from all lookup mwu priority 107
ip -4 rule add from all lookup icvpn priority 107
ip -6 rule add from all lookup mwu priority 107
ip -6 rule add from all lookup icvpn priority 107
{% else %}
# Priority 7 - lookup rt_table mwu for all incoming traffic of freifunk related interfaces
{% for mesh in meshes %}
ip -4 rule add from all iif {{ mesh.id }}br lookup mwu priority 7
ip -4 rule add from {{ mesh.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('ip/prefix') }}/32 lookup mwu priority 7
{% for ula in mesh.ipv6_ula %}
ip -6 rule add from all iif {{ mesh.id }}br lookup mwu priority 7
ip -6 rule add from {{ ula | ipaddr('net') | ipsubnet(64, 0) | ipaddr(magic) | ipaddr('ip/prefix') }}/128 lookup mwu priority 7
{% endfor %}
{% endfor %}
{% endif %}
exit 0

View file

@ -3,7 +3,6 @@
# {{ ansible_managed }}
#
{% if ffmwu_server_type == 'gateway' %}
# Priority 7 - lookup rt_table mwu for all incoming traffic of freifunk related interfaces
{% for mesh in meshes %}
ip -4 rule del from {{ mesh.ipv4_network | ipaddr('network') }}/16 lookup mwu priority 7
@ -20,6 +19,7 @@ ip -6 rule del to {{ public }} lookup mwu priority 7
ip -6 rule del from all oif {{ mesh.id }}br lookup mwu priority 7
{% endfor %}
{% if ffmwu_server_type == 'gateway' %}
# Priority 23 - lookup rt_table icvpn for all incoming traffic of freifunk bridges
{% for mesh in meshes %}
ip -4 rule del from {{ mesh.ipv4_network | ipaddr('network') }}/16 lookup icvpn priority 23
@ -79,16 +79,6 @@ ip -4 rule del from all lookup mwu priority 107
ip -4 rule del from all lookup icvpn priority 107
ip -6 rule del from all lookup mwu priority 107
ip -6 rule del from all lookup icvpn priority 107
{% else %}
# Priority 7 - lookup rt_table mwu for all incoming traffic of freifunk related interfaces
{% for mesh in meshes %}
ip -4 rule del from all iif {{ mesh.id }}br lookup mwu priority 7
ip -4 rule del from {{ mesh.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('ip/prefix') }}/32 lookup mwu priority 7
{% for ula in mesh.ipv6_ula %}
ip -6 rule del from all iif {{ mesh.id }}br lookup mwu priority 7
ip -6 rule del from {{ ula | ipaddr('net') | ipsubnet(64, 0) | ipaddr(magic) | ipaddr('ip/prefix') }}/128 lookup mwu priority 7
{% endfor %}
{% endfor %}
{% endif %}
exit 0