Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corerouter: use patched version of bird2 and add proper inbound metrics #1087

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion group_vars/role_corerouter/imageprofile.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
role_corerouter__packages__to_merge:
- bird2
- bird2-babelpatch
- bird2c
- collectd-mod-dhcpleases
- collectd-mod-olsrd
Expand Down
22 changes: 17 additions & 5 deletions roles/cfg_openwrt/templates/corerouter/bird.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,23 @@ protocol babel {
ipv6 sadr {
table v6_main;
# Import only /56 location aggregates and default routes
import where (net.len = 56) || (net = ::/0 from {{ freifunk_global_prefix }} );
import filter {
if ! (net.len = 56 || net = ::/0 from {{ freifunk_global_prefix }}) then reject;
{% for nw in networks | selectattr('role', 'equalto', 'mesh') %}
{# metrics for 2 GHz adhoc get a penalty over 5 GHz adhoc so 5 GHz is preferred #}
{% set default_mesh_metric = hostvars[inventory_hostname].get('mesh_metric_adhoc_' ~ nw.get('mesh_radio'), mesh_metric_default_in) %}
if ifname = "{{ libnetwork.getIfname(nw) }}" then {
babel_metric = babel_metric + {{ nw.get('mesh_metric', default_mesh_metric) }};
}
{% endfor %}
{% for nw in networks | selectattr('role', 'equalto', 'tunnel') %}
if ifname = "{{ nw.get('ifname') }}" then {
babel_metric = babel_metric + {{ nw.get('mesh_metric', mesh_metric_tunnel_in) }};
}
{% endfor %}
accept;
};

export filter {
if net = {{ ipv6_prefix }} from ::/0 then accept;
if source = RTS_BABEL then accept;
Expand All @@ -40,19 +56,15 @@ protocol babel {
};

# Mesh interfaces
{# metrics for 2 GHz adhoc get a penalty over 5 GHz adhoc so 5 GHz is preferred #}
{% for nw in networks | selectattr('role', 'equalto', 'mesh') %}
{% set default_mesh_metric = hostvars[inventory_hostname].get('mesh_metric_adhoc_' ~ nw.get('mesh_radio'), mesh_metric_default_in) %}
interface "{{ libnetwork.getIfname(nw) }}" {
type wireless;
rxcost {{ nw.get('mesh_metric', default_mesh_metric) }};
};
{% endfor %}
# Tunnel interfaces provided by tunspace
{% for nw in networks | selectattr('role', 'equalto', 'tunnel') %}
interface "{{ nw.get('ifname') }}" {
type wireless;
rxcost {{ nw.get('mesh_metric', mesh_metric_tunnel_in) }};
};
{% endfor %}
}
Expand Down