Convert IPv4 to IPv6

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon

    Convert IPv4 to IPv6

    Hi,

    is there a straight forward way of converting IPv4 to IPv6?

    I thought that it was just a matter of converting 32 bits to 128 bits, (by
    adding 96 leading 0s), but that does not seem right in some/most cases.

    For example, 127.0.0.1, (IPv4 localhost), does not convert ::1, (IPv6
    localhost)

    so, is there a function/script/technique to convert IPv4 to IPv6?

    Thanks

    Simon

  • The Hajj

    #2
    Re: Convert IPv4 to IPv6

    I don't know the math as I don't deal with networking anymore. You
    could try splitting IP4 into it's octets and apply the math like that
    then reassemble.

    Comment

    • Michael Fesser

      #3
      Re: Convert IPv4 to IPv6

      ..oO(Simon)
      >is there a straight forward way of converting IPv4 to IPv6?
      Have a look at the IPv6 RFC and/or its Wikipedia entry. IIRC there's an
      address range reserved for mapping the old IPv4 addresses.
      >I thought that it was just a matter of converting 32 bits to 128 bits, (by
      >adding 96 leading 0s), but that does not seem right in some/most cases.
      It's a totally different numbering system.

      Micha

      Comment

      • Simon

        #4
        Re: Convert IPv4 to IPv6

        >
        >>is there a straight forward way of converting IPv4 to IPv6?
        >
        Have a look at the IPv6 RFC and/or its Wikipedia entry. IIRC there's an
        address range reserved for mapping the old IPv4 addresses.
        Yes, I had a look at it, and my impression was that IPv6 was the successor
        of IPv4 so 32bits had been reserved to allow for backward compatibilities .
        >
        >>I thought that it was just a matter of converting 32 bits to 128 bits, (by
        >>adding 96 leading 0s), but that does not seem right in some/most cases.
        >
        It's a totally different numbering system.
        I wouldn't go as far as asying 'totally'.

        127.0.0.1 -01111111.000000 00.00000000.000 00001 ->
        011111110000000 0:0000000000000 001 - 7f00:0001
        Micha
        Simon

        Comment

        • Simon

          #5
          Re: Convert IPv4 to IPv6

          >I don't know the math as I don't deal with networking anymore. You
          could try splitting IP4 into it's octets and apply the math like that
          then reassemble.
          That was my first impression.
          But given that the range 127.0.0.0/8 is reserved for loopback and ::1 does
          fall within the range 127.0.0.0/8.
          it makes me think that the conversion is not as straight forward as I would
          have thought, (as 127.0.0.1 is ::7f00:1)

          Simon

          Comment

          • Michael Fesser

            #6
            Re: Convert IPv4 to IPv6

            ..oO(Simon)
            >>>is there a straight forward way of converting IPv4 to IPv6?
            >>
            >Have a look at the IPv6 RFC and/or its Wikipedia entry. IIRC there's an
            >address range reserved for mapping the old IPv4 addresses.
            >
            >Yes, I had a look at it, and my impression was that IPv6 was the successor
            >of IPv4 so 32bits had been reserved to allow for backward compatibilities .
            Reserving 32 bits would drastically reduce the address space. But the
            range ::ffff:0:0/96 seems to be reserved for the old IPv4 addresses. It
            shouldn't be too difficult to do the mapping.


            >>>I thought that it was just a matter of converting 32 bits to 128 bits, (by
            >>>adding 96 leading 0s), but that does not seem right in some/most cases.
            >>
            >It's a totally different numbering system.
            >
            >I wouldn't go as far as asying 'totally'.
            >
            >127.0.0.1 -01111111.000000 00.00000000.000 00001 ->
            >01111111000000 00:000000000000 0001 - 7f00:0001
            Sure, but in IPv6 the loopback device is ::1, which has nothing to do
            with 127.0.0.1 or 7f00:0001 (which is not even valid IPv6, BTW). The
            same applies to the old local addresses like 192.168.x.y for example.

            Micha

            Comment

            • Ivan Marsh

              #7
              Re: Convert IPv4 to IPv6

              On Wed, 13 Aug 2008 22:00:28 +0200, Michael Fesser wrote:
              .oO(Simon)
              >
              >>>>is there a straight forward way of converting IPv4 to IPv6?
              >>>
              >>Have a look at the IPv6 RFC and/or its Wikipedia entry. IIRC there's
              >>an address range reserved for mapping the old IPv4 addresses.
              >>
              >>Yes, I had a look at it, and my impression was that IPv6 was the
              >>successor of IPv4 so 32bits had been reserved to allow for backward
              >>compatibiliti es.
              >
              Reserving 32 bits would drastically reduce the address space. But the
              range ::ffff:0:0/96 seems to be reserved for the old IPv4 addresses. It
              shouldn't be too difficult to do the mapping.
              >

              >
              >>>>I thought that it was just a matter of converting 32 bits to 128 bits,
              >>>>(by adding 96 leading 0s), but that does not seem right in some/most
              >>>>cases.
              >>>
              >>It's a totally different numbering system.
              >>
              >>I wouldn't go as far as asying 'totally'.
              >>
              >>127.0.0.1 -01111111.000000 00.00000000.000 00001 ->
              >>0111111100000 000:00000000000 00001 - 7f00:0001
              >
              Sure, but in IPv6 the loopback device is ::1, which has nothing to do
              with 127.0.0.1 or 7f00:0001 (which is not even valid IPv6, BTW). The
              same applies to the old local addresses like 192.168.x.y for example.
              Things that are different aren't the same.

              --
              I told you this was going to happen.

              Comment

              • Simon

                #8
                Re: Convert IPv4 to IPv6

                >>
                >Sure, but in IPv6 the loopback device is ::1, which has nothing to do
                >with 127.0.0.1 or 7f00:0001 (which is not even valid IPv6, BTW). The
                >same applies to the old local addresses like 192.168.x.y for example.
                >
                Things that are different aren't the same.
                >
                ???

                Simon

                Comment

                • Simon

                  #9
                  Re: Convert IPv4 to IPv6

                  >>>>is there a straight forward way of converting IPv4 to IPv6?
                  >>>
                  >>Have a look at the IPv6 RFC and/or its Wikipedia entry. IIRC there's an
                  >>address range reserved for mapping the old IPv4 addresses.
                  >>
                  >>Yes, I had a look at it, and my impression was that IPv6 was the successor
                  >>of IPv4 so 32bits had been reserved to allow for backward compatibilities .
                  >
                  Reserving 32 bits would drastically reduce the address space. But the
                  range ::ffff:0:0/96 seems to be reserved for the old IPv4 addresses. It
                  shouldn't be too difficult to do the mapping.
                  >
                  http://en.wikipedia.org/wiki/IPv4_mapped_address
                  yeah, but some source say that the notation has been deprecated.
                  in fact my Vista picks up ping ::7f00:1 as ping 127.0.0.1
                  but it does the same for ping ::ffff:7f00:1
                  >>
                  >>127.0.0.1 -01111111.000000 00.00000000.000 00001 ->
                  >>0111111100000 000:00000000000 00001 - 7f00:0001
                  >
                  Sure, but in IPv6 the loopback device is ::1, which has nothing to do
                  with 127.0.0.1 or 7f00:0001 (which is not even valid IPv6, BTW). The
                  same applies to the old local addresses like 192.168.x.y for example.
                  >
                  Si was converting as an example from decimal to binary and so forth, and
                  there were only 32 bits in my example not 128,
                  So the whole thing was not really going to be valid IPv6.
                  Micha
                  Simon

                  Comment

                  • Michael Fesser

                    #10
                    Re: Convert IPv4 to IPv6

                    ..oO(Simon)
                    >Reserving 32 bits would drastically reduce the address space. But the
                    >range ::ffff:0:0/96 seems to be reserved for the old IPv4 addresses. It
                    >shouldn't be too difficult to do the mapping.
                    >>
                    >http://en.wikipedia.org/wiki/IPv4_mapped_address
                    >
                    >yeah, but some source say that the notation has been deprecated.
                    >in fact my Vista picks up ping ::7f00:1 as ping 127.0.0.1
                    >but it does the same for ping ::ffff:7f00:1
                    According to RFC 4291 the first version is deprecated.

                    This specification defines the addressing architecture of the IP Version 6 (IPv6) protocol. The document includes the IPv6 addressing model, text representations of IPv6 addresses, definition of IPv6 unicast addresses, anycast addresses, and multicast addresses, and an IPv6 node's required addresses. This document obsoletes RFC 3513, "IP Version 6 Addressing Architecture". [STANDARDS-TRACK]


                    Micha

                    Comment

                    • Ivan Marsh

                      #11
                      Re: Convert IPv4 to IPv6

                      On Wed, 13 Aug 2008 23:23:23 +0200, Simon wrote:

                      >>Sure, but in IPv6 the loopback device is ::1, which has nothing to do
                      >>with 127.0.0.1 or 7f00:0001 (which is not even valid IPv6, BTW). The
                      >>same applies to the old local addresses like 192.168.x.y for example.
                      >>
                      >Things that are different aren't the same.
                      >
                      ???
                      >
                      Simon
                      There is no correlation between the special addresses or ranges in IPv4
                      and IPv6 so I'm not sure how there could be a meaningful mathematical
                      conversion.


                      --
                      I told you this was going to happen.

                      Comment

                      • Simon

                        #12
                        Re: Convert IPv4 to IPv6

                        >>
                        >???
                        >>
                        >Simon
                        >
                        There is no correlation between the special addresses or ranges in Ivy
                        and Ivy so I'm not sure how there could be a meaningful mathematical
                        conversion.
                        >
                        You are mistaken, room was made for Ivy in Ivy, they are not poles apart.
                        Look at some of the links given in this thread.

                        Simon

                        Comment

                        • Simon

                          #13
                          Re: Convert IPv4 to IPv6

                          >>Reserving 32 bits would drastically reduce the address space. But the
                          >>range ::ffff:0:0/96 seems to be reserved for the old IPv4 addresses. It
                          >>shouldn't be too difficult to do the mapping.
                          >>>
                          >>http://en.wikipedia.org/wiki/IPv4_mapped_address
                          >>
                          >>yeah, but some source say that the notation has been deprecated.
                          >>in fact my Vista picks up ping ::7f00:1 as ping 127.0.0.1
                          >>but it does the same for ping ::ffff:7f00:1
                          >
                          According to RFC 4291 the first version is deprecated.
                          >
                          http://tools.ietf.org/html/rfc4291#section-2.5.5
                          Thanks for the links,
                          that should keep me going for now.
                          >
                          Micha
                          Simon

                          Comment

                          • Ivan Marsh

                            #14
                            Re: Convert IPv4 to IPv6

                            On Thu, 14 Aug 2008 00:58:04 +0200, Simon wrote:

                            >There is no correlation between the special addresses or ranges in Ivy
                            >and Ivy so I'm not sure how there could be a meaningful mathematical
                            >conversion.
                            >>
                            You are mistaken, room was made for Ivy in Ivy, they are not poles
                            apart. Look at some of the links given in this thread.
                            Pardon... that should have said "If".

                            It seems odd that googling for the bitwise equation yields nothing of
                            value.

                            --
                            I told you this was going to happen.

                            Comment

                            • Simon

                              #15
                              Re: Convert IPv4 to IPv6

                              >
                              >>There is no correlation between the special addresses or ranges in Ivy
                              >>and Ivy so I'm not sure how there could be a meaningful mathematical
                              >>conversion.
                              >>>
                              >You are mistaken, room was made for Ivy in Ivy, they are not poles
                              >apart. Look at some of the links given in this thread.
                              >
                              Pardon... that should have said "If".
                              'If' what?
                              What are you talking about?

                              You clearly don't know what you are talking about and you think that giving
                              some semi-cryptic replies will make me think you do.
                              So, as I said, have a look at some of the pages given in this thread and you
                              might learn something.
                              >
                              It seems odd that googling for the bitwise equation yields nothing of
                              value.
                              >
                              No it does not seem odd, you probably did something wrong, I am not also
                              going to teach you how to use Google as well.
                              Tell me what terms you used and I might be able to help you.

                              Otherwise I am tired of guessing what you are trying to say.

                              Simon

                              Comment

                              Working...