Skip to content

Commit

Permalink
corerouter/gateway: configure olsrd6 solely for name resolution
Browse files Browse the repository at this point in the history
Might be an unconventional approach, but is at the moment
the only turnkey solution to get us basic hostname resolution for
ipv6.

Routing is of course /dev/zero'ed.
  • Loading branch information
spolack authored and PolynomialDivision committed Sep 17, 2024
1 parent b887478 commit 7ab1775
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
53 changes: 53 additions & 0 deletions roles/cfg_openwrt/templates/corerouter/config/olsrd6.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#jinja2: trim_blocks: "true", lstrip_blocks: "true"
config LoadPlugin
option library 'olsrd_nameservice'
option suffix '.olsr6'
option hosts_file '/tmp/hosts/olsr6'
option latlon_file '/tmp/_unused_olsr6_latlon.js'
option services_file '/tmp/_unused_olsr6_services'

config LoadPlugin
option accept '::'
option ipv6only 'true'
option library 'olsrd_jsoninfo'
option ignore '0'

config olsrd
option IpVersion '6'
option FIBMetric 'flat'
option AllowNoInt 'yes'
option TcRedundancy '2'
option NatThreshold '0.75'
option LinkQualityAlgorithm 'etx_ff'
option SmartGateway 'no'
option Pollrate '0.025'
option LinkQualityLevel '2'
option OlsrPort '698'
option Willingness '3'
option TosValue '16'
option RtTable '666'
option RtTableDefault '666'

config InterfaceDefaults
option MidValidityTime '500.0'
option TcInterval '2.0'
option HnaValidityTime '125.0'
option HelloValidityTime '125.0'
option TcValidityTime '500.0'
option MidInterval '50.0'
option HelloInterval '15.0'
option HnaInterval '30.0'

{% for network in networks | selectattr('role', 'equalto', 'mesh') %}
config Interface
option ignore '0'
option interface '{{ network['name'] if 'name' in network else network['role'] }}'
option Mode '{{ 'ether' if network.get('ptp') else 'mesh' }}'
{% endfor %}

{% for tunnel in networks | selectattr('role', 'equalto', 'tunnel') %}
config Interface
option interface '{{ tunnel['ifname'] }}'
option Mode 'ether'
option ignore 0
{% endfor %}
49 changes: 49 additions & 0 deletions roles/cfg_openwrt/templates/gateway/config/olsrd6.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#jinja2: trim_blocks: "true", lstrip_blocks: "true"
config LoadPlugin
option library 'olsrd_nameservice'
option suffix '.olsr6'
option hosts_file '/tmp/hosts/olsr6'
option latlon_file '/tmp/_unused_olsr6_latlon.js'
option services_file '/tmp/_unused_olsr6_services'

config LoadPlugin
option accept '::'
option ipv6only 'true'
option library 'olsrd_jsoninfo'
option ignore '0'

config olsrd
option IpVersion '6'
option FIBMetric 'flat'
option AllowNoInt 'yes'
option TcRedundancy '2'
option NatThreshold '0.75'
option LinkQualityAlgorithm 'etx_ff'
option SmartGateway 'no'
option Pollrate '0.025'
option LinkQualityLevel '2'
option OlsrPort '698'
option Willingness '3'
option TosValue '16'
option RtTable '666'
option RtTableDefault '666'

config InterfaceDefaults
option MidValidityTime '500.0'
option TcInterval '2.0'
option HnaValidityTime '125.0'
option HelloValidityTime '125.0'
option TcValidityTime '500.0'
option MidInterval '50.0'
option HelloInterval '15.0'
option HnaInterval '30.0'

{% if mesh_links is defined and mesh_links|length>0 %}
{% for interface in mesh_links %}
config Interface
option ignore '0'
option interface '{{ interface['name'] }}'
option Mode '{{ 'ether' if interface.get('ptp') else 'mesh' }}'
{% endfor %}
{% endif %}

0 comments on commit 7ab1775

Please sign in to comment.