Updated on 2024-03-04 GMT+08:00

Enabling Client IP Pass-through

When a client of a DCS Redis 4.0/5.0/6.0 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 number of the client can be returned when O&M personnel run commands such as Client List, Monitor, and Slowlog Get.

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

Currently, the client IP pass-through function can be enabled on the console in the CN North-Beijing1, CN East-Shanghai2, and CN South-Guangzhou regions. To enable client IP pass-through in other regions, contact technical support.

Procedure

  1. Log in to the DCS console.
  2. Click in the upper left corner of the management 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.
  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 1 Before enabling client IP pass-through
    Figure 2 After enabling client IP pass-through

    Client IP pass-through works only on new connections. IP addresses of existing connections still start with 198.19.