Skip to content

Instantly share code, notes, and snippets.

@mmattice
Created November 11, 2016 00:10
Show Gist options
  • Save mmattice/7169d89cda52e078003c824238782c22 to your computer and use it in GitHub Desktop.
Save mmattice/7169d89cda52e078003c824238782c22 to your computer and use it in GitHub Desktop.
# IOS 15.4
sed -r 's/(ip ospf authentication-key 7 |ip ospf message-digest-key 1 md5 7 )([0-9A-F]+)/\1*redacted*/;s/(snmp-server community )([^ ]+) (.*)$/\1*redacted* \3/'
# ASA 9.1
sed -i -r 's/( ospf message-digest-key [0-9]+ md5 )([^ ]+)(.*)$/\1*redacted*\3/;s/(snmp-server community )(.*)/\1*redacted*/;s/(ikev1 pre-shared-key )(.*)/\1*redacted*/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment