Skip to content

Commit

Permalink
corerouter: implement olsrd-babel ipv4 soft migration
Browse files Browse the repository at this point in the history
  • Loading branch information
spolack committed Sep 22, 2024
1 parent 2c345b5 commit 7df84d9
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 0 deletions.
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

2 comments on commit 7df84d9

@PolynomialDivision
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you add the lookup rules to common so also APs have them?

@spolack
Copy link
Member Author

Choose a reason for hiding this comment

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

why should APs have them?

Please sign in to comment.