Skip to content
Draft
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
7 changes: 7 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ networks:
mesh_metric: 1024 # overrides the default metrics for for babel routing.
# Lower metrics means a route is preferred. Babel is used within bbb-configs.
# Defaults can be found at group_vars/all/general.yml
mesh_metric_neighbors: # add additional routing costs on to of the interface cost for individual neighbors
- name: neighbor1 # name of the neighbor to make it easier to identify, otherwise unused
ip: fe80::1a2b:3c4d:5e6f:7a8b
metric: 4096
- name: neighbor2
ip: fe80::abcd:1234:5678:9abc
metric: 1024
untagged: true # untags the vlan. It is commonly used for tunnel-uplinks. Only one
# network can be untagged. For more advanced use cases, look under
# hosts section at rc.local
Expand Down
7 changes: 4 additions & 3 deletions locations/shp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ networks:
mesh_ap: shp-core
mesh_radio: 11a_standard
mesh_iface: mesh
mesh_metric_neighbors:
- name: w38b-core
ip: fe80::8483:c4ff:fea5:4161
metric: 4096

# MESH - 2.4 GHz 802.11s
- vid: 21
role: mesh
name: mesh_2g
prefix: 10.248.71.73/32
ipv6_subprefix: -21
# make mesh_metric(s) for 2GHz worse than 5GHz
mesh_metric: 1024
mesh_metric_lqm: ["default 0.8"]
mesh_ap: shp-core
mesh_radio: 11g_standard
mesh_iface: mesh
Expand Down
4 changes: 4 additions & 0 deletions locations/w38b.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ networks:
mesh_ap: w38b-core
mesh_radio: 11a_standard
mesh_iface: mesh
mesh_metric_neighbors:
- name: shp-core
ip: fe80::40d4:37ff:fe8c:877
metric: 4096

# MESH - 2.4 GHz 802.11s
- vid: 21
Expand Down
24 changes: 18 additions & 6 deletions roles/cfg_openwrt/templates/corerouter/bird.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,21 @@ protocol babel {
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 #}
{# Base per-interface metric; 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) }};
babel_metric = babel_metric + {{ nw.get('mesh_metric', default_mesh_metric) }};
}
{# Per-neighbor mesh metrics #}
{% for neigh in nw.get('mesh_metric_neighbors', []) %}
if from = {{ neigh.ip }} then {
babel_metric = babel_metric + {{ neigh.metric }};
}
{% endfor %}
{% 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) }};
babel_metric = babel_metric + {{ nw.get('mesh_metric', mesh_metric_tunnel_in) }};
}
{% endfor %}
accept;
Expand All @@ -53,15 +59,21 @@ protocol babel {
ipv4 {
import filter {
{% 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 #}
{# Base per-interface metric; 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) }};
babel_metric = babel_metric + {{ nw.get('mesh_metric', default_mesh_metric) }};
}
{# Per-neighbor mesh metrics #}
{% for neigh in nw.get('mesh_metric_neighbors', []) %}
if from = {{ neigh.ip }} then {
babel_metric = babel_metric + {{ neigh.metric }};
}
{% endfor %}
{% 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) }};
babel_metric = babel_metric + {{ nw.get('mesh_metric', mesh_metric_tunnel_in) }};
}
{% endfor %}
accept;
Expand Down