2017-09-11 13:10:39 +02:00
|
|
|
#
|
|
|
|
# {{ ansible_managed }}
|
|
|
|
#
|
|
|
|
|
|
|
|
# Variables
|
|
|
|
define icvpn_address = {{ icvpn_ipv6_transfer_net | ipaddr('net') | ipsubnet(112, 37) | ipaddr(magic) | ipaddr('address') }};
|
|
|
|
|
|
|
|
# ROA
|
|
|
|
roa table roa_icvpn {
|
|
|
|
include "icvpn_ipv6_roa.con?";
|
|
|
|
}
|
|
|
|
|
|
|
|
# Filters
|
|
|
|
filter icvpn_import_filter {
|
2018-11-05 15:43:10 +01:00
|
|
|
if is_mwu_self_nets() then reject;
|
2017-09-11 13:10:39 +02:00
|
|
|
if roa_check(roa_icvpn) = ROA_VALID then {
|
|
|
|
if is_ula() then accept;
|
|
|
|
} else {
|
|
|
|
if roa_check(roa_icvpn) = ROA_UNKNOWN then {
|
|
|
|
if is_ula() then {
|
2018-01-02 10:45:09 +01:00
|
|
|
print "ROA UNKNOWN for ula net, accepting: ", net, " ASN: ", bgp_path.last;
|
2017-09-11 13:10:39 +02:00
|
|
|
accept;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if roa_check(roa_icvpn) = ROA_INVALID then {
|
|
|
|
if is_ula() then {
|
2018-01-02 10:45:09 +01:00
|
|
|
print "ROA INVALID for ula net, accepting: ", net, " ASN: ", bgp_path.last;
|
2017-09-11 13:10:39 +02:00
|
|
|
accept;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
reject;
|
|
|
|
}
|
|
|
|
reject;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Protocols
|
2018-11-05 15:43:10 +01:00
|
|
|
protocol kernel kernel_mwu {
|
2017-09-11 13:10:39 +02:00
|
|
|
scan time 30;
|
|
|
|
import none;
|
|
|
|
export filter {
|
2018-11-05 15:43:10 +01:00
|
|
|
if is_mwu_self_nets() then
|
|
|
|
reject;
|
2017-09-11 13:10:39 +02:00
|
|
|
krt_prefsrc = icvpn_address;
|
|
|
|
accept;
|
|
|
|
};
|
|
|
|
kernel table ipt_icvpn;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Templates
|
|
|
|
template bgp ebgp_icvpn {
|
|
|
|
local icvpn_address as mwu_as;
|
|
|
|
import keep filtered on;
|
|
|
|
import filter icvpn_import_filter;
|
|
|
|
export filter {
|
2018-11-05 15:43:10 +01:00
|
|
|
if is_mwu_self_nets() then {
|
|
|
|
accept;
|
|
|
|
}
|
|
|
|
if source = RTS_BGP then {
|
|
|
|
accept;
|
|
|
|
}
|
2017-09-11 13:10:39 +02:00
|
|
|
reject;
|
|
|
|
};
|
|
|
|
direct;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Include ICVPN IPv6 peers
|
|
|
|
include "icvpn_ipv6_peers.con?";
|