forward same port but for two different IPs (cisco)

Posted by Colin on Server Fault See other posts from Server Fault or by Colin
Published on 2010-06-08T20:44:46Z Indexed on 2010/06/08 20:53 UTC
Read the original article Hit count: 210

Filed under:
|

Hi! 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

© Server Fault or respective owner

Related posts about cisco

Related posts about port-forwarding