diff options
author | Niklas Yann Wettengel <niyawe@niyawe.de> | 2018-03-24 12:09:53 +0100 |
---|---|---|
committer | Niklas Yann Wettengel <niyawe@niyawe.de> | 2018-03-24 12:09:53 +0100 |
commit | 10585bc4d2f854858084c808ce56cd6d87934b49 (patch) | |
tree | c16135fcefa9b206dfd3deb06012557cd0805cc1 /roles/install_babeld/templates/babeld.conf.j2 | |
parent | 4fa23988e6d56a1a1dd8e34ca28213f9b8deb4ab (diff) |
babel add preferred uplink
Diffstat (limited to 'roles/install_babeld/templates/babeld.conf.j2')
-rw-r--r-- | roles/install_babeld/templates/babeld.conf.j2 | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/roles/install_babeld/templates/babeld.conf.j2 b/roles/install_babeld/templates/babeld.conf.j2 index c3f59f0..bf39bd5 100644 --- a/roles/install_babeld/templates/babeld.conf.j2 +++ b/roles/install_babeld/templates/babeld.conf.j2 @@ -23,36 +23,17 @@ interface bb{{ peer.name }} #debug 1 local-port 33123 #diversity true -#random-id true +random-id true -# Per-interface configuration. Note that each interface referenced here -# will be used by babeld. -#interface eth1 rxcost 10 -#interface tun0 faraway true -#interface wlan0 hello-interval 1 +default type tunnel rtt-min 1 rtt-max 25 max-rtt-penalty 128 +smoothing-half-life 30 -# Since 1.4.2, you can also specify defaults for interface parameters, which -# will be used for all interfaces except specified otherwise (see above). -#default rxcost 42 -#default hello-interval 5 - -# Since 1.5.0, you can use the RTT-based metric, most useful for a network -# with tunnels (overlay network). -#default enable-timestamps true -#interface tun0 max-rtt-penalty 150 -#interface tun0 rtt-max 100 -default type tunnel rtt-min 1 rtt-max 20 max-rtt-penalty 128 export-table 42 import-table 42 # Filtering rules. -# Only accept routes included in a specific prefix. -#in ip 192.168.42.0/24 allow -#in ip 2001:db8:cafe:cafe::/64 allow -#in deny - {% if 'mullvad_uplink' in group_names %} redistribute if mullvad metric 256 {% endif %} @@ -69,3 +50,11 @@ redistribute ip 2001:470:cd45:ff00::/56 allow redistribute ip 2a03:2260:1016::/48 allow redistribute ip fd62:44e1:da::/48 allow redistribute local deny + +{% if 'fastd' in group_names and preferred_uplink is defined %} +{% for peer in groups['uplink'] %} +{% if not hostvars[peer]['wireguard_bb_name'] == preferred_uplink %} +in if bb{{ hostvars[peer]['wireguard_bb_name'] }} metric 64 +{% endif %} +{% endfor %} +{% endif %} |