Skip to content

Instantly share code, notes, and snippets.

@ksator
Last active July 30, 2022 05:30
Show Gist options
  • Save ksator/ffebfabdc2754c37b2e0b2532f87fa1b to your computer and use it in GitHub Desktop.
Save ksator/ffebfabdc2754c37b2e0b2532f87fa1b to your computer and use it in GitHub Desktop.
"load replace terminal" on Junos

This is similar to NETCONF RPC edit-config with replace

pytraining@newhostname# show protocols bgp
log-updown;
group underlay {
    type external;
    import bgp-in;
    export bgp-out;
    local-as 209;
    multipath multiple-as;
    neighbor 192.168.10.4 {
        peer-as 210;
    }
    neighbor 192.168.10.0 {
        peer-as 204;
    }
}
pytraining@newhostname# load replace terminal ?
Possible completions:
  <[Enter]>            Execute this command
  relative             Load contents relative to current edit point
  |                    Pipe through a command
pytraining@newhostname# load replace terminal
[Type ^D at a new line to end input]
protocols {
    bgp {
         replace:
         group underlay {
            type external;
            import bgp-in;
            export bgp-out;
            local-as 209;
            multipath multiple-as;
            neighbor 192.168.10.4 {
                peer-as 210;
            }
            neighbor 192.168.10.8 {
                peer-as 204;
            }
        }
    }
}
load complete
pytraining@newhostname# commit
configuration check succeeds
commit complete
pytraining@newhostname# show | compare rollback 1
[edit protocols bgp group underlay]
      neighbor 192.168.10.4 { ... }
+     neighbor 192.168.10.8 {
+         peer-as 204;
+     }
-     neighbor 192.168.10.0 {
-         peer-as 204;
-     }

pytraining@newhostname#
@AbeRoquel
Copy link

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment