Forum Discussion
Touch_100239
Nimbostratus
Aug 02, 2010iRule Implementation (SNAT)
Hi All
I am new about F5 iRule and facing a problem about iRule implementation on F5. I was struggling with it for more than two weeks. Really hope if there is someone could help me to solve it.
My scenario is below.
I get two servers and a F5.
IP for server1: 192.168.1.2
IP for server2: 192.168.2.2 (In the virtual server pool)
IP for virtual server: 192.168.1.3
IP for translatation: 192.168.2.3
Now I want to do is to SSH from 1.2 to 2.2 via F5 virtual server.
ssh 192.168.1.3
Then virtual server should forward this request to 2.2 and I will be in the 2.2 with source 2.3 not 1.2.
The iRule I generate is
when CLIENT_ACCEPTED {
if {[matchclass [IP::remote_addr] equals 192.168.1.3] and [matchclass [IP::client_addr] equals 192.168.1.2]} {
snat 192.168.2.3
}else {
snat none
}
}
But after implementing this rule to the virtual server, it does not work at all. So is there anyone could help me? Thank you very much. :-(
- Touch_100239
Nimbostratus
Hi All - The_Bhattman
Nimbostratus
Hi Touch,when CLIENT_ACCEPTED { log local0 "The Client IP is [IP::client_addr] and the node IP is [IP::remote_addr]" if {[matchclass [IP::client_addr] equals 192.168.1.2]} { snat 192.168.2.3 } else { snat none } }
- Touch_100239
Nimbostratus
Hi Bhattman - The_Bhattman
Nimbostratus
Hi Touch,when LB_SELECTED { log local0 "The Client IP is [IP::client_addr] and the node IP is [IP::remote_addr]" if {[IP::addr [IP::client_addr] equals 192.168.1.2] and [IP::addr [LB::server addr] equals 192.168.2.2]} { snat 192.168.2.3 } else { snat none } }
- Touch_100239
Nimbostratus
Hi Bhattman
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