Revert "Role network-routing: move interface specific routes to role network-meshbridge"

This reverts commit d3298d4a3c.
This commit is contained in:
Tobias Hachmer 2018-02-06 06:00:01 +01:00
parent e633015873
commit a947803e28
3 changed files with 30 additions and 17 deletions

View file

@ -14,20 +14,3 @@ iface {{ item.id }}br
address {{ prefix | ipaddr('net') | ipsubnet(64, 0) | ipaddr(magic) | ipaddr('ip/prefix') }} address {{ prefix | ipaddr('net') | ipsubnet(64, 0) | ipaddr(magic) | ipaddr('ip/prefix') }}
{% endfor %} {% endfor %}
bridge-ports {{ item.id }}bat bridge-ports {{ item.id }}bat
# static routes for rt_table mwu
post-up /sbin/ip -4 route add {{ item.ipv4_network }} proto static dev $IFACE table mwu
{% for ula in item.ipv6_ula %}
post-up /sbin/ip -6 route add {{ ula | ipaddr('net') | ipsubnet(64, 0) | ipaddr('subnet') }} proto static dev $IFACE table mwu
{% endfor %}
{% for public in item.ipv6_public %}
post-up /sbin/ip -6 route add {{ public | ipaddr('net') | ipsubnet(64, 0) | ipaddr('subnet') }} proto static dev $IFACE table mwu
post-up /sbin/ip -6 route add {{ public | ipaddr('net') | ipsubnet(56, magic) | ipsubnet(64, 0) | ipaddr('subnet') }} proto static dev $IFACE table mwu
{% endfor %}
pre-down /sbin/ip -4 route del {{ item.ipv4_network }} proto static dev $IFACE table mwu
{% for ula in item.ipv6_ula %}
pre-down /sbin/ip -6 route del {{ ula | ipaddr('net') | ipsubnet(64, 0) | ipaddr('subnet') }} proto static dev $IFACE table mwu
{% endfor %}
{% for public in item.ipv6_public %}
pre-down /sbin/ip -6 route del {{ public | ipaddr('net') | ipsubnet(64, 0) | ipaddr('subnet') }} proto static dev $IFACE table mwu
pre-down /sbin/ip -6 route del {{ public | ipaddr('net') | ipsubnet(56, magic) | ipsubnet(64, 0) | ipaddr('subnet') }} proto static dev $IFACE table mwu
{% endfor %}

View file

@ -3,6 +3,21 @@
# {{ ansible_managed }} # {{ ansible_managed }}
# #
{% for mesh in meshes %}
# static {{ mesh.site_name }} routes for rt_table mwu
/sbin/ip -4 route add {{ mesh.ipv4_network }} proto static dev {{ mesh.id }}br table mwu
{% for ula in mesh.ipv6_ula %}
/sbin/ip -6 route add {{ ula | ipaddr('net') | ipsubnet(64, 0) | ipaddr('subnet') }} proto static dev {{ mesh.id }}br table mwu
{% endfor %}
{% for public in mesh.ipv6_public %}
/sbin/ip -6 route add {{ public | ipaddr('net') | ipsubnet(64, 0) | ipaddr('subnet') }} proto static dev {{ mesh.id }}br table mwu
/sbin/ip -6 route add {{ public | ipaddr('net') | ipsubnet(56, magic) | ipsubnet(64, 0) | ipaddr('subnet') }} proto static dev {{ mesh.id }}br table mwu
{% endfor %}
{% if not loop.last %}
{% endif %}
{% endfor %}
# static blackhole routes for rt_table internet # static blackhole routes for rt_table internet
/sbin/ip -4 route add blackhole 0.0.0.0/8 table internet /sbin/ip -4 route add blackhole 0.0.0.0/8 table internet
/sbin/ip -4 route add blackhole 10.0.0.0/8 table internet /sbin/ip -4 route add blackhole 10.0.0.0/8 table internet

View file

@ -3,6 +3,21 @@
# {{ ansible_managed }} # {{ ansible_managed }}
# #
{% for mesh in meshes %}
# static {{ mesh.site_name }} routes for rt_table mwu
/sbin/ip -4 route del {{ mesh.ipv4_network }} proto static dev {{ mesh.id }}br table mwu
{% for ula in mesh.ipv6_ula %}
/sbin/ip -6 route del {{ ula | ipaddr('net') | ipsubnet(64, 0) }} proto static dev {{ mesh.id }}br table mwu
{% endfor %}
{% for public in mesh.ipv6_public %}
/sbin/ip -6 route del {{ public | ipaddr('net') | ipsubnet(64, 0) }} proto static dev {{ mesh.id }}br table mwu
/sbin/ip -6 route del {{ public | ipaddr('net') | ipsubnet(64, magic) }} proto static dev {{ mesh.id }}br table mwu
{% endfor %}
{% if not loop.last %}
{% endif %}
{% endfor %}
# static blackhole routes for rt_table internet # static blackhole routes for rt_table internet
/sbin/ip -4 route del blackhole 0.0.0.0/8 table internet /sbin/ip -4 route del blackhole 0.0.0.0/8 table internet
/sbin/ip -4 route del blackhole 10.0.0.0/8 table internet /sbin/ip -4 route del blackhole 10.0.0.0/8 table internet