Forum Discussion

klang201_349748's avatar
klang201_349748
Icon for Nimbostratus rankNimbostratus
Jan 23, 2019

iRule to Forward traffic to new Virtual Address based on Originators Subnet

Need an iRule example to forward a client request to another virtual address based on the requester's subnet. We're transitioning from an old virtual to a new one and but updating all the clients is rather difficult. My intent is to have a rule on the old virtual to forward particular subnets to the new virtual for testing until we can update the client systems.

 

I have virtualA 10.10.10.20 and virtaulB with 10.10.20.30. If the client originates from mask 255.255.255.0 then forward the request to virtualB.

 

So far I've pieced together the below,

 

when CLIENT_ACCEPTED { if { [class match [IP::client_addr] equals mask 255.255.255.0] } { set forwarded_ip 10.10.20.30 } }

 

To build upon what I have so far, I need something to support multiple subnets.

 

1 Reply

  • You seem like you are looking for datagroups. You should be able to create a list of subnets to match and then if that subnet is in your list, you will be able to forward the traffic. More information on datagroup here.