Skip to content

Instantly share code, notes, and snippets.

@genofire
Created July 7, 2016 16:21
Show Gist options
  • Save genofire/1904c9885bedae2c85d49d8751cd3c3f to your computer and use it in GitHub Desktop.
Save genofire/1904c9885bedae2c85d49d8751cd3c3f to your computer and use it in GitHub Desktop.
Fast ipv6 connection by mac
#!/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}
#!/bin/bash
set -x
ssh root@$(ip6calc $1)%wlp3s0
@genofire
Copy link
Author

genofire commented Jul 7, 2016

genofire@notbook ~ % ssh6 0000000
++ ip6calc 14cc20ba7487
+ ssh root@fe80::20:ff:fe00:0%wlp3s0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment