Skip to content

Obtain the real IP address of the client through TOA

To use TOA to pass the real IP of the TCP protocol client, you need to configure the delivery client IP mode of the Layer 4 proxy forwarding rule to TOA in the console.

You can load the TOA module in two ways:

Method 1: Compile and load the TOA source code file by downloading it.

Step 1: Install the compilation environment.

(1) Check the current kernel version number, confirm that kernel-devel and kernel-headers are installed, and ensure that the version number is consistent with the kernel version.

(2) Confirm that gcc and make are installed.

(3) If the above environment dependencies are not installed, you can refer to the following command to install them:

  • Centos installation and compilation environment:
yum install -y gcc

yum install -y make

yum install -y kernel-headers kernel-devel
  • Ubuntu installation and compilation environment:
apt-get install -y gcc

apt-get install -y make

apt-get install -y linux-headers-$(uname -r)

Step 2: After installing the compilation environment, run the following command to download, compile and load the source code.

# Create and enter the compilation directory

mkdir toa_compile && cd toa_compile

# Download the source code tar package

curl -o toa.tar.gz https://edgeone-document-file-1258344699.cos.ap-guangzhou.myqcloud.com/TOA/toa.tar.gz

# Unzip the tar package

tar -zxvf toa.tar.gz

# Compile the toa.ko file, and the toa.ko file will be generated in the current directory after the compilation is successful

make

# Load the TOA module

insmod toa.ko

# Copy to the kernel module directory

cp toa.ko /lib/modules/`uname -r`/kernel/net/netfilter/ipvs/toa.ko

# Set the TOA module to be automatically loaded when the system starts

echo "insmod /lib/modules/`uname -r`/kernel/net/netfilter/ipvs/toa.ko" >> /etc/rc.local

Step 3: Execute the following command to confirm whether it has been loaded successfully.

lsmod | grep toa

Method 2: One-click compilation and installation of adaptive TOA.

  • One-click installation of the Centos-TOA plugin
sudo yum -y install gcc make linux-headers-$(uname -r)

/bin/bash -c "$(curl -fsSL https://edgeone-document-file-1258344699.cos.ap-guangzhou.myqcloud.com/TOA/compile_install_toa.sh)"

lsmod | grep toa
  • One-click installation of ubuntu-TOA plugin
sudo apt-get install -y gcc make linux-headers-$(uname -r)

/bin/bash -c "$(curl -fsSL https://edgeone-document-file-1258344699.cos.ap-guangzhou.myqcloud.com/TOA/compile_install_toa.sh)"

lsmod | grep toa