F5 Sites
  • F5.com
  • LearnF5
  • NGINX
  • MyF5
  • Partner Central
Contact
  • Under Attack?
  • F5 Support
  • DevCentral Support
  • F5 Sales
  • NGINX Sales
  • F5 Professional Services
Skip to contentBrand Logo
Forums
CrowdSRC
Articles
Groups
EventsSuggestionsHow Do I...?
RegisterSign In
  1. DevCentral
  2. CrowdSRC
  3. CodeShare

Proxy Protocol Receiver

Problem this snippet solves: iRule for BIG-IP to receive PROXY protocol (v1 and v2) header in TCP Payload and remove it before forwarding remaining TCP Payload to server side pool member. How to us...
Published Sep 02, 2015
Version 1.0
application delivery
devops
elb
haproxy
iRules
LTM
proxy
Chad_Jenison's avatar
Chad_Jenison
Icon for Nimbostratus rankNimbostratus
Joined May 13, 2008
View Profile
Chad_Jenison's avatar
Chad_Jenison
Icon for Nimbostratus rankNimbostratus
Joined May 13, 2008
View Profile
Lucas_Barriere_'s avatar
Lucas_Barriere_
Icon for Nimbostratus rankNimbostratus
Jun 15, 2018

Hi everyone,

Using F5 on AWS, I encountered an issue using a Network Load Balancer and therefore ProxyProtocol V2. AWS also specified in the header the id of the vpc endpoint therefore, line 34, the shift of 28 octets is wrong. I had to read the content of the 15th and 16th octets which indicates the size of this payload (variable in size):

binary scan [TCP::payload] @13H2S v2_addressFamilyTransportProtocol v2_remainderLen1

and add this to the size of the initial payload (16 octets):

 set v2_remainderLen "[expr {$v2_remainderLen1 & 0xffff}]"
 set v2_payloadindex "[expr $v2_remainderLen + 16]"
 log "Shift de : $v2_payloadshift"
 TCP::payload replace 0 $v2_payloadindex ""

Please forgive my TCL, this is my first time 🙂

ABOUT DEVCENTRAL

DevCentral NewsTechnical ForumTechnical ArticlesTechnical CrowdSRCCommunity GuidelinesDevCentral EULAGet a Developer Lab LicenseBecome a DevCentral MVP

RESOURCES

Product DocumentationWhite PapersGlossaryCustomer StoriesWebinarsFree Online CoursesF5 CertificationLearnF5 Training

SUPPORT

Manage SubscriptionsProfessional ServicesProfessional ServicesCreate a Service RequestSoftware DownloadsSupport Portal

PARTNERS

Find a Reseller PartnerTechnology AlliancesBecome an F5 PartnerLogin to Partner Central

F5 logo©2024 F5, Inc. All rights reserved.
TrademarksPoliciesPrivacyCalifornia PrivacyDo Not Sell My Personal Information