Skip to content

Junos next-hop self in import policy: device does not rewrite, Batfish predicts rewrite #189

@dhalperi

Description

@dhalperi

Problem

When a Junos then block in an import policy contains next-hop self, the device does not rewrite the route's next-hop. Batfish predicts the next-hop is set to the local interface IP, producing a mismatch.

Technical Details

next-hop self is documented to apply on egress (export to peer). On import, the action is retained in the post-commit config but the route's next-hop in the RIB remains the sender's interface IP.

Observed:

  • Source action: then next-hop self (in an import policy term).
  • Device show route: next-hop = sender-side interface IP (e.g., 10.0.12.0).
  • Batfish prediction: next-hop = local-side interface IP (e.g., 10.0.12.1).

Observed In

junos_then_action_conflicts, prefixes 10.50.32-35 (AIGP-ORIGINATE terms — these include next-hop self to satisfy Junos's commit-time constraint that AIGP-originate requires next-hop in the same then block).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions