What’s the best way to create an aFleX that directs users coming in on a specific VLAN to a specific service group? For example, VLAN 2 would direct to service group SG2 and VLAN 3 would direct to service group SG3, and so on. There could be quite a number of VLAN to service group matches, so the most efficient aFleX approach would be preferred.
In 2.6.1p4 A10 added Link functionality to aFlex where you can execute any of the following link level commands to gather information.
LINK::lasthop – returns the MAC address of the last hop
LINK::nexthop – returns the MAC address of the next hop
LINK::vlan_id – returns the 802.1q tag for the vlan_id of the packet
Using the switch command because of it’s efficiency you could do something like the following. Adding VLANs and service groups to the switch for subsequent VLANs. You can use this with other events such as when HTTP_REQUEST.
when CLIENT\_ACCEPTED \{
switch [LINK::vlan\_id] \{
"3" \{
pool VLAN3\_Service\_Group
"4" \{
pool VLAN4\_SG\_Service\_Group
\}
or
when CLIENT\_ACCEPTED \{
set vlan\_id [LINK::vlan\_id]
switch $vlan\_id \{
3 \{
pool VLAN3\_Service\_Group
\}
4 \{
pool VLAN4\_SG\_Service\_Group
\}
\}