F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

Ken_Schultz_525's avatar
Ken_Schultz_525
Icon for Nimbostratus rankNimbostratus
Nov 06, 2014

How do I retrieve IPv6 address bits in an iRule

I want to pull bits of an IPv6 client address and manipulate them to create a SNAT address to hand to an IPv4-only pool? I know I don't need to do it this way, but I'm curious how to do the maniupation of the v6 address. I've been searching on devcentral and cannot find any examples of grabbing parts of a v6 address.

 

eg. 2001:abcd:1:2:3:4:5:6:7:8 gets mapped to 10.ab.cd.78 [aka 10.171.205.120 ]

 

1 Reply

  • R_Eastman_13667's avatar
    R_Eastman_13667
    Historic F5 Account

    Try this:

    set newIP [string map {2001:abcd:1:2:3:4:5:6:7:8 10.ab.cd.78} [IP::addr]]