Forum Discussion

Mike_61577's avatar
Mike_61577
Icon for Nimbostratus rankNimbostratus
Jun 03, 2009

Redirect TCP connection based on hostname?

Hey guys,

 

Is it possible to redirect a connection based on the hostname that the request came in for? For example:

 

 

Two CNAME's pointing to the same IP. Let's call them "host1" and "host2". I want to be able to take a TCP request for "host1" and send it to a specific node behind the BIG-IP. If a TCP request comes in for "host2", I want to send it to a different node.

 

 

This is NOT for HTTP (otherwise I'd use the HTTP_REQUEST object). I can't find the requested hostname anywhere in the TCP object.

 

 

Ideas?

 

 

Thanks guys!

 

 

- Mike O'Connor
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Since TCP has no real sense of a host header, you'd have to do an inspection on the payload itself and pull out the information you're looking for, assuming it's

     

    stored somewhere within the transaction.

     

     

    You can use the TCP::collect and TCP::payload commands for this.

     

     

    Colin
  • It's an SSH connection, but the end host is doing the handshake. Is it safe to assume even if the host information is available inside the payload, the BIG-IP won't be able to read it?
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Yeah, if it's encrypted all the way through to the back-end we can't inspect it.

     

     

    Colin