Skip to Content

Best Practice

Obtaining Source IP with TOA Function

NLB currently supports obtaining client source IPs through Toa. To use the Toa module, you need to configure it on the Listener and RealServer hosts of NLB respectively.

Prerequisites

  • Create an NLB and a Listener on port 80.
  • Create a cloud host, in this article we will use centos7 as an example.
  • Mount the cloud host under the NLB.

workflow

Open the NLB Toa function

  1. Click Listener Management, Change Configuration
  2. Open the Toa function and submit the update
  3. You can check whether Toa is enabled here.

Installing Toa Module on RealServer Hosts

  1. Toa module acquisition:
  2. Uploading the toa.ko file to RealServer
  3. Install the toa module

Check if Toa is in effect

Using nginx, you can quickly check the source IP to see if Toa is in effect.

  1. Install nginx
yum install -y nginx
  1. Start nginx, listening on port 80 by default.
systemctl start nginx
  1. Find the location of the nginx access.log file
find / -name access.log
  1. Listening to file contents
watch cat /var/log/nginx/access.log

If the installation was successful, you can see the client IP correctly here

img