Purpose: an optional TOML file shared by the programs, how it is found, and how layers override each other.
A program reads a configuration only when -C / --configuration FILE is
given, or when UDE_CONFIG names a file. The option wins. On udenc,
-C is not this option: use the long form. An empty value
means no file, and there is no implicit search path. -h and -V skip a
file named only by the environment.
The file is UTF-8 TOML. Values are merged in this
order, each layer overwriting the one before: built-in defaults, the
[global] table, the table named after the program, an optional
[program.instance] table selected with --instance NAME, then the
command line. The file is expanded into the program's own long options,
so a later source wins in the usual way.
Key names use underscores (max_ports, mac_aging_time). Every key has
a matching long option (--max-ports, --mac-aging-time); booleans also
have --no-X. Unknown keys are ignored at run time and reported by
--check-config, which exits 2 without starting. --print-config prints
the effective options and their origins, and exits.
Type, range and enumeration errors fail at load, with file, line and
column. Relative paths are resolved against the directory that contains
the configuration file. Durations such as 5m or 300ms are converted
to the unit the option already uses.
All of the programs read a configuration: udeswitch, udectl, udedump, udelink, udeping, udenc, udedhcpd, udetftpd, udeslirp and udetap. The complete key list is in ude.conf(5).
udenc keeps -C as an unsupported nc(1) flag
and accepts only --configuration (or UDE_CONFIG) for a file.
The global table
[global] connection is the default switch address (HOST:PORT,
:PORT, PORT, or udp://HOST:PORT).
- For udeswitch it becomes the listen address, except a
vde://URL (a VDE socket path, typicallyvde:///tmp/vde/sw), which is not a listen address. - For udelink it fills operand
awhenais unset. - For the other programs it becomes
--switch.
description is a short comment shown by --print-config.
config_version is optional; a value greater than 1 needs a newer UDE.
Lists
A few keys are arrays of strings, each entry becoming one repeated
option: dns (at most 3), udedhcpd boot_file (at most 16, each
[CLASS=]FILE as for -b), udeslirp forward (at most 32, each as for
-R) and deny (at most 32). A later layer (an instance table, say)
replaces the whole array of an earlier one; entries given on the command
line are added after the file's.
Instances and reservations
A program table may have instance sub-tables. If it has only instances
and --instance is not given, the program exits with an error that lists
the names. [udedhcpd.reservations] is reserved and is not an instance.
Impairment presets
[impair.NAME] tables define named impairment presets. udelink can refer
to one from impair = "NAME" or with --impair-preset NAME, which is
an error if that preset is not in the file. See
Link impairment and ude-impair(7).
Example
[global]
connection = "udp://127.0.0.1:7500"
description = "lab switch"
[udeswitch]
max_ports = 32
policy = "local"
[udedhcpd]
subnet = "10.77.0.1/24"
range = "100-199"
lease = "1h"
dns = ["10.77.0.1"]
next_server = "10.77.0.2"
boot_file = ["ipxe=boot.ipxe", "pxelinux.0"]
[udedhcpd.reservations]
"02:00:00:00:00:10" = "10.77.0.10"
[udetftpd]
address = "10.77.0.2/24"
root = "tftp" # relative to this file
[udeslirp]
address = "10.77.0.254/24"
forward = ["tcp:127.0.0.1:2222:10.77.0.10:22"]
host_loopback = false
[impair.dsl]
loss = "0.5%"
delay = "15ms"
[udelink.legacy]
b = "udp://127.0.0.1:7600"
impair = "dsl"
udeswitch -C lab.toml
udedhcpd -C lab.toml
udetftpd -C lab.toml
udeslirp -C lab.toml
udelink -C lab.toml --instance legacy