ips masking

To mask the IPs addresses of your visitors in HAProxy, you can use the ipmask parameter.

It’s a mask, so the “reverse” value must be supplied.

In this example, the complete IP addresses (v4 and v6) are masked:

    log-format '%[src,ipmask(16,64)]\ [%t]\ %ft\ %b/%s\ %Tw/%Tc/%Tt\ %B\ %ts\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq'

In this example, only the last half of the IP addresses (v4 and v6) are masked:

    log-format '%[src,ipmask(8,32)]\ [%t]\ %ft\ %b/%s\ %Tw/%Tc/%Tt\ %B\ %ts\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq'

The IPV6 support appeared in the ipmask function appeared in HAProxy 1.9.

The complete IP address will be transfered to the possible proxied services.

The data is permanently lost in the logs: here a file.

And this is a good thing!