We believe every router deserves a spa day! In this example, each router gets a well-deserved beauty rest of 10 to 30 seconds. During this time, the router's ISIS and OSPF processes are temporarily shut down.
With nornir-conditional-runner
, you can ensure that R01 Loopback0 always maintains connectivity to R10 Loopback0, even while routers are taking their breaks.
R02 and R03 cannot be down simultaneously; otherwise, R01 will lose connectivity.
R08 and R09 cannot be down simultaneously; otherwise, R10 will lose connectivity.
If R04 is down, R03, R05, and R07 cannot also be down.
If R06 is down, R05 and R07 cannot also be down.
If R05 is down, R02, R04, and R06 cannot also be down.
If R07 is down, R04 and R06 cannot also be down.
A maximum of one router in the OSPF group can be down at any time.
A maximum of two routers in the ISIS group can be down at any time.
The runner configuration in the Nornir settings is defined as follows:
runner:
plugin: ConditionalRunner
options:
num_workers: 10
conditional_group_key: "conditional_groups"
group_limits:
edge1_uplink: 1
edge2_uplink: 1
R04__R03_R05_R07: 1
R06__R05_R07: 1
R05__R02_R04_R06: 1
R07__R04_R06: 1
ospf: 1
isis: 2
Each host needs to have the conditional_groups
attribute defined. Using SimpleInventory
, the configuration for host R04 would look like this:
r04:
hostname: 192.168.121.104
groups:
- eos
- ospf
data:
conditional_groups:
- R04__R03_R05_R07
- R05__R02_R04_R06
- R07__R04_R06
- ospf
The lab environment is created by netlab and can be easily started with the following steps:
cd netlab
netlab up
The load_credentials
from nornir-utils is used.
export NORNIR_PASSWORD=admin
Ensure you have netlab and containerlab installed and properly configured. Navigate to the netlab directory containing your lab configuration files before running the command.
The lab has been tested on Ubuntu with the following system specifications:
- 16GB RAM
- 4 vCPUs