In a small telecommunications operator, the Cisco SCE 2020 is used to control Internet access, which is installed between the Cisco 6500 and the debian server that functions as NAT. An aggregated link of 2 Gb is configured between the server and the switch. As the operator grows, loading of channels began to approach 1.8 Gbps, which is the limit of the SCE 2020 bandwidth, at which it is able to adequately apply traffic processing policies. In this regard, it was decided to install the second SCE, expanding the link to 4Gbps.
The standard scheme for the inclusion of several SCE 2020, according to the Cisco documentation, is as follows (1):

But, as usual, due to the lack of ports on the 6500, it was decided to include SCE between the server and the Catalyst.
In order for the DPI functionality to work correctly (protocol definition, http redirection), it is necessary to ensure symmetrical traffic flow through the SCE, i.e., the packets of a specific user must always pass through both sides of the same port and, accordingly, the same SCE. On the Cisco 6500 side, the problem is solved by the command “port-channel load-balance src-ip” (2), after which packets from the same source always go to the same port.
Accordingly, from the server side it was required to enable traffic balancing by the recipient's IP address. It would seem that such a simple type of balancing should be implemented in the bonding module of the linux kernel, however, after studying the documentation, we found that it was not. As a result, a small patch was born to the kernel 2.6.32 (3), which adds balancing modes to the source or destination address.
')
After applying the patch, to use these types of balancing, you must include bonding with the parameter bond_mode = 2 (Mode of operation: balance-xor), and in the parameter xmit_hash_policy select the necessary type of balancing: 3 for balancing by the IP address of the recipient or 4 for balancing by the IP address the sender.
1) “10 Gigabit and Multi-Gigabit Solution”
www.cisco.com/en/US/prod/collateral/ps7045/ps6129/ps6133/ps6151/product_data_sheet0900aecd801d8574.html2) Configuring EtherChannel Load Balancing
www.cisco.com/en/US/docs/switches/lan/catalyst6500/ios/12.2SX/configuration/guide/channel.html#wp10208043) Patch for kernel 2.6.32
pastebin.com/5YPNZBiy