Created
June 8, 2011 11:36
-
-
Save click0/1014255 to your computer and use it in GitHub Desktop.
random generator ipv6 address
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/sh | |
# Copyright Andrey Mitrofanov | |
# Copyright pavlinux http://pavlinux.ru | |
# 2011 | |
MAXCOUNT=20 | |
count=0 | |
network_v6=2a01:7a0:2:12 # your ipv6 network prefix | |
rnd_ipv6_block () { | |
HEX="openssl rand -hex 8 | sed 's/..../:&/g'" | |
ipv6=$network_v6$(eval $HEX); | |
} | |
echo "$MAXCOUNT случайных IPv6:" | |
echo "-----------------" | |
while [ $count -lt $MAXCOUNT ] | |
do | |
count=`expr $count + 1` | |
rnd_ipv6_block | |
echo $ipv6 | |
done |
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/sh | |
# Copyright Andrey Mitrofanov | |
# Copyright pavlinux http://pavlinux.ru | |
# 2011 | |
MAXCOUNT=20 | |
count=0 | |
network_v6=2a01:7a0:2:12 # your ipv6 network prefix | |
rnd_ipv6_block () { | |
HEX="tr -dc "[:xdigit:]" < /dev/urandom | head -c 16 | sed 's/..../:&/g'" | |
ipv6=$network_v6$(eval $HEX); | |
} | |
echo "$MAXCOUNT случайных IPv6:" | |
echo "-----------------" | |
while [ $count -lt $MAXCOUNT ] | |
do | |
count=`expr $count + 1` | |
rnd_ipv6_block | |
echo $ipv6 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment