Switching Service Group based on VLAN Tag
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.
0
Comments
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
}
}