Skip to content
LinkState
Go back

Same routing intent different route-map semantics

Introduction to Policy Intent Translation

Overview of FRR and Vendor NOS Policy Languages

Free Range Routing (FRR) implements a policy language derived from the Cisco IOS route‑map model, extended with FRR‑specific constructs such as route-map, prefix-list, community-list, and as-path access-list.

Vendor Network Operating Systems (NOS) each expose their own policy language:

Importance of Equivalent Policy Intent Translation

In multi‑vendor fabrics operators must express the same routing intent—e.g., “accept only prefixes from AS 65000 with community 65000:100 and set local‑pref 200”—across FRR and each vendor NOS. Semantic drift between the languages can cause silent mis‑filters, unintended route acceptance, or incorrect attribute manipulation, leading to black‑holes, sub‑optimal paths, or policy violations. A rigorous translation framework ensures that the control‑plane state installed in each router’s RIB/FIB reflects the operator’s original intent, enabling predictable forwarding behavior and simplifying audits.


Policy Language Comparison

FRR Policy Language

Syntax and Structure

FRR policy language revolves around three primitive object types and the route-map construct:

ObjectCLI SyntaxTypical Use
prefix-list`ip prefix-list [seq ] {permitdeny} / [ge ] [le ]`
community-list`ip community-list {standardexpanded} [seq ] {permit
as-path access-list`ip as-path access-list {permitdeny} `
route-map`route-map {permitdeny} <br> match …<br> set …`

A route-map term may contain multiple match clauses (all must be true) and multiple set clauses (all are applied). If no match is present, the term matches everything. The implicit default action at the end of a route‑map is deny.

Example Policy Configurations

! FRR: accept only 10.0.0.0/8 prefixes with community 65000:100, set local-pref 200
ip prefix-list PFX-10 seq 5 permit 10.0.0.0/8
ip community-list STD-COMM seq 5 permit 65000:100
route-map RM-ACCEPT-IN permit 10
  match ip address prefix-list PFX-10
  match community STD-COMM
  set local-preference 200
route-map RM-ACCEPT-IN deny 20   ! explicit deny for clarity

Applied to a BGP neighbor:

router bgp 65001
  neighbor 192.0.2.2 route-map RM-ACCEPT-IN in

Cisco IOS‑XR Policy Language

IOS‑XR uses a hierarchical, declarative model:

Syntax example

prefix-set PFX-10
  10.0.0.0/8 eq 8
end-set

community-set STD-COMM
  65000:100
end-set

route-policy RM-ACCEPT-IN
  if destination in PFX-10 and community matches-any STD-COMM then
    set local-preference 200
    pass
  else
    drop
  endif
end-policy

Applied:

router bgp 65001
  neighbor 192.0.2.2 address-family ipv4 unicast
    route-policy RM-ACCEPT-IN in

Juniper Junos Policy Language

Junos uses policy-options:

Syntax example

prefix-list PFX-10 {
    10.0.0.0/8 exact;
}
community STD-COMM {
    members 65000:100;
}
policy-statement RM-ACCEPT-IN {
    term ACCEPT {
        from {
            prefix-list PFX-10;
            community [ STD-COMM ];
        }
        then {
            local-preference 200;
            accept;
        }
    }
    term REJECT {
        then reject;
    }
}

Applied:

protocols {
    bgp {
        group EXT {
            neighbor 192.0.2.2 {
                import RM-ACCEPT-IN;
            }
        }
    }
}

Arista EOS Policy Language

EOS closely follows the IOS route‑map model, supporting the same list types and adding a few EOS‑specific match/set clauses (e.g., match ipv6 address, set weight). The syntax is identical to FRR for the core constructs.

Syntax example

ip prefix-list PFX-10 seq 5 permit 10.0.0.0/8
ip community-list STD-COMM seq 5 permit 65000:100
route-map RM-ACCEPT-IN permit 10
  match ip address prefix-list PFX-10
  match community STD-COMM
  set local-preference 200
route-map RM-ACCEPT-IN deny 20

Applied:

router bgp 65001
  neighbor 192.0.2.2 route-map RM-ACCEPT-IN in

Semantic Mismatches and Their Impact

Route Filtering Mismatches

Prefix Matching

FeatureFRR / EOSIOS‑XRJunos
Exact match (eq)ip prefix-list … permit 10.0.0.0/8 (implicitly eq 8)10.0.0.0/8 eq 810.0.0.0/8 exact;
Greater‑or‑equal (ge)ge <LEN> in prefix‑listge <LEN> inside prefix-setge <LEN>; inside prefix-list
Less‑or‑equal (le)le <LEN> in prefix‑listle <LEN> inside prefix-setle <LEN>; inside prefix-list
Default actionImplicit deny at end of listImplicit drop if not matched in route-policyImplicit reject if no term matches
Handling of /0Allowed; matches everything unless filteredSameSame
Overlap semanticsFirst match wins (seq order)First matching if clause wins (top‑down)First matching term wins (top‑down)

Impact – A FRR prefix‑list using ge 24 le 30 translates directly to IOS‑XR ge 24 le 30 inside a prefix-set. However, if an operator mistakenly omits ge/le and relies on the implicit exact match, the resulting filter will be stricter than intended, potentially dropping legitimate longer prefixes.

Community Matching

FeatureFRR / EOSIOS‑XRJunos
Standard community formatAA:NN (2‑byte AA) or 4‑byte AA:NNSameSame
Expanded community regexip community-list … expanded … permit .*community-set … with regex (IOS‑XR does not support regex in community‑set; uses matches-any with plain list)Junos community list does not support regex; only exact members
Well‑known communities (e.g., no-export, no-advertise)Supported via ip community-list … permit no-exportSupported via community-set … with no-export keywordSupported via community … members no-export
Multiple communities per clausematch community … accepts list; all must be present (AND)community matches-any … (OR) ; community matches-every … (AND)community [ … ] (AND)
Implicit defaultIf no match community present, term matches any communitySameSame

Impact – The biggest divergence is the OR vs AND semantics. FRR/EOS match community requires all listed communities to be present (AND). IOS‑XR’s community matches-any is OR unless matches-every is used. Junos also uses AND. Translating a FRR term that lists multiple communities without adjusting the operator can unintentionally broaden the match (OR) or narrow it (AND) depending on target.

AS Path Matching

FeatureFRR / EOSIOS‑XRJunos
Regex enginePOSIX‑extended regex (same as IOS)POSIX‑extended regex (same)POSIX‑extended regex (same)
Confederation handlingRegex sees confederation segments as normal AS numbers; no special tokenSameSame
Anchor symbols (^, $)SupportedSupportedSupported
Empty AS_PATH (originate locally)Match with ^$SameSame
Default actionImplicit deny if no match as-pathImplicit drop if no if matches AS‑path conditionImplicit reject if no term matches

Impact – Generally consistent, but operators must be aware that some vendors (e.g., older IOS releases) treat the ^ anchor differently when the AS_PATH contains confederation segments; however, modern releases align. The primary risk is using a regex that inadvertently matches more than intended due to missing anchors.

Action Mismatches

Route Acceptance and Rejection

ActionFRR / EOSIOS‑XRJunos
Acceptpermit in route‑map termpassaccept
Rejectdeny in route‑map termdropreject
DefaultImplicit deny at end of route‑mapImplicit drop if no if matchesImplicit reject if no term matches

Impact – Direct mapping is straightforward; however, forgetting to add an explicit deny/drop/reject term can lead to unintended acceptance because the implicit default varies (FRR/EOS: deny; IOS‑XR: drop; Junos: reject). In practice, all three result in the route not being installed, but the reason code differs in BGP notifications (e.g., notify with Cease/Administrative shutdown vs Cease/Peer deconfigured). For troubleshooting, the distinction matters only when examining logs.

Route Modification

ModificationFRR / EOSIOS‑XRJunos
Set local‑prefset local-preference <VALUE>set local-preference <VALUE>then { local-preference <VALUE>; }
Set MEDset metric <VALUE>set metric <VALUE>then { metric <VALUE>; }
Set weight (local only)set weight <VALUE>set weight <VALUE>then { weight <VALUE>; } (Junos uses weight as a non‑transitive attribute)
Set next‑hopset ip next-hop <ADDR>set next-hop <ADDR>then { next-hop <ADDR>; }
Add communityset community <COMM> additiveset community <COMM> additivethen { community add <COMM>; }
Set community (overwrite)set community <COMM>set community <COMM>then { community set <COMM>; }
Delete communityset community <COMM> deletedelete community <COMM>then { community delete <COMM>; }
Set origin`set origin {igpegpincomplete}`
Set atomic‑aggregateNot directly supported (FRR ignores)Not supportedNot supported

Impact – The semantics of additive vs set are identical across platforms. However, FRR/EOS allow multiple set community clauses in a term; the last one wins unless additive is used. IOS‑XR’s set community is also last‑wins unless additive. Junos uses community add (additive) and community set (replace). Mis‑interpreting additive vs replace can lead to unintended community stripping.

Route Redistribution

FeatureFRR / EOSIOS‑XRJunos
Redistribute connected/static/ospf/isisredistribute <proto> [metric <M>] [route-map <RM>]redistribute <proto> [metric <M>] [route-policy <RP>]protocols { <proto> { export [ policy <POL> ]; } }

Impact – While the high‑level concept is the same, the attachment point differs: FRR/EOS apply a route-map directly under the redistribution command; IOS‑XR references a route-policy; Junos uses an export policy within the protocol configuration. Mis‑mapping the policy


Share this post on:

Previous Post
Can AI predict BGP bestpath changes better than a checklist
Next Post
One Unbounded Field Can Break Segmentation