HPE Juniper - OP Script (Python) - Shutdown multiple interfaces - Think outsite the Box

HPE Juniper - OP Script (Python) - Shutdown multiple interfaces - Think outsite the Box

For a specific scenario, multiple interfaces on a Juniper SRX Series firewall need to be put into shutdown

Basic workflow (via serial console)

1. Enter CLI and configuration mode

cli
configure        
set interfaces ge-0/0/1 disable
set interfaces ge-0/0/2 disable ......
commit        

This should work fine... , wait a moment ....,. , hold my beer


  • we have only a "WAN / Serial) Connection, we have to put over approx 100 lines....


I would not to bet that is going to cut some lines .... , answer was : yepp


Let´s think outside the box : hmmm, can we have a script , than can localy run on the juniper srx ?

Op scripts enable you to make controlled changes to the Junos OS configuration. Op scripts are advantageous, because they can gather operational information about a device and update the configuration based on that information .....

https://www.juniper.net/documentation/us/en/software/junos/automation-scripting/topics/example/junos-script-automation-op-script-changing-configuration-python.html


ouhaaa !, some kind of "magic python script" can put down the interfaces with single command - YES

Article content

DRY-RUN

Article content

COMMIT

Article content

credits outside the Box Thinking

INE Security - ejPT


OffSec / Office Hours

To view or add a comment, sign in

More articles by Armin Hofer

Explore content categories