Forum Discussion
Srecko_M__12636
Nov 29, 2013Nimbostratus
Persistence mirroring with irules
Hi,
we are using iRules to direct traffic to a different pool, when traffic comes to the same VIP, but to a different HTTP host.
For example:
when HTTP_REQUEST {
switch [string tolower ...
nitass
Employee
The question is: How to enable persistence mirroring when the iRule directs traffic to Pool_2 for host "wap.example.com"?
just wondering whether it is already working.
e.g.
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.20.111:80
ip-protocol tcp
mask 255.255.255.255
persist {
source-addr-mirror {
default yes
}
}
pool foo
profiles {
http { }
tcp { }
}
rules {
myrule
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 9
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm persistence source-addr source-addr-mirror
ltm persistence source-addr source-addr-mirror {
app-service none
mirror enabled
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo
ltm pool foo {
members {
200.200.200.101:80 {
address 200.200.200.101
}
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool qux
ltm pool qux {
members {
200.200.200.111:80 {
address 200.200.200.111
}
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
wap.example.com {
pool qux
persist source_addr 255.255.255.255 12000
}
}
}
}
active:
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) show ltm persistence persist-records all-properties
Sys::Persistent Connections
source-address - 172.28.20.111:80 - 200.200.200.111:80
------------------------------------------------------
TMM 1
Mode source-address
Value 172.28.20.17
Age (sec.) 145
Virtual Name /Common/bar
Virtual Addr 172.28.20.111:80
Node Addr 200.200.200.111:80
Pool Name /Common/qux
Client Addr 172.28.20.17
Owner entry
Total records returned: 1
standby:
root@(ve11b)(cfg-sync In Sync)(Standby)(/Common)(tmos) show ltm persistence persist-records all-properties
Sys::Persistent Connections
source-address - 172.28.20.111:80 - 200.200.200.111:80
------------------------------------------------------
TMM 1
Mode source-address
Value 172.28.20.17
Age (sec.) 0
Virtual Name /Common/bar
Virtual Addr 172.28.20.111:80
Node Addr 200.200.200.111:80
Pool Name /Common/qux
Client Addr 172.28.20.17
Owner entry
Total records returned: 1
Dec 02, 2013
Thanks nitass for the repro! Will the record persist, in case you change the hostname? Another persistence record should be created, imho. Ideally the records would be used now selectively depending on the requested hostname. Btw, in case of using Hash Mode "carp" in Source Address Affinity, a mirroring won´t be necessary anyway as long as both members of the device group see same pool member states. Thanks, Stephan
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