-
Notifications
You must be signed in to change notification settings - Fork 1
Module FRR
This page describes the FRR module for dot2net.
FRRouting (FRR) is a free and open source Internet routing protocol suite for Linux and Unix platforms. It implements BGP, OSPF, RIP, IS-IS, PIM, LDP, BFD, Babel, PBR, OpenFabric and VRRP.
- Official Website: https://frrouting.org/
- GitHub: https://github.com/FRRouting/frr
- Documentation: https://docs.frrouting.org/
Unlike Containerlab and TiNET modules, the FRR module does not generate output files. Instead, it provides FormatStyles for generating FRR-compatible configuration commands.
| FormatStyle Name | Purpose | Output Format |
|---|---|---|
frrCmd |
vtysh command format | Shell commands for vtysh |
The frrCmd FormatStyle formats configuration lines as vtysh commands suitable for shell execution:
vtysh -c "conf t" -c "router ospf" -c "router-id 10.255.0.1"
This is useful for the startup config block when you want to configure FRR via command line rather than configuration files.
module:
- containerlab
- frr
nodeclass:
- name: router
values:
image: quay.io/frrouting/frr:8.5.0
kind: linux
config:
# Configure FRR via vtysh commands in startup
- name: startup
format: frrCmd
template:
- "conf t"
- "router ospf"
- "router-id {{ .ip_loopback }}"
- "network {{ .ip_net }} area 0"In topo.yaml exec section:
exec:
- vtysh -c "conf t" -c "router ospf" -c "router-id 10.255.0.1" -c "network 10.0.0.0/24 area 0"For more complex configurations, you may prefer using FRR configuration files instead of vtysh commands:
module:
- containerlab
file:
- name: frr.conf
path: /etc/frr/frr.conf
- name: daemons
path: /etc/frr/daemons
- name: vtysh.conf
path: /etc/frr/vtysh.conf
nodeclass:
- name: router
values:
image: quay.io/frrouting/frr:8.5.0
kind: linux
config:
- file: frr.conf
template:
- "hostname {{ .name }}"
- "!"
- "router ospf"
- " router-id {{ .ip_loopback }}"
- "{{ .interfaces_ospf_network }}"
- "!"
- file: daemons
sourcefile: ./daemons
- file: vtysh.conf
sourcefile: ./vtysh.conf
- name: startup
template:
- "vtysh -b" # Load configuration from frr.conf| Approach | Pros | Cons |
|---|---|---|
| frrCmd (commands) | Simple, no extra files | Hard to debug, limited complexity |
| Config files | Full FRR syntax, easier debugging | Requires file setup (daemons, vtysh.conf) |
Recommendation: Use config files for production scenarios; use frrCmd for simple tests or quick prototypes.
When using FRR with configuration files, you typically need:
| File | Purpose | Example Content |
|---|---|---|
frr.conf |
Main configuration | Generated by dot2net |
daemons |
Enable routing daemons | ospfd=yes |
vtysh.conf |
vtysh settings | service integrated-vtysh-config |
zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
pimd=no
ldpd=no
nhrpd=no
eigrpd=no
babeld=no
sharpd=no
staticd=no
pbrd=no
bfdd=no
fabricd=no
service integrated-vtysh-config
name: ospf_simple
module:
- containerlab
- frr
layer:
- name: ip
default_connect: true
policy:
- name: p2p
range: 10.0.0.0/16
prefix: 30
- name: lo
type: loopback
range: 10.255.0.0/24
nodeclass:
- name: router
policy: [lo]
values:
image: quay.io/frrouting/frr:8.5.0
kind: linux
config:
- name: startup
format: frrCmd
template:
- "conf t"
- "router ospf"
- "router-id {{ .ip_loopback }}"
- "{{ .interfaces_ospf_cmd }}"
interfaceclass:
- name: default
policy: [ip]
config:
- name: ospf_cmd
format: frrCmd
template:
- "int {{ .name }}"
- "ip addr {{ .ip_addr }}/{{ .ip_plen }}"
- "router ospf"
- "network {{ .ip_net }} area 0"name: ospf_simple
topology:
nodes:
r1:
kind: linux
image: quay.io/frrouting/frr:8.5.0
exec:
- vtysh -c "conf t" -c "int net0" -c "ip addr 10.0.0.1/30" -c "router ospf" -c "network 10.0.0.0/30 area 0"
- vtysh -c "conf t" -c "router ospf" -c "router-id 10.255.0.1"
r2:
kind: linux
image: quay.io/frrouting/frr:8.5.0
exec:
- vtysh -c "conf t" -c "int net0" -c "ip addr 10.0.0.2/30" -c "router ospf" -c "network 10.0.0.0/30 area 0"
- vtysh -c "conf t" -c "router ospf" -c "router-id 10.255.0.2"
links:
- endpoints: [r1:net0, r2:net0]- Module System - How modules work
- Module: Containerlab - Containerlab integration
- Module: TiNET - TiNET integration
- FormatStyle Design - How FormatStyles work