ipcalc and sipcalc

Colin Watson cjwatson at ubuntu.com
Mon Nov 27 13:02:47 UTC 2017


On Sun, Nov 26, 2017 at 01:25:28PM +0100, Liam Proven wrote:
> On 26 November 2017 at 13:05, thufir <hawat.thufir at gmail.com> wrote:
> > Just looking at these two tools.  I see different online converts from
> > IPv4 to IPv6.  Can either or both of these tools perform that conversion?
> >
> > see:
> >
> > https://www.ultratools.com/tools/ipv4toipv6
> >
> > something like that?
> 
> *Wrinkled forehead*
> 
> What?
> 
> My IPv6 understand is weak -- although I have studied it for
> certification exams, I've never deployed it  -- but that makes no
> sense.
> 
> It's meaningless. It's like saying "here is what you'd look like if
> you had been born a pomegranate" or something. You can't _translate_
> addresses. Well, a gateway can, but it maintains an internal mapping
> table that is fairly meaningless.

[I'm an amateur network architect at best, but have deployed IPv6 at
home in a few different ways over the last 15 years or so.]

IPv4-mapped addresses are a real thing
(https://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses), but
they're pretty confusing since they imply using IPv6-specific tools to
talk to IPv4, and IME they aren't really all that useful in practical
deployments.  A conversion tool for this kind of address is also mostly
unnecessary, since there's syntactic sugar in the IPv6 address format
that lets you just say "::ffff:a.b.c.d" instead of having to convert the
four IPv4 address octets to hex; not much need for a conversion tool
that just adds seven characters to the start.

There are other conversions between IPv4 and IPv6 that can be
meaningful, for example in stateless NAT64 setups (such as RFC6052,
implemented in the tayga package), but those are quite special-purpose.
I wouldn't use that kind of thing for an ordinary dual-stack deployment.

(There's also 6to4, but I really wouldn't recommend using that.  It made
some more sense before the widespread availability of tunnels.  And
there's 6rd, which is supposed to be an improvement over 6to4 but I have
no experience of it since I've never had a provider that supports it;
nowadays my ISP just delegates me some real IPv6 space so it's been a
while since I thought much about transition mechanisms.)

Regarding the tools mentioned:

 * ipcalc is IPv4-only and knows nothing about IPv6.
 * sipcalc understands IPv6, but it's mainly a subnet calculator; as far
   as I can see its "v4 in v6" output mode is for converting the other
   way, i.e. taking an IPv6 address, assuming that it's an IPv4-mapped
   address, and rendering the last four octets in IPv4 style.

I'd generally recommend ipv6calc instead of either of these if you're
trying to do address conversions.  It supports 6to4, NAT64, and 6rd,
although my most common use of it is to work out what a hardware address
will end up as after stateless autoconfiguration; that's a fiddly
conversion that I can do by hand if I have to but would rather not!

-- 
Colin Watson                                       [cjwatson at ubuntu.com]




More information about the ubuntu-users mailing list