Axiom is a static analyzer for router configurations. It checks a network against a design: .ax files describe which configuration commands matter, turn their values into typed facts, and state properties that must hold across devices. Axiom derives the facts to a fixed point, then reports failed assertions with source locations. Designs can also emit logs and non-failing warnings.
A design is a reusable template, not a script that runs over configuration lines. A configuration path activates the definitions that match it; the facts they derive can be queried anywhere in the network design. This separates the vendor-specific shape of router files from network-wide checks.
Suppose r0 configures 10.0.0.1/30 on eth0, and r1 configures 10.0.0.2/30. The same interface design is used for both devices:
rel Subnet(device: String, iface: String, net: IpNet);
def (device: String, "interface", iface: String) {
def ("ip", "address", ip: IpNet):
set Subnet(device, iface, trunc(ip));
}
Matching each router's ip address command produces a Subnet fact. trunc drops the host bits, so both addresses yield 10.0.0.0/30. A separate network design declares the link and checks that both endpoints have addresses in the same subnet:
rel Link(left: String, left_iface: String, right: String, right_iface: String);
set Link("r0", "eth0", "r1", "eth0");
set Link("r1", "eth0", "r0", "eth0");
for Link(left: String, left_iface: String, right: String, right_iface: String) {
assert Subnet(left, left_iface, _): "a link endpoint needs an IP address";
for Subnet(left, left_iface, net: IpNet):
assert Subnet(right, right_iface, net): "link endpoints must share a subnet";
}
Changing one address to a different subnet fails the check; removing an address fails the presence assertion. Link is declared by this design, not built in. The complete runnable example includes network.toml and both router configurations.
Install with cargo install axiom and run axiom network.toml. From this source checkout, run cargo run -- docs/examples/first/network.toml instead.
Read the book for the tutorial, language reference, and grammar. The parser's grammar is src/frontend/design_lang/language.pest; the only built-in relation is Config.
Axiom is free software licensed under the GNU General Public License, version 3 or (at your option) any later version (GPL-3.0-or-later).
Running Axiom does not impose this license on user-supplied configurations or design files, or on ordinary analysis results and reports. Those inputs and outputs retain their own licensing; copying GPL-covered material into them may carry separate obligations.