Home / AWS

AWSChecklistAdvanced

Gateway Load Balancer inspection checklist: GENEVE, flow stickiness, target failover, health checks and idle timeouts

A production checklist for firewall fleets behind AWS Gateway Load Balancer - symmetric routing, GENEVE, stickiness, rebalance on failure, health checks and TCP idle timeouts that drop long flows.

Deepak Bhardwaj8 min read

Applies toAWS Gateway Load Balancer (GWLB), GWLB endpoints, third-party virtual firewalls and IDS appliances, AWS Transit Gateway inspection VPCs, AWS CLI v2

When to use this checklist

Use it before you put a firewall fleet behind a Gateway Load Balancer (GWLB), and again when inspected traffic has these symptoms:

  • Some flows hang while others through the same path work.
  • Long-lived connections (database sessions, SSH, message brokers) drop after a few minutes of idle time.
  • Connections reset after an appliance is patched, scaled in or fails a health check.
  • Traffic is fine in one Availability Zone and broken in another.

GWLB is a layer 3 load balancer. It takes every packet that reaches a GWLB endpoint (GWLBe), wraps it in GENEVE (UDP 6081) and sends it to one appliance. The appliance inspects the packet and returns it in the same GENEVE tunnel. Most failures come from three things: routing asymmetry, flow-to-appliance mapping changing mid-flow, and timeout mismatches.

Set these variables for the commands below:

LB_ARN=arn:aws:elasticloadbalancing:eu-west-1:111122223333:loadbalancer/gwy/fw-gwlb/0123456789abcdef
TG_ARN=arn:aws:elasticloadbalancing:eu-west-1:111122223333:targetgroup/fw-tg/0123456789abcdef
LISTENER_ARN=$(aws elbv2 describe-listeners --load-balancer-arn $LB_ARN --query "Listeners[0].ListenerArn" --output text)

1. Routing is symmetric per Availability Zone

  • There is one GWLBe per AZ, and each application subnet routes to the GWLBe in its own AZ.
  • For north-south ingress, the internet gateway has an edge-associated route table that sends each application subnet CIDR to the GWLBe in that subnet's AZ.
  • The application subnet's 0.0.0.0/0 points to the same-AZ GWLBe, and the GWLBe subnet's 0.0.0.0/0 points to the IGW or NAT gateway.
  • In a centralised inspection VPC behind Transit Gateway, appliance mode is enabled on the inspection VPC attachment. Without it, the forward and return packets of one flow can land in different AZs, reach different appliances, and a stateful firewall drops the return traffic.
aws ec2 describe-transit-gateway-vpc-attachments \
  --filters Name=vpc-id,Values=vpc-0inspection0000000 \
  --query "TransitGatewayVpcAttachments[].{id:TransitGatewayAttachmentId,appliance:Options.ApplianceModeSupport}"

aws ec2 modify-transit-gateway-vpc-attachment \
  --transit-gateway-attachment-id tgw-attach-0123456789abcdef0 \
  --options ApplianceModeSupport=enable

Tip

Use VPC Reachability Analyzer or Transit Gateway Route Analyzer to prove the forward and return paths. If the return path skips the GWLBe, the appliance only sees half of the flow.

2. GENEVE is allowed and the appliance can handle it

  • The target group protocol is GENEVE on port 6081. You can't change this, but check it was not created as something else by a module.
  • The appliance security group allows UDP 6081 from the GWLB subnets, plus the health check port.
  • The appliance software is configured for GWLB mode (GENEVE tunnel, responding inside the tunnel). Each vendor has its own setting for this.
  • The appliance handles the larger packets. GWLB supports packets up to 8500 bytes and adds a GENEVE header on top. If the appliance interface MTU is too small, large packets are dropped while small ones (pings, TCP handshakes) work. Check the GWLB documentation for the exact header overhead.
aws elbv2 describe-target-groups --target-group-arns $TG_ARN \
  --query "TargetGroups[0].{proto:Protocol,port:Port,hcProto:HealthCheckProtocol,hcPort:HealthCheckPort,hcPath:HealthCheckPath}"

3. Health checks test the data path

GWLB health checks use HTTP, HTTPS or TCP. They don't go through the GENEVE tunnel. An appliance can pass a TCP check on its management plane while its data plane is down.

  • The health check is HTTP or HTTPS and hits an endpoint that reports data plane health. A TCP check on port 22 or 443 of the management interface is not enough.
  • Thresholds are tight enough to remove a dead appliance quickly, but not so tight that a busy appliance flaps.
aws elbv2 modify-target-group --target-group-arn $TG_ARN \
  --health-check-protocol HTTP --health-check-port 80 --health-check-path /health \
  --health-check-interval-seconds 10 --healthy-threshold-count 3 --unhealthy-threshold-count 2

aws elbv2 describe-target-health --target-group-arn $TG_ARN \
  --query "TargetHealthDescriptions[].{id:Target.Id,az:Target.AvailabilityZone,state:TargetHealth.State,reason:TargetHealth.Reason}" \
  --output table

4. Flow stickiness matches the appliance

By default, GWLB maps flows using the 5-tuple: source IP, destination IP, protocol, source port, destination port. You can switch to 3-tuple or 2-tuple stickiness:

