-
Notifications
You must be signed in to change notification settings - Fork 0
/
bounce.slax.readme
29 lines (20 loc) · 1.21 KB
/
bounce.slax.readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
bounce interface script for Junos ver0.2
Practice excercise in SLAX by Martin White-Rose (Twitter: @aUsefulcom)
This script is implemented in SLAX ver 1.0 and tested against EX and SRX running Junos 17, Junos 18 and higher.
Based _heavily_ on script used in Juniper Education IJAUT course
----------
To Use this script:
1 - Copy the slax script to /var/db/scripts/op/ on your Junos Device
2 - at the [edit system scripts] heirachy issue "set op file bounce.slax"
3 - you can now issue "op bounce interface <interface-name> [wait <seconds]"
OPTIONS
interface - the physical interface you would like to bounce
wait - the time, in seconds, you would like to wait before re-enabling the interface (default 10 seconds if not set)
When called this script will
1 - Check that the Interface has been specified
2 - Check that no uncommitted changes exist in candidate - if found, will abort to avoid accidental changes.
3 - Check that the Interface is not currently Admin Down (and abort if it is, so as to avoid brining up a port that was down)
4 - Connect to MGD, disable the interface and commit
5 - Wait for specified time (or 10 seconds)
6 - re-enable the port and commit
7 - Disconnect from MGD and exit.