babeld: Update example configuration file

More example filters are provided, and new options such as "type" or
"pref_src" are given as example.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
This commit is contained in:
Baptiste Jonglez 2019-08-26 18:25:32 +02:00
parent 06f821adc1
commit 3e3d16338d
1 changed files with 38 additions and 11 deletions

View File

@ -1,5 +1,7 @@
package babeld
# Detailed documentation: https://openwrt.org/docs/guide-user/services/babeld
# Babeld reads options from the following files (the last one takes precedence
# if an option is defined in several places):
# - the file defined by the option conf_file (default: /etc/babeld.conf),
@ -39,7 +41,10 @@ config interface
option 'ignore' 'true'
## Physical interface name
option 'ifname' 'tun-example'
# option 'max_rtt_penalty' '90'
## Specify the type of interface: tunnels use the RTT-based metric.
option 'type' 'tunnel'
## Other options that can be overriden.
# option 'max_rtt_penalty' '96'
# A config interface without "option ifname" will set default options
# for all interfaces. Interface-specific configuration always overrides
@ -49,27 +54,49 @@ config interface
# option 'update_interval' '30'
# A filter consists of a type ('in', 'out' or 'redistribute'), an action
# ('allow', 'deny' or 'metric xxx') and a set of selectors ('ip', 'eq',
# etc.). See babeld man page ("Filtering rules") for more details.
# Here is a sample filter wich redistributes the default route if its
# protocol number is "boot", e.g. when it installed by dhcp. It is
# disabled by default.
# A filter consists of a type ('in', 'out', 'redistribute' or 'install'),
# a set of selectors ('ip', 'eq', etc.) and a set of actions to perform
# ('allow', 'deny', 'metric xxx', 'src-prefix xxx', 'table xxx', 'pref-src xxx').
# See babeld man page ("Filtering rules") for more details.
# Below is a sample filter that redistributes the default route if its
# protocol number is "boot", e.g. when it is installed by dhcp (see
# /etc/iproute2/rt_protos). This filter is disabled thanks to the 'ignore'
# setting.
config filter
option 'ignore' 'true'
# Type
# Type of filter
option 'type' 'redistribute'
# Selectors: ip, eq, le, ge, src_ip, src_eq, src_le, src_ge, neigh, id,
# proto, local, if.
option 'ip' '0.0.0.0/0'
option 'eq' '0'
option 'proto' '3'
# Action (one of: allow, deny, metric XXX, src-prefix XXX).
# Action, which can be any of: allow, deny, metric <NUMBER>, src-prefix <PREFIX>,
# table <ID>, pref-src <IP>.
# The action defaults to "allow" if not specified. Here, we specify a higher
# redistribution metric than the default (0).
option 'action' 'metric 128'
# Notice that the 'local' selector is a boolean.
# Another example filter: don't redistribute local addresses in a certain IP prefix.
# By default, babeld redistributes *all* local addresses.
config filter
option 'ignore' 'true'
option 'type' 'redistribute'
# Only apply to routes/addresses within this prefix.
option 'ip' '198.51.100.0/24'
# Notice that the 'local' selector is a boolean.
option 'local' 'true'
# No action means "allow"
# Don't redistribute.
option 'action' 'deny'
# Example install filter, to change or filter routes before they are inserted
# into the kernel.
config filter
option 'ignore' 'true'
option 'type' 'install'
# Optional: only apply to routes within 2001:db8:cafe::/48
option 'ip' '2001:db8:cafe::/48'
# We specify the kernel routing table and the preferred source address to use for these routes.
# "Allow" is implicit.
option 'action' 'table 200 pref-src 2001:db8:ba:be1::42'