Skip to content

Commit

Permalink
bird: metrics penalty for 2.4 GHz adhoch over 5 GHz
Browse files Browse the repository at this point in the history
  • Loading branch information
Noki committed Nov 10, 2024
1 parent 7995d21 commit 3781df1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions group_vars/all/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ mesh_metric_default_in: 512
# Default mesh metric in inbound direction (rxcost) for tunnels
mesh_metric_tunnel_in: 512

# Default mesh metric in inbound direction (rxcost) for adhoc like interfaces
mesh_metric_adhoc_in: 2048
# Default mesh metrics in inbound direction (rxcost) for adhoc like interfaces
mesh_metric_adhoc_11a_standard: 2024
mesh_metric_adhoc_11g_standard: 2536
3 changes: 2 additions & 1 deletion roles/cfg_openwrt/templates/corerouter/bird.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ 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 = mesh_metric_adhoc_in if 'mesh_ap' else mesh_metric_default_in %}
{% 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) }};
Expand Down

0 comments on commit 3781df1

Please sign in to comment.