When you create your Network Load Balancer, in "Step 3: Configure Routing", for "Target type", you need to select "Instance". If you select "IP", your source IP will NOT be preserved.
Source IP Preservation If you specify targets using an instance ID, the source IP addresses of the clients are preserved and provided to your applications. If you specify targets by IP address, the source IP addresses are the private IP addresses of the load balancer nodes. If you need the IP addresses of the clients, enable Proxy Protocol and get the client IP addresses from the Proxy Protocol header.
Hope this helps,
Thank you, that solved the problem.
Updating the Elastic IP address of a Network Load Balancerasked 2 years ago
Network Load Balancer Headersasked 5 years ago
504 Gateway Time-out when setting up Application Load Balancerasked 6 months ago
Network Load Balancer not supporting Network Protocolsasked 8 months ago
Elastic Load Balancer to provide source IP address when not defined as HTTP LB.asked 4 months ago
Can a network load balancer front an API Gateway?asked 6 months ago
Cannot select a target group with alb target type when creating an application load balancerAccepted Answerasked a month ago
Create ECS service using existing load balancer with existing target groupasked 6 months ago
My Network Load Balancer is not enforcing the target Security groupasked 3 years ago
Obtain client IP address through a network load balancer (TCP socket server, Python)asked a month ago