I have a client and server. At Server I have a redirect rule to redirect all incoming flows to port 15006.
Client IP: 10.20.3.53
ServerIP : 10.20.3.63
I have the following iptables rules on the server(10.20.3.63):
# iptables -t nat -nvL PREROUTING
Chain PREROUTING (policy ACCEPT 581 packets, 34860 bytes)
pkts bytes target prot opt in out source destination
19191 1160K ISTIO_INBOUND tcp -- * * 0.0.0.0/0 0.0.0.0/0
# iptables -t nat -nvL ISTIO_INBOUND
Chain ISTIO_INBOUND (1 references)
pkts bytes target prot opt in out source destination
0 0 RETURN tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
19188 1151K RETURN tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:15020
10 9630 ISTIO_IN_REDIRECT tcp -- * * 0.0.0.0/0 0.0.0.0/0
# iptables -t nat -nvL ISTIO_IN_REDIRECT
Chain ISTIO_IN_REDIRECT (2 references)
pkts bytes target prot opt in out source destination
10 9630 REDIRECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 redir ports 15006
So, when I do a curl from the client (10.20.3.53) to server (10.20.3.63)
I am not able to see the redirected flow in the conntrack table, below is the conntrack table flow:
[NEW] tcp 6 120 SYN_SENT src=10.20.3.53 dst=10.20.3.63 sport=41876 dport=9080 [UNREPLIED] src=10.20.3.63 dst=10.20.3.53 sport=15006 dport=41876
[UPDATE] tcp 6 60 SYN_RECV src=10.20.3.53 dst=10.20.3.63 sport=41876 dport=9080 src=10.20.3.63 dst=10.20.3.53 sport=15006 dport=41876
[UPDATE] tcp 6 86400 ESTABLISHED src=10.20.3.53 dst=10.20.3.63 sport=41876 dport=9080 src=10.20.3.63 dst=10.20.3.53 sport=15006 dport=41876 [ASSURED]
[UPDATE] tcp 6 86400 src=10.20.3.53 dst=10.20.3.63 sport=41876 dport=9080 src=10.20.3.63 dst=10.20.3.53 sport=15006 dport=41876 [ASSURED] mark=61167
I always see the original flow with dport 9080, why can't I see the redirected flow with dport 15006.
Please, can someone help me understand how to get the redirected flow from conntrack.