Forum Discussion
Jack_young_1068
Mar 06, 2008Historic F5 Account
bulk NAT iRule
hi,
I am trying to have an iRule converting internal network hosts (10.0.0.0/8) to external ip (11.0.0.0/8). This needs to be an 1-1 NAT.
First, setup a virtual server handles inbo...
The_Bhattman
Nimbostratus
Mar 17, 2008I suppose you could write the 2 irules in the following that can be used
when CLIENT_ACCEPTED {
SNAT 10.X.Y.Z to 11.X.Y.Z
set xyz [findstr [IP::client_addr] 4 ]
snat 11.$xyz
}
and
when CLIENT_ACCEPTED {
SNAT 10.X.Y.Z to 11.X.Y.Z
set xyz [findstr [IP::client_addr] 4 ]
snat 10.$xyz
}
or you could bundle it up in one irule
when CLIENT_ACCEPTED {
if {[IP::addr "[IP::client_addr]/8" equals 10.0.0.0/8"]} {
set xyz "eleven"
} else if {[IP::addr "[IP::client_addr]/8" equals 11.0.0.0/8"]} {
set xyz "ten"
}
switch $xyz {
"eleven" { snat 11.$xyz }
"ten" { snat 10.$xyz }
}
}
Hope that helps
CB
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