Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a cisco running IOS 12.0(25) responding to two different IPs addresses: IP_A and IP_B. Behind this router I also have two different servers: server_A and server_B.

What I want is to forward port 22 to both servers, so:

                IP_A, port22 -> server_A, port22 
                IP_B, port22 -> server_B, port22

ATM this only works for one of them (server_A), this is my config:

interface Ethernet0/0
description Internet
ip address IP_A 255.255.255.0
ip address IP_B 255.255.255.0 secondary
no ip directed-broadcast
ip nat outside
no ip mroute-cache
no cdp enable

ip nat pool pool_A IP_A IP_A netmask 255.255.255.0
ip nat pool pool_B IP_B IP_B netmask 255.255.255.0
ip nat inside source list A pool pool_A overload
ip nat inside source list B pool pool_B overload
ip nat inside source static tcp server_B 22 IP_B 22 extendable
ip nat inside source static tcp server_A 22 IP_A 22 extendable

access-list A permit server_A
access-list B permit server_B

share|improve this question
1  
Why are you trying to do this exactly? It sounds like you are trying to duplicate the functionality of a load balancer, but if that is the case you should opt to use a load balancer. –  Charles Jun 8 '10 at 21:11
    
not load balancing here ... there're two different servers that I want to ssh from outside –  Colin Jun 8 '10 at 21:31
    
is this a router or a firewall? –  GruffTech Jun 8 '10 at 22:02
    
this is firewall doing NAT for those servers –  Colin Jun 9 '10 at 8:26
1  
I could be wrong here but can't you configure the second server to use another port? That way you can access both of em? Why do they need to use the same port.. just asking out curiosity.. –  rzlines Dec 12 '10 at 16:47
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.