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

Implement IPv4 Route Policy to prefer babel routes #965

Merged
merged 1 commit into from
Sep 22, 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: 2 additions & 0 deletions group_vars/role_corerouter/imageprofile.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
role_corerouter__packages__to_merge:
- bird2
- bird2c
- babeld
- luci-app-babeld
- collectd-mod-dhcpleases
Expand Down
20 changes: 20 additions & 0 deletions roles/cfg_openwrt/files/common/iproute2/rt_tables
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# reserved values
#
128 prelocal
255 local
254 main
253 default

0 unspec
#
# local
#
#1 inr.ruhep

10 babel-ff
11 babel-default
12 babel-src
20 olsr-ff
21 olsr-default

1 change: 1 addition & 0 deletions roles/cfg_openwrt/files/corerouter/babeld.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export-table 12
47 changes: 47 additions & 0 deletions roles/cfg_openwrt/files/corerouter/bird.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
log syslog all;
debug protocols all;

ipv4 table babel_src;
ipv4 table babel_ff;
ipv4 table babel_default;

protocol device {
}

protocol kernel {
learn;
kernel table 12;
ipv4 {
table babel_src;
import all;
};
}

protocol kernel {
kernel table 10;
ipv4 {
table babel_ff;
export all;
};
}

protocol kernel {
kernel table 11;
ipv4 {
table babel_default;
export all;
};
}


protocol pipe {
table babel_src;
peer table babel_ff;
export where net != 0.0.0.0/0;
}

protocol pipe {
table babel_src;
peer table babel_default;
export where net = 0.0.0.0/0;
}
1 change: 1 addition & 0 deletions roles/cfg_openwrt/files/corerouter/iproute2/rt_tables
22 changes: 22 additions & 0 deletions roles/cfg_openwrt/templates/common/config/network.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
{% set profile = wireless_profiles | selectattr('name', 'equalto', wireless_profile) | list | first %}
{% set wifi_networks = profile | json_query('ifaces[].network') | default([], true) %}


# Babel inserts into seperate route table, add that to lookup list for IPv6
config rule6
option priority 33000
option lookup 'babel-src'

# IPv4 Soft Migration by priotizing Babel over OLSR
config rule
option priority 33100
option lookup 'babel-ff'

config rule
option priority 33101
option lookup 'olsr-ff'

config rule
option priority 33200
option lookup 'babel-default'
config rule
option priority 33201
option lookup 'olsr-default'

config interface 'loopback'
option device 'lo'
option proto 'static'
Expand Down
2 changes: 2 additions & 0 deletions roles/cfg_openwrt/templates/corerouter/config/olsrd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ config olsrd
option OlsrPort '698'
option Willingness '3'
option TosValue '16'
option RtTable '20'
option RtTableDefault '21'

config InterfaceDefaults
option MidValidityTime '500.0'
Expand Down