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

make it possible to use routing algo BATMAN-V of batman-adv #104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions group_vars/all/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ site_domain: 'bremen.freifunk.net'
site_vpn_prefix: 'vpn'
icvpn_as: 65196
fastd_peers_limit: 200
batman_routing_algo: 'BATMAN_V'
1 change: 1 addition & 0 deletions roles/batman-adv-interface/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ batman_interface: bat-{{ site_code }}
batman_dummy_interface: 'bat-{{ site_code }}-dummy'
batman_hop_penalty: 96
batman_gateway: false
batman_routing_algo: 'BATMAN_IV'
6 changes: 6 additions & 0 deletions roles/batman-adv-interface/files/if-pre-up
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ case "$IF_BATADV_PORTS" in
;;
esac

# taken from openWRT:
# https://git.openwrt.org/?p=feed/routing.git;a=blob;f=batman-adv/files/lib/netifd/proto/batadv.sh;h=edc14f4cbd5485ede408e897fada8eae6f8f09d3;hb=ecb7132f014275a9fa0509e790257f0a66802a1d#l72
# maybe following is possible after create:
# batctl meshif "$IFACE" routing_algo "${IF_BATADV_ROUTING_ALGO:-BATMAN_IV}"
batctl routing_algo "${IF_BATADV_ROUTING_ALGO:-BATMAN_IV}"

if ! batctl meshif "$IFACE" interface >/dev/null 2>&1; then
batctl meshif "$IFACE" interface create
fi
Expand Down
6 changes: 6 additions & 0 deletions roles/batman-adv-interface/templates/interfaces
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ auto {{ batman_dummy_interface }}
iface {{ batman_dummy_interface }} inet manual
pre-up ip link add name $IFACE type dummy
up ip link set $IFACE up
{% if batman_routing_algo == 'BATMAN_V' %}
# let batman handle the multicast
# https://gluon.readthedocs.io/en/latest/package/gluon-mesh-batman-adv.html
post-up bash -c 'echo 2 > /sys/class/net/{{ batman_dummy_interface }}/brport/multicast_router'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@genofire wofür ist das?

{% endif %}
down ip link set $IFACE down
post-down ip link del $IFACE

auto {{ batman_interface }}
iface {{ batman_interface }} inet manual
batadv-ports {{ batman_dummy_interface }}
batadv-routing-algo {{ batman_routing_algo }}
{% if ansible_default_ipv6.macaddress is defined %}
batadv-hw {{ ansible_default_ipv6.macaddress | derive_mac_addr(2) }}
{% else %}
Expand Down
7 changes: 6 additions & 1 deletion roles/main-bridge/templates/interfaces
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ iface br-{{ site_code }} inet static
# tune ARP and IPv6 neighbor soolicitation
post-up sysctl -p /etc/sysctl.d/main-bridge-ip-neigh-tuning.conf
# increase multicast table
post-up bash -c 'echo 2048 > /sys/class/net/br-ffhb/bridge/hash_max'
{% if batman_routing_algo is defined and batman_routing_algo == 'BATMAN_V' %}
# let batman handle the multicast
# https://gluon.readthedocs.io/en/latest/package/gluon-mesh-batman-adv.html
post-up bash -c 'echo 2 > /sys/class/net/br-{{ site_code }}/brport/multicast_router'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@genofire wofür ist das?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

siehe Kommentar / Link

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, hab ich gluon docs doch falsch verstanden ...
gerade denk

e ich, ich sollte es beim batman interface und nicht deren bridge interface.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Und: ich hab die Doku jetzt so verstanden, dass diese Option unabhängig von BATMAN_V ist (also die ist anscheinend für BATMAN_IV und BATMAN_V sinnvoll). @genofire: kannst du nicht einen eigenen Pull Request machen, wo du nur den Commit für diese multicast_router-Option reinpackst?

{% endif %}
post-up bash -c 'echo 2048 > /sys/class/net/br-{{ site_code }}/bridge/hash_max'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@genofire wofür ist das?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die Zeile hab ich nur "gefixed", um die ansible variable - aber ja, der commentar ist dabei unglücklich durch die Änderung von brport/multicast_router verrutscht.

# increase multicast table


iface br-{{ site_code }} inet6 static
address {{ batman_ipv6_local.address }}
Expand Down