Last active
June 12, 2022 21:50
-
-
Save rkoshy/c88198916e82634e2fd020cc125fd571 to your computer and use it in GitHub Desktop.
Script to reset VyOS VTI interfaces that are stuck in "Administrative Down".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RUN=/opt/vyatta/bin/vyatta-op-cmd-wrapper | |
DOWN=`$RUN sh interfaces |grep "A/D"|awk '{print $1}'` | |
echo Interfaces that need resetting: $DOWN | |
for TUN in $DOWN | |
do | |
PEER=`$RUN sh interfaces vti $TUN |grep peer|sed -e"s/.* peer \([0-9\.]*\)/\1/"` | |
logger -t "reset_vti.sh" "Resetting $TUN with peer IP $PEER" | |
$RUN reset vpn ipsec-peer $PEER | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment