Forum Discussion
Can I bind a virtual server port to real server port via iRule for every connection
I have this requirement -
One Client owns the server. Only client know on what port a service is running in that server. They want to send port info as some data in the connection. Since I have no real server port info, I can't bind virtual server port to real server port.
When Client connects to virtual server/port, I want to write an iRule that will parse data in that connection and extract port number. Using the port number in the parsed data, client connection is forwarded to real server.
Customer has 1000 servers with 20 services in each server.
Any help is really appreciated.
Thanks to all
-Ramesh
11 Replies
- kunjan
Nimbostratus
Is the destination port of the incoming traffic to the LTM different from the port the server listening to?
- ram-esh_161164
Nimbostratus
I don't know on what port the service is running. Client will provide to me in the payload.
- kunjan_118660
Cumulonimbus
Is the destination port of the incoming traffic to the LTM different from the port the server listening to?
- ram-esh_161164
Nimbostratus
I don't know on what port the service is running. Client will provide to me in the payload.
- Kevin_Davies_40
Nacreous
Can you tell us what you are trying to do overall. I get the impression this is only part of the picture.
- ram-esh_161164
Nimbostratus
Real server port number is not available. I can bind vip to real server IP. But can't bind to a port on the real server. Client provides me this port number in the payload. I need to parse the payload and extract the port number and continue my connection to real server. Every time a client makes a connection to vip, it provides me real server port number in the payload. Everytime, I have to run the script to find real server port number and then connect to real server port to complete the connection from client to real server.
- kunjan
Nimbostratus
How does the payload looks like with the port information?
- ram-esh_161164
Nimbostratus
First 2 bytes of payload contain port information.
- kunjan_118660
Cumulonimbus
How does the payload looks like with the port information?
- ram-esh_161164
Nimbostratus
First 2 bytes of payload contain port information.
- kunjan
Nimbostratus
I assume 2 bytes referred is in TCP payload.
Try this:
when CLIENT_ACCEPTED { TCP::collect } when CLIENT_DATA { set port [TCP::payload 2] TCP::release } when LB_SELECTED { node [LB::server addr] $port LB::reselect }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com