just doubt if ip is valid cookie value.
HTTP State Management Mechanism
http://tools.ietf.org/html/rfc6265section-3
this is my testing using http header instead of cookie.
[root@ve10:Active] config b virtual bar list
virtual bar {
translate service disable
pool gw
destination any:80
mask 0.0.0.0
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b pool gw list
pool gw {
members 172.28.19.254:any {}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [scan [HTTP::header value "SNAT-IP-ADDRESS"] {%d.%d.%d.%d} a b c d] == 4 } {
snat ${a}.${b}.${c}.${d}
}
}
}
on client
curl -I http://8.8.8.8 -H "SNAT-IP-ADDRESS: 1.1.1.1"
on bigip
[root@ve10:Active] config tcpdump -nni 0.0 port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on 0.0, link-type EN10MB (Ethernet), capture size 108 bytes
16:38:23.155717 IP 200.200.200.101.49839 > 8.8.8.8.80: S 1788555863:1788555863(0) win 5840
16:38:23.155769 IP 8.8.8.8.80 > 200.200.200.101.49839: S 2802155735:2802155735(0) ack 1788555864 win 4380
16:38:23.156811 IP 200.200.200.101.49839 > 8.8.8.8.80: . ack 1 win 46
16:38:23.156852 IP 200.200.200.101.49839 > 8.8.8.8.80: P 1:177(176) ack 1 win 46
16:38:23.165656 IP 1.1.1.1.49839 > 8.8.8.8.80: S 2419732630:2419732630(0) win 4380 8.8.8.8.80: S 444058119:444058119(0) win 5840
16:39:40.602656 IP 8.8.8.8.80 > 200.200.200.101.49840: S 4032979623:4032979623(0) ack 444058120 win 4380
16:39:40.603846 IP 200.200.200.101.49840 > 8.8.8.8.80: . ack 1 win 46
16:39:40.603881 IP 200.200.200.101.49840 > 8.8.8.8.80: P 1:177(176) ack 1 win 46
16:39:40.604010 IP 2.2.2.2.49840 > 8.8.8.8.80: S 2964909812:2964909812(0) win 4380