Forum Discussion
Royal_131741
Aug 16, 2013Nimbostratus
iRule for port forwarding ssh to port 2222 on Pool
Hi,
hope anybody can help 🙂
I have two LBs (activ/activ) and two Server in the Pool called RealSERVER, which are load balanced with lc.
On the two Real Server i have two sshd, which are listen...
RoutingLoop_179
Aug 16, 2013Cirrus
As AFanen said you can achieve this using standard LTM config. but you can also achieve using an irule you were pretty much there with your first one. If you want to load balance across your pool using 2222 need to create a pool using members using 2222, otherwise you can specifically specify individual pool members and ports. also I think you'll need to consider persistence since you are using SSH. Here's some code that may help.
when CLIENT_ACCEPTED {
if { [TCP::local_port] == 22 } {
log "ssh_server_pool with members 192.168.101.11:2222 192.168.101.12:2222 - using source address persistence"
necessary if not configured in the virtual server configuration - translate address from VIP to member - translate port from 22 to 2222.
translate address enable
translate port enable
load balance across pool
pool ssh_server_pool
as we're talking ssh we need to set a persistence profile
persist source_addr 255.255.255.255 0
log the localport
log "localport: [TCP::local_port] "
}
}
when SERVER_CONNECTED {
just for logging/debugging
log "serverport: [TCP::server_port] "
}
cont...
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