Juniper SRX exit the configuration mode before committing
See original GitHub issueIs below code correct for Juniper SRX? This works for MX’s but with SRX, what I see is in debug mode, code exists the configuration mode without committing the changes. Workaround is to send a commit CLI as part of configuration commands sent along configuration items.
net_connect.config_mode()
if net_connect.check_config_mode():
print("Successfully in config mode")
net_connect.send_config_set(config_cmds)
net_connect.commit()
net_connect.exit_config_mode()
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Committing a Junos OS Configuration and Exiting ...
To save Junos OS configuration changes, activate the configuration on the device and exit configuration mode, using the commit and-quit configuration mode ......
Read more >Juniper configuration basics.Commit\Rollback. - isp-tech.ru
In this mode, everyone can edit config at the same time. When configuration is committed by any user, all changes are applied. If...
Read more >Discard configuration changes for a Juniper SRX router/firewall
If you've been entering commands for configuration changes on a Juniper Neworks SRX router/firewall, which runs the Juniper Network ...
Read more >Commit command Juniper Junos OS - YouTube
... (Optional)— Commit the configuration and, if the configuration contains no errors and the commit succeeds, exit from configuration mode.
Read more >6. Junos commit and rollback commands
Junos “commit” command apply configuration changes to active configuration. Up to 50 configuration changes are stored in juniper devices.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tee-lake You should be able to do the following then:
Basically, don’t exit config mode on the changes. Then use the commit() method to commit the changes (and_quit just causes it to exit config mode after the commit).
I’ll have to test if the above provides the desired result. However a quick look into “exit configuration-mode”. I do not think this works as demonstrated above for high-end srx device. Please see below {primary:node0} srx-5800-01> edit warning: Clustering enabled; using private edit warning: uncommitted changes will be discarded on exit Entering configuration mode {primary:node0}[edit] srx-5800-01# set security zones security-zone zoneA address-book address 10.10.10.10/32 10.10.10.10/32
{primary:node0}[edit] srx-5800-01# sh|compare [edit security zones security-zone zoneA address-book] address 10.12.19.0/18 { … } + address 10.10.10.10/32 10.10.10.10/32;
{primary:node0}[edit] srx-5800-01# exit configuration-mode The configuration has been changed but not committed Exiting configuration mode
{primary:node0} srx-5800-01> configure warning: Clustering enabled; using private edit warning: uncommitted changes will be discarded on exit Entering configuration mode
{primary:node0}[edit] srx-5800-01# sh|compare
{primary:node0}[edit] srx-5800-01#
Thus I believe the config pasted is discarded once you leave config mode.