Issue with IP Passthrough in TiProxy

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tiproxy ip透传问题

| username: 林夕一指

[Test Environment for TiDB]
[TiDB Version]
[Reproduction Path] Deploy tiproxy within an existing TiDB cluster and configure proxy.proxy-protocol = “v2”, proxy-protocol.networks=‘ip’.
[Encountered Issue: Phenomenon and Impact] Access is normal, but show processlist still displays the IP of tiproxy instead of the real client IP.
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]
image

| username: TiDBer_jYQINSnf | Original post link

With a 7-layer proxy, it’s not possible to pass the IP through, right?

| username: 林夕一指 | Original post link

The document contains it, it should be possible.

| username: TiDBer_jYQINSnf | Original post link

I just looked up the proxy protocol, and it seems to do this job. I learned a new point. The proxy protocol carries the source IP and port in the TCP header.
I just saw that tidb-server also supports the proxy protocol, and it has supported it for a long time. This is really a useful feature!

| username: DBAER | Original post link

There is indeed a problem, it does not match the description in the documentation.

| username: 小于同学 | Original post link

With a 7-layer proxy, it’s not possible to pass the IP through, right?

| username: zhaokede | Original post link

Capture the packets and take a look; there should be a real IP inside.

| username: djshow832-PingCAP | Original post link

The package introduced in TiDB v6.5.0 has a bug and needs to be upgraded to v6.5.1. However, after the upgrade, the host’s IP is correct, but the port is always 0.

| username: 林夕一指 | Original post link

Thank you, expert.

| username: zhang_2023 | Original post link

TiProxy Configuration File | PingCAP Documentation Center

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.