make v6-only probably work better

This commit is contained in:
9pfs 2024-11-25 15:59:58 -06:00
parent 5ae2bf3356
commit 1588a116a7
Signed by: 9pfs
SSH key fingerprint: SHA256:yVO09iotyiNaBzBBvVR8ZTx7SB9VpvJPgR1Ihy1bz3Q
2 changed files with 10 additions and 1 deletions

View file

@ -20,7 +20,11 @@ define OWNNETSETv6 = [fd32:6b0:70a6::/48+];
# Header end # # Header end #
################################################ ################################################
{% if unicastv4 is defined %}
router id OWNIP; router id OWNIP;
{% else %}
router id from "*" -"lo";
{% endif %}
protocol device { protocol device {
scan time 10; scan time 10;
@ -127,7 +131,6 @@ protocol static {
template bgp dnpeers { template bgp dnpeers {
local as OWNAS; local as OWNAS;
path metric 1; path metric 1;
{% if unicastv4 is defined %} {% if unicastv4 is defined %}
ipv4 { ipv4 {
import filter { import filter {
@ -142,6 +145,7 @@ template bgp dnpeers {
export filter { if is_valid_network() && source ~ [RTS_STATIC, RTS_BGP] then accept; else reject; }; export filter { if is_valid_network() && source ~ [RTS_STATIC, RTS_BGP] then accept; else reject; };
import limit 9000 action block; import limit 9000 action block;
import table;
}; };
{% endif %} {% endif %}
@ -157,6 +161,7 @@ template bgp dnpeers {
}; };
export filter { if is_valid_network_v6() && source ~ [RTS_STATIC, RTS_BGP] then accept; else reject; }; export filter { if is_valid_network_v6() && source ~ [RTS_STATIC, RTS_BGP] then accept; else reject; };
import limit 9000 action block; import limit 9000 action block;
import table;
}; };
} }

View file

@ -1,18 +1,22 @@
template bgp intpeers { template bgp intpeers {
local as OWNAS; local as OWNAS;
{% if unicastv4 is defined %}
ipv4 { ipv4 {
import where source = RTS_BGP && is_valid_network() && !is_self_net(); import where source = RTS_BGP && is_valid_network() && !is_self_net();
export where source = RTS_BGP && is_valid_network() && !is_self_net(); export where source = RTS_BGP && is_valid_network() && !is_self_net();
next hop self; next hop self;
add paths yes; add paths yes;
import table;
}; };
{% endif %}
ipv6 { ipv6 {
import where source = RTS_BGP && is_valid_network_v6() && !is_self_net_v6(); import where source = RTS_BGP && is_valid_network_v6() && !is_self_net_v6();
export where source = RTS_BGP && is_valid_network_v6() && !is_self_net_v6(); export where source = RTS_BGP && is_valid_network_v6() && !is_self_net_v6();
next hop self; next hop self;
add paths yes; add paths yes;
import table;
}; };
} }
{% for host in groups['routers'] %} {% for host in groups['routers'] %}