Forum Discussion
David_revilla_f
Nimbostratus
Nov 21, 2007Snat or nat senteces
Hi everyone,
I am composing this irule
rule subscription {
when HTTP_REQUEST {
if { [[TCP::remote_port] == 20001]] or [[TCP::remote_port] == 30001]] or [[TCP::remote_port] == 20002]] or [[TCP::remote_port] == 30002]] } {
nat { 192.168.1.51 to 172.16.50.195 }
nat { 192.168.1.52 to 172.16.50.244 }
}
}
}
when HTTP_REPLY {
if { [[TCP::remote_port] == 20001]] or [[TCP::remote_port] == 30001]] or [[TCP::remote_port] == 20002]] or [[TCP::remote_port] == 30002]] } {
nat { 192.168.1.51 to 172.16.50.195 }
nat { 192.168.1.52 to 172.16.50.244 }
}
I do not know if nat sentence is correct or i have to use snat instead. In both cases, which is the correct format for this type of sentences?
Thank you very much in advance.
David
}
}
- hoolio
Cirrostratus
Hi David,when CLIENT_ACCEPTED { switch [TCP::local_port] { 20001 - 20002 - 30001 - 30002 { request was to one of the listed TCP ports check the client IP address to see if we apply the source address translation if {[IP::addr [IP::client_addr] equals 192.168.1.51]}{ apply source address translation snat 172.16.50.195 check the client IP address to see if we apply the source address translation } elseif {[IP::addr [IP::client_addr] equals 192.168.1.52]}{ apply source address translation snat 172.16.50.244 } } } }
- David_revilla_f
Nimbostratus
Hi Aaron,
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