Setting Attributes Use when
5-tuple (default) stickiness.enabled=false Most stateful firewalls. Needed if you want GWLB to send TCP resets
3-tuple stickiness.enabled=true, stickiness.type=source_ip_dest_ip_proto The appliance needs every flow between two hosts on one protocol in one place
2-tuple stickiness.enabled=true, stickiness.type=source_ip_dest_ip Protocols that open related flows on other ports (FTP active mode, SIP, some VPNs)
  • Stickiness is the default unless the appliance vendor asks for something else. 2-tuple stickiness lets one busy host pair overload a single appliance.
aws elbv2 describe-target-group-attributes --target-group-arn $TG_ARN --output table

5. Target failover behaviour is a conscious choice

When an appliance fails a health check or is deregistered, GWLB by default keeps sending existing flows to it (no_rebalance). Only new flows go to healthy targets. With rebalance, existing flows move to a healthy appliance. A stateful firewall that never saw the TCP handshake usually drops those packets, unless the vendor syncs state across the cluster.

Appliance capability Recommended setting
No state sync between appliances no_rebalance plus a deregistration delay long enough to drain
State sync across the fleet rebalance, so flows survive an appliance failure
Stateless inspection or IDS-only rebalance

You have to set both attributes to the same value:

aws elbv2 modify-target-group-attributes --target-group-arn $TG_ARN \
  --attributes Key=target_failover.on_deregistration,Value=rebalance \
               Key=target_failover.on_unhealthy,Value=rebalance

aws elbv2 modify-target-group-attributes --target-group-arn $TG_ARN \
  --attributes Key=deregistration_delay.timeout_seconds,Value=300

Warning

With no_rebalance, flows pinned to a dead appliance black-hole until they time out. Long-lived connections can hang for minutes after the appliance fails. Pick the setting with the appliance vendor, and test it by stopping an appliance under load before you rely on it.

6. Idle timeouts line up end to end

GWLB tracks each TCP flow. After the idle timeout it forgets the flow, and the next packet may be hashed to a different appliance. The default TCP idle timeout is 350 seconds, and you can set it on the listener from 60 to 6000 seconds. Non-TCP flows use a fixed timeout.

  • Applications with idle connections longer than the GWLB timeout send keep-alives, or the GWLB timeout is raised.
  • If you raise the GWLB timeout above 350 seconds, the appliance ENI's connection tracking timeout (TcpEstablishedTimeout) is equal to or greater than it.
  • The appliance's own session table timeout is not shorter than the GWLB timeout.
aws elbv2 describe-listener-attributes --listener-arn $LISTENER_ARN
aws elbv2 modify-listener-attributes --listener-arn $LISTENER_ARN \
  --attributes Key=tcp.idle_timeout.seconds,Value=1800

# On each appliance's data ENI
aws ec2 modify-network-interface-attribute --network-interface-id eni-0123456789abcdef0 \
  --connection-tracking-specification TcpEstablishedTimeout=1800

7. Cross-zone and capacity per AZ

Cross-zone load balancing is off by default. Each GWLBe sends traffic only to appliances in its own AZ.

  • Every enabled AZ has enough healthy appliances to handle a full AZ's peak load, with one appliance down.
  • If you turn cross-zone on, you accept inter-AZ data transfer charges and possible cross-AZ paths through the appliance.
aws elbv2 describe-load-balancer-attributes --load-balancer-arn $LB_ARN \
  --query "Attributes[?Key=='load_balancing.cross_zone.enabled']"

Caution

If every appliance in an AZ is unhealthy and cross-zone is off, that AZ's inspected traffic is not inspected properly. Check the ELB documentation for how your load balancer behaves when no targets are healthy, and alarm on HealthyHostCount per AZ before that happens.

8. Monitoring

Alarm on these AWS/GatewayELB metrics, per AZ where the dimension is available:

Metric Alarm on
HealthyHostCount Below the minimum appliances per AZ
UnHealthyHostCount Above zero for several periods
ActiveFlowCount Approaching the appliance vendor's rated session count
NewFlowCount Sudden spikes (scans, retry storms)
ProcessedBytes Approaching appliance throughput limits
aws cloudwatch get-metric-statistics --namespace AWS/GatewayELB --metric-name HealthyHostCount \
  --dimensions Name=LoadBalancer,Value=gwy/fw-gwlb/0123456789abcdef Name=TargetGroup,Value=targetgroup/fw-tg/0123456789abcdef \
  --start-time $(date -u -d '-1 hour' +%FT%TZ) --end-time $(date -u +%FT%TZ) \
  --period 60 --statistics Minimum

Prevent it next time

  • Keep the attributes from this checklist in Terraform or CloudFormation, so a rebuilt target group doesn't fall back to defaults.
  • Run a failure drill each quarter: stop one appliance under synthetic load with long-lived connections, and measure how long flows take to recover.
  • When an appliance vendor upgrade changes state sync, review the target_failover setting.
  • Document the timeout chain (application keep-alive, GWLB idle timeout, ENI conntrack, appliance session timeout) in the runbook for the inspection VPC.