gre_ffrl.j2 991 B

1234567891011121314151617181920
  1. # GRE Tunnel zum Rheinland Backbone
  2. # Die Konfigurationsdaten werden vom Rheinland Backbone vergeben und zugewiesen
  3. {% for tun in ffrl_tun %}
  4. auto tun-ffrl-{{tun.name}}
  5. iface tun-ffrl-{{tun.name}} inet static
  6. address {{tun.v4_remote | ipaddr( tun.v4_remote.split('.')[3] | int + 1) | ipaddr('address') }}
  7. netmask {{tun.v4_remote | ipaddr('netmask')}}
  8. pre-up ip tunnel add $IFACE mode gre local {{ansible_default_ipv4.address}} remote {{tun.gre_target | ipaddr('address') }} ttl 255
  9. post-up ip link set $IFACE mtu 1400
  10. post-down ip tunnel del $IFACE
  11. post-up ip rule add iif $IFACE lookup ffnet
  12. pre-down ip rule del iif $IFACE lookup ffnet ||:
  13. iface tun-ffrl-{{tun.name}} inet6 static
  14. address {{tun.v6_remote | ipaddr('2') | ipaddr('address') }}
  15. netmask {{tun.v6_remote | ipaddr('prefix')}}
  16. post-up ip -6 rule add iif $IFACE lookup ffnet
  17. pre-down ip -6 rule del iif $IFACE lookup ffnet ||:
  18. {% endfor %}