01-21-2020 04:15 PM
Hi, I have a cisco 2911 running ios version Version 15.0(1r)M12.
I am wondering if it's possible to map tcp port on the router to the ip address of client.
For example, if my router's ip is a.b.c.d and my client's ip address is 192.168.0.100, is it possible to ssh to the client using this command: 'ssh a.b.c.d 4000' where 4000 is used to inform router that ssh session is intended for 192.168.0.100
thank you in advance.
Solved! Go to Solution.
01-22-2020 01:39 AM
@markz3 I just realize I put ports at wrong side. Please refer to below :)
ip nat inside source static tcp 192.168.0.100 22 a.b.c.d 4000
if a.b.c.d belongs to Router interface then you can do below also:
ip nat inside source static tcp 192.168.0.100 22 interface gi0/0 4000
01-22-2020 10:09 PM - edited 01-22-2020 10:17 PM
@markz3 That's gr8!! Happy to hear that :)
Please mark solution as accepted and helpful if it helped you out :)
01-21-2020 04:44 PM - edited 01-21-2020 04:45 PM
Hi,
Yes, it is possible. The command will look like:
ip nat inside source static tcp 192.168.0.100 4000 a.b.c.d 22
if a.b.c.d belongs to Router interface then you can do below also:
ip nat inside source static tcp 192.168.0.100 4000 interface gi0/0 22
in addition to above, you have to define ip nat outside on Router ISP facing interface and IP nat inside on Router LAN facing interface.
01-21-2020 07:58 PM
is this source coming from external or from the same LAN network?
01-22-2020 01:04 AM
Hello,
on a side note, if your router supports port mapping, you could try the below:
ip port-map ssh port tcp 4000
and then add use the static NAT entry as suggested by
ip nat inside source static tcp 192.168.0.100 4000 a.b.c.d 4000
In theory, that would allow you to connect to port 4000 and then get redirected to port 4000 on the client.
Have a look at the link below:
01-22-2020 01:39 AM
@markz3 I just realize I put ports at wrong side. Please refer to below :)
ip nat inside source static tcp 192.168.0.100 22 a.b.c.d 4000
if a.b.c.d belongs to Router interface then you can do below also:
ip nat inside source static tcp 192.168.0.100 22 interface gi0/0 4000
01-22-2020 10:03 PM
hi muhammad. thank you so much. at first your solution did not work because my ssh syntax was incorrect. but once i use the correct syntax 'ssh -p 4000 a.b.c.d', your solution works.
thank you again!
01-22-2020 10:09 PM - edited 01-22-2020 10:17 PM
@markz3 That's gr8!! Happy to hear that :)
Please mark solution as accepted and helpful if it helped you out :)
01-22-2020 10:26 PM
Thank you everyone for all your suggestions....
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide