Forum Discussion
cjunior
Oct 01, 2014Nacreous
Hi Dustin, You are thinking about create one VIP with any ports, correct?
You will translate the source port or the members will have the same that original port? You intend to do this listening the TCP and UDP and you don't need specific transport layer profiles? SSL offload? You will just setup a pool? I don't know if the performance will be degraded using proc, the gurus can talk about it, but, in tcl internet samples has a "rswitch" proc that can meet you needs. Maybe the problem in this solution is the "regexp", as this is non performatic. I'm afraid about it, is just one idea.VIP 10.1.1.1:* / L4 / Any port with Port translation / Any protocol
http://wiki.tcl.tk/4582
proc rswitch {value body} {
set go 0
foreach {cond script} $body {
if {[regexp {(.+)\.\.(.+)} $cond -> from to]} {
if {$value >= $from && $value <= $to} {incr go}
} else {
if {$value == $cond} {incr go}
}
if {$go && $script ne "-"} { (2)
uplevel 1 $script
break
}
}
if {$cond eq "default" && !$go} {uplevel 1 $script} ;(1)
}
when CLIENT_ACCEPTED {
set TCP 6
set UDP 17
if { [IP::protocol] eq $TCP } {
call rswitch [TCP::local_port] {
443 -
18100..18106 -
6070 -
1099 -
5106 -
5347 -
5269 -
36008..36009 { pool pool_192_168_1_1 }
6800..6802 { pool pool_192_168_2_1 }
default { reject }
}
} elseif { [IP::protocol] eq $UDP } {
call rswitch [UDP::local_port] {
18100 -
18101..18105 { pool pool_192_168_1_1 }
6004..6261 { pool pool_192_168_2_1 }
6604..7039 { pool pool_192_168_3_1 }
default { reject }
}
} else {
reject
}
}