Showing posts with label IPv6. Show all posts
Showing posts with label IPv6. Show all posts

Thursday, November 13, 2014

IPv6 Supernetting Subnetting Ruby

#!/usr/local/bin/ruby -w
require 'ipaddr' 

# /32 CIDR -> /40's (LONG)
(0..255).each { |x|  puts IPAddr.new("1234:5678:#{sprintf("%02x",x)}00::0").to_i }

# /32 CIDR -> /48's (LONG)
(0..255).each { |x|  puts IPAddr.new("1234:5678:00#{sprintf("%02x",x)}::0").to_i }

IPv6 To PTR RDNS PHP

<?php
$addr = inet_pton($ip);
$unpack = unpack('H*hex', $addr);
$hex = $unpack['hex'];
$arpa = implode('.', array_reverse(str_split($hex))) . '.ip6.arpa';
?>

Thursday, February 7, 2013

Turn Off And Disable IPv6 In Linux

touch /etc/modprobe.d/disable-ipv6
echo "options ipv6 disable=1" >> /etc/modprobe.d/disable-ipv6
You'll also want to set "NETWORKING_IPV6" to "NO" in this file:
/etc/sysconfig/network
...and then reboot.