Help Center/ Distributed Cache Service/ User Guide/ Managing Instances/ Returning the Real IP Addresses of a Client to DCS (IP Pass-through)
Updated on 2025-09-02 GMT+08:00

Returning the Real IP Addresses of a Client to DCS (IP Pass-through)

When a client of a DCS Redis 4.0 or later instance connects to the server through a VPC endpoint, the source IP address displayed on the server belongs to the VPC endpoint (starting with 198.19), and it is not the real client IP address.

After the client IP pass-through function is enabled, the real IP address and port of a client can be returned when O&M personnel manage sessions or run commands such as Client List, Monitor, and Slowlog Get.

For Redis 3.0, run CLIENT LIST to view the real client IP address.

Notes and Constraints

  • Currently, enabling client IP pass-through on the console is available only in CN Beijing1, CN Beijing4, CN Shanghai1, CN Shanghai2, CN Guangzhou, CN Shenzhen, CN Guiyang1, AP-Singapore, CN-Hong Kong, CN Ulanqab1, AP-Bangkok, and AF-Johannesburg regions. To enable this function in other regions, submit a ticket and contact customer service.
  • SSL encryption and client IP pass-through cannot be enabled at the same time for instances.
  • Client IP pass-through works only on new connections upon sending a Redis command. IP addresses of existing connections still start with 198.19.

Configuring Client IP Pass-through

  1. Log in to the DCS console.
  2. Click in the upper left corner of the console and select the region where your instance is located.
  3. In the navigation pane, choose Cache Manager.
  4. On the Cache Manager page, click the name of the DCS instance for which you want to enable client IP pass-through.
  5. In the Connection area, click next to Client IP Pass-through.

    Figure 1 Configuring client IP pass-through

  6. View the client IP address. (The following uses the Client List command as an example.)

    In the record that contains "network=vpc", the value of addr is the client IP address.

    Figure 2 Before enabling client IP pass-through
    Figure 3 After enabling client IP pass-through

    Client IP pass-through works only on new connections upon sending a Redis command. IP addresses of existing connections still start with 198.19.