Created
July 7, 2016 16:21
-
-
Save genofire/1904c9885bedae2c85d49d8751cd3c3f to your computer and use it in GitHub Desktop.
Fast ipv6 connection by mac
This file contains 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 | |
if [[ $1 != *":"* ]] | |
then | |
MAC="${1:0:2}:${1:2:2}:${1:4:2}:${1:6:2}:${1:8:2}:${1:10:2}" | |
else | |
MAC=$1 | |
fi | |
PREFIX=fe80 | |
IFS=':'; set $MAC; unset IFS | |
printf "$PREFIX::%x%x:%x:%x:%x\n" $(( 0x${1} ^ 0x02 )) 0x${2} 0x${3}ff 0xfe${4} 0x${5}${6} |
This file contains 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 | |
set -x | |
ssh root@$(ip6calc $1)%wlp3s0 |
Author
genofire
commented
Jul 7, 2016
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment