Forum Discussion
Vijay_Kumar_963
Nimbostratus
Oct 18, 2012How to make irule for outgoing http request
Hi
We have an HTTP request which is going towards Internet from the WAP Gateway server.
Now we have the requirement to read the IP address present in the Cookie value of HTTP request and in...
nitass
Employee
Oct 19, 2012thanks Steve.
i checked rfc again and i think ip is valid cookie value.
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
foreach acookie [HTTP::header values "Set-Cookie"] {
if { [scan $acookie {SNAT-IP-ADDRESS=%d.%d.%d.%d} a b c d] == 4 } {
snat ${a}.${b}.${c}.${d}
break
}
}
}
}
on client
curl -I http://8.8.8.8 -H "Set-Cookie: test=1234" -H "Set-Cookie: SNAT-IP-ADDRESS=10.10.10.10; path=/" -H "Set-Cookie: foo=abcd"
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
19:59:09.615782 IP 200.200.200.101.49858 > 8.8.8.8.80: S 3734643271:3734643271(0) win 5840
19:59:09.615832 IP 8.8.8.8.80 > 200.200.200.101.49858: S 702811879:702811879(0) ack 3734643272 win 4380
19:59:09.616803 IP 200.200.200.101.49858 > 8.8.8.8.80: . ack 1 win 46
19:59:09.616826 IP 200.200.200.101.49858 > 8.8.8.8.80: P 1:245(244) ack 1 win 46
19:59:09.616992 IP 10.10.10.10.49858 > 8.8.8.8.80: S 16523661:16523661(0) win 4380
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects