Page MenuHomeVyOS Platform

Add support for "inactive" and "ephemeral" node properties to the parser
Closed, ResolvedPublic

Description

Some consideraions:

This stuff should be... conscpicious and impossible to ignore while skimming through a config, so I suggest #INACTIVE and #EPHEMERAL tokens. JunOS uses "inactive: " before the node, which hardly catches the eye so well.
The best place for the properties is likely between the comment and the node name.
Nodes can be both inactive and ephemeral (e.g. a user deactivated a statement inserted by a transition script).
While ephemeral nodes do not make it to the saved config when saved by vyconf, we should support them in the loader for two reasons: 1. people may try loading config produced by copy-pasting show output, and that's a valid thing to do 2. I suppose one may want to include them on purpose to do certain first boot things.
I can't think of any other properties, so I think for now we can hardcode #INACTIVE and #EPHEMERAL as tokens. For simplicity we may also want to require that #EPHEMERAL comes after #INACTIVE There is some hack value in implementing the general case for sure, but I don't know if we really need it or not.

Formally:

<node> ::= <comment> <inactive> <ephemeral> <identifier> ...

Example:

protocols {
  static {
    /* some nasty attacker */
    #EPHEMERAL route 192.0.2.43/32 {
      blackhole;
    }
    /* that one may be innocent so we deactivated it */
    #INACTIVE #EPHEMERAL route 192.0.2.56/32 {
      blackhole;
    }
  }
  bgp 64555 {
    neighbor 203.0.113.4 {
      remote-as 65300;
      /* not sure if we need ebgp-multihop for this peer */
      #INACTIVE ebgp-multihop 255; 
  }

Details

Difficulty level
Normal (likely a few hours)

Event Timeline

dmbaturin claimed this task.