Forum Discussion
Using F5 for load balancing internal traffic
- Aug 17, 2023
irbk That is great that you figured out the solution but I would like to mention a few things so you do not set yourself up for failure.
1. Unless absolutely necessary I would avoid using Auto Map and instead create a snatpool and use the same IP as the Virtual Server you have created and use that snatpool instead of Auto Map. The reason for this is if you find yourself in a situation where you have a virtual server/s that has a significant amount of connections your health monitors and a few other things could stop functioning because you will have exhausted all the ephemeral ports on the F5s self-IP which is what is used for Auto Map.
2. The reason the F5 requires SNAT to be configured for your situation is because when traffic traverses the F5 from one interface to another and that traffic has to pass through the F5 the F5 will automatically stitch the two connections together while allowing the server to see the original client IP. Your configuration for internal is necessary because the client, one of the other devices in the same subnet as the pool members, can be seen by the destination pool members so instead of the pool members responding back through the already formed TCP connection through the F5 they will go directly to the client since they know its IP which breaks the TCP connection previously formed through the F5. With SNAT enabled the pool members only see the F5 as the source of the connection so the pool members have to respond back to the F5 which then allows the F5 to stitch the client side and server side connections together.
3. If you require tracking of the true client in a SNAT configuration and the traffic is only HTTP or HTTPS and you are decrypting at the F5 and you have an HTTP profile you can enable X-Forwarded-For header field insertion using an iRule, traffic policy, or the easiest way of using an HTTP profile. The X-Forwarded-For header field will be inserted into the HTTP header and a value of the original client IP will be stored as the value of that HTTP header field. You can then configured your pool members to search and record the value of that header for tracking purposes.
- Aug 17, 2023
Thanks for the reply. I'd rather use a better known solution than mine anyway, considering I have all of about 6ish hours of knowledge with BigIP. I just started spinning up the lab yesterday and I am fully aware there is a whole lot about the system I don't know. So I'll totally set up a snatpool using the same IP as my virtual server and swtich over from auto map to snat!
As for your #2 that totally explains why in a wireshark I'd see a bunch of retransmits and eventually everyone just says "yeah, I'm done" and the connection is dropped. Thanks for the explination!
As for 3# as I said, I have perhaps 6ish hours of BigIP knowledge and I don't understand most of what you said but I'm sure it was helpful to someone else... or perhaps me several months from now.
Thanks again! I'm going to go see if I can figure out how to set up that snatpool.
Yep! I've seen a few of them. I spent way too much time trying to figure out if you're writing backwards or if there is some behind the scenes magic going on. 😂 It was also through there that I stumbled across another channel that helped me spin up the lab that I have now.
Don't be a stranger, and don't let anything eat at you, lots of stellar contributors here with years of experience ready to help.
- irbkAug 17, 2023
Cirrus
Awesome! Thanks!
I'm sure I'll have more questions as we roll from lab to production.
Right now I've got round robbin working with basic http connections. The only thing that's kind of "goofy" is how I may get redirectied between web servers and then my request doesn't work quite right. I think it's probably because my "web servers" in the lab are just routers with an http interface enabled, so they serve the webpage and the connection drops just a few seconds later where this wouldn't happen so much in "real life". So, for example, I http://10.1.1.150 (which is my BigIP) and I get connected to "WebServer2" (again, this is just a router with http enabled) I click the "ping" link in the web page presented to me and then I might end up on WebServer3's interface. Then I fill out the "ping" form and hit "go" and if I say on WebServer3 I'm fine but if I get the other 2 servers I'll get an "invalid interface" (because I'm pinging from the interface that's shown in the form which is either the interface for WebServer1, 2, or 3, depening on which page served the form to you). Again, I think the "issue" is on my "WebServer" side and not the BigIP side. One can only simulate real life "so much" in a lab until you have to rely on faith.
- JRahmAug 17, 2023
Admin
make sure you have oneconnect profile enabled on your virtual, it is considered a misconfiguration on http to not have it enabled. Also, if persistence to teh web tier is necessary for your clients, you'll want to add a persist profile as well. Can do cookies so it's passive to BIG-IP, or you can use something like source persistence that will keep a record in memory.
- irbkAug 18, 2023
Cirrus
What is "oneconnect"? I'm not familar with that.
- JRahmAug 18, 2023
Admin
A couple articles that will help:
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