public
Description: A class that helps ISP's subnet their IPv4 and IPv6 address space.
Homepage: http://scie.nti.st
Clone URL: git://github.com/up_the_irons/ip_allocator.git
Click here to lend your support to: ip_allocator and make a donation at www.pledgie.com !
ip_allocator / RandomNotes.txt
100644 16 lines (11 sloc) 0.421 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Random Notes
------------
 
* Can go from IPAddr integer representation back to human-readable IP format using NetAddr:
 
  irb(main):091:0> ip=IPAddr.new("208.79.88.0/24")
  => #<IPAddr: IPv4:208.79.88.0/255.255.255.0>
  irb(main):092:0> ip.to_i
  => 3494860800
  irb(main):093:0> NetAddr.i_to_ip(_)
  => "208.79.88.0"
 
* There is also a NetAddr.ip_to_i(), so using IPAddr is unnecessary
 
* Look into NetAddr::CIDR#subnet