0 Replies Latest reply on Mar 27, 2013 1:13 PM by RichardLetts

    Converting dotted decimal into IPv6 address

    RichardLetts

      On Juniper routers they have vendor-specific traps for BGP and IPv6. One of the varbinds look like this:

      jnxBgpM2PeerRemoteAddr.0.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.38.7.250.120.0.0.0.0.0.0.0.0.0.0.120.28= 38.7.250.120

       

      this bit:

      38.7.250.120.0.0.0.0.0.0.0.0.0.0.120.28

      should get translated thus:

       

      387250120000000000012028
      2607FA7800000000000000000000781C

      Which is the IPv6 address of a router.

       

      Anyone suggest any incantation to convert from the dotted-decimal to the HEX version?

       

      [note I'm almost certain the oidValue is being truncated to 4 bytes since the trap knows this is an IP address and assumes that it's an ipv4 addresses]

       

      Thanks