Forum Discussion
ecloss_25932
Nimbostratus
Mar 19, 2010Forwarding to a specific address
I am brand new to iRules and am trying to build an iRule that will listen on a specific port (8411) of a specified address xxx.xxx.xxx.xxx and then forward to the same port on another address? This se...
Ian_Smith
Mar 20, 2010Ret. Employee
On the face of it, what you are asking for is how virtual servers work;
listen on 1.1.1.1:8411 and send all connections to a pool that contains 2.2.2.2:8411
But maybe what you need is to have a wildcard virtual server 0.0.0.0:any and pluck just that traffic out that is for 1.1.1.1:8411 but leave everything else free to go where ever the routing table says it should go.
If so, you could try something like this:
when CLIENT_ACCEPTED {
switch [IP::local_addr] {
1.1.1.1 {
log local0. "I found IP addr 1.1.1.1"
switch [IP::protocol] {
6 {
switch [TCP::local_port] {
8411 {
log local0. "I found TCP port 8411"
node 2.2.2.2
}
default { log local0. "These aren't the ports you're looking for" }
}
}
17 {
switch [UDP::local_port] {
8411 {
log local0. "I found UDP port 8411"
node 2.2.2.2
}
default { log local0. "These aren't the ports you're looking for" }
}
}
default { log local0. "This isn't the right transport protocol" }
}
}
default { log local0. "This isn't the right IP addr" }
}
}
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