FFRL Internet Exit: move IPv4 NAT address to a single dummy interface

This commit is contained in:
Tobias Hachmer 2017-10-04 13:38:00 +02:00
parent cc43741a91
commit 94da0613a4
4 changed files with 16 additions and 3 deletions

View file

@ -5,3 +5,9 @@
dest: "/etc/network/interfaces.d/{{ item.key }}"
notify: reload network interfaces
with_dict: "{{ ffrl_exit_server }}"
- name: create ffrl-nat dummy interface
template:
src: ffrl_nat.j2
dest: "/etc/network/interfaces.d/ffrl-nat"
notify: reload network interfaces

View file

@ -13,4 +13,3 @@ iface {{ item.key }} inet tunnel
address {{ item.value.tunnel_ipv4_network | ipaddr('net') | ipaddr('1') | ipaddr('address') }}/{{ item.value.tunnel_ipv4_network | ipaddr('net') | ipaddr('prefix') }}
address {{ item.value.tunnel_ipv6_network | ipaddr('net') | ipaddr('2') | ipaddr('address') }}/{{ item.value.tunnel_ipv6_network | ipaddr('net') | ipaddr('prefix') }}
address {{ ffrl_public_ipv4_nat | ipaddr('address') }}/{{ ffrl_public_ipv4_nat | ipaddr('prefix') }}

View file

@ -0,0 +1,7 @@
#
# {{ ansible_managed }}
#
auto ffrl-nat
iface ffrl-nat
link-type dummy
address {{ ffrl_public_ipv4_nat | ipaddr('address') }}/{{ ffrl_public_ipv4_nat | ipaddr('prefix') }}

View file

@ -36,9 +36,10 @@ filter ebgp_ffrl_export_filter {
}
# Protocols
protocol static ffrl_uplink_hostroute {
protocol direct ffrl_nat {
table ffrl;
route {{ ffrl_public_ipv4_nat | ipaddr('address') }}/{{ ffrl_public_ipv4_nat | ipaddr('prefix') }} reject;
interface "ffrl-nat";
import where is_ffrl_nat();
}
protocol direct ffrl_tunnels {