Link to home
Start Free TrialLog in
Avatar of mafleet
mafleet

asked on

Problem forwarding port 22 on ASA5505 to internal server

I am trying to forward port 22 on the outside interface of my ASA5505, to an internal open ssh server.  I had it working fine two days ago.  Yesterday, I tried changing it, to forward the outside port 1700 to internal port 22, and could not get it working.  Now, when I think I have everything changed back, it still will not work.  Tonight, I have stripped out everything I thought was unnecessary, and tried to re-do my acl's and nat rules, but no matter what, I still can't get things working.  So, two questions:  how can I get things working, to just forward port 22 on the outside to port 22 on the inside, and 2) is there someting I am missing to get it working for 1700 on the outside to 22 on the inside, other than just changing the port numbers in the acl and nat rule?       Below is my running config:
(One other fact, that may be relevant, and I just noticed this looking at the config:  I have assigned the MAC address, as I wanted it the same as the MAC address of my previous router, so as to get the same IP address from my ISP.)


ciscoasa# sh run
: Saved
:
ASA Version 7.2(2)
!
hostname ciscoasa
domain-name default.domain.invalid
enable password 8Ry2YjIyt7RRXU24 encrypted
names
!
interface Vlan1
 nameif inside
 security-level 100
 ip address 192.168.0.3 255.255.255.0
!
interface Vlan2
 mac-address 0060.083a.267b
 nameif outside
 security-level 0
 ip address dhcp setroute
!
interface Ethernet0/0
 switchport access vlan 2
!
interface Ethernet0/1
!
<--- More --->
             
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
passwd 2KFQnbNIdI.2KYOU encrypted
ftp mode passive
clock timezone EST -5
clock summer-time EDT recurring
dns domain-lookup outside
dns server-group DefaultDNS
 name-server 68.87.72.130
 name-server 68.87.77.130
 domain-name default.domain.invalid
object-group network mafleet
 network-object host 192.168.0.31
object-group network outside_address
<--- More --->
             
 network-object host 68.x.x.x
access-list outside_access_in extended permit tcp any interface outside eq ssh
pager lines 24
logging enable
logging asdm informational
mtu inside 1500
mtu outside 1500
icmp unreachable rate-limit 1 burst-size 1
icmp deny any outside
asdm image disk0:/asdm-522.bin
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 0.0.0.0 0.0.0.0
static (inside,outside) tcp interface ssh 192.168.0.31 ssh netmask 255.255.255.255
access-group outside_access_in in interface outside
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout uauth 0:05:00 absolute
username qwerty password qwerty encrypted privilege 15
aaa authentication enable console LOCAL
aaa authentication http console LOCAL
<--- More --->
             
aaa authentication ssh console LOCAL
aaa authentication telnet console LOCAL
aaa authorization command LOCAL
http server enable
http 192.168.0.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec transform-set ESP-AES-128-MD5 esp-aes esp-md5-hmac
crypto ipsec transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac
crypto isakmp enable outside
crypto isakmp policy 10
 authentication pre-share
 encryption aes
 hash md5
 group 5
 lifetime 86400
crypto isakmp policy 30
 authentication pre-share
 encryption 3des
 hash md5
 group 2
 lifetime 86400
telnet timeout 5
<--- More --->
             
ssh 192.168.0.0 255.255.255.0 inside
ssh timeout 5
console timeout 0
dhcpd auto_config outside
dhcpd update dns both
!
dhcpd address 192.168.0.32-192.168.0.59 inside
dhcpd dns 68.87.72.130 68.87.77.130 interface inside
dhcpd auto_config outside interface inside
dhcpd enable inside
!

!
class-map inspection_default
 match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
 parameters
  message-length maximum 512
policy-map global_policy
 class inspection_default
  inspect dns preset_dns_map
  inspect ftp
<--- More --->
             
  inspect h323 h225
  inspect h323 ras
  inspect rsh
  inspect rtsp
  inspect esmtp
  inspect sqlnet
  inspect skinny
  inspect sunrpc
  inspect xdmcp
  inspect sip
  inspect netbios
  inspect tftp
!
service-policy global_policy global
privilege cmd level 3 mode exec command perfmon
privilege cmd level 3 mode exec command ping
privilege cmd level 3 mode exec command who
privilege cmd level 3 mode exec command logging
privilege cmd level 3 mode exec command failover
privilege show level 5 mode exec command running-config
privilege show level 3 mode exec command reload
privilege show level 3 mode exec command mode
privilege show level 3 mode exec command firewall
privilege show level 3 mode exec command interface
<--- More --->
             
privilege show level 3 mode exec command clock
privilege show level 3 mode exec command dns-hosts
privilege show level 3 mode exec command access-list
privilege show level 3 mode exec command logging
privilege show level 3 mode exec command ip
privilege show level 3 mode exec command failover
privilege show level 3 mode exec command asdm
privilege show level 3 mode exec command arp
privilege show level 3 mode exec command route
privilege show level 3 mode exec command ospf
privilege show level 3 mode exec command aaa-server
privilege show level 3 mode exec command aaa
privilege show level 3 mode exec command crypto
privilege show level 3 mode exec command vpn-sessiondb
privilege show level 3 mode exec command ssh
privilege show level 3 mode exec command dhcpd
privilege show level 3 mode exec command vpn
privilege show level 3 mode exec command blocks
privilege show level 3 mode exec command uauth
privilege show level 3 mode configure command interface
privilege show level 3 mode configure command clock
privilege show level 3 mode configure command access-list
privilege show level 3 mode configure command logging
privilege show level 3 mode configure command ip
<--- More --->
             
privilege show level 3 mode configure command failover
privilege show level 5 mode configure command asdm
privilege show level 3 mode configure command arp
privilege show level 3 mode configure command route
privilege show level 3 mode configure command aaa-server
privilege show level 3 mode configure command aaa
privilege show level 3 mode configure command crypto
privilege show level 3 mode configure command ssh
privilege show level 3 mode configure command dhcpd
privilege show level 5 mode configure command privilege
privilege clear level 3 mode exec command dns-hosts
privilege clear level 3 mode exec command logging
privilege clear level 3 mode exec command arp
privilege clear level 3 mode exec command aaa-server
privilege clear level 3 mode exec command crypto
privilege cmd level 3 mode configure command failover
privilege clear level 3 mode configure command logging
privilege clear level 3 mode configure command arp
privilege clear level 3 mode configure command crypto
privilege clear level 3 mode configure command aaa-server
prompt hostname context
Cryptochecksum:a557d65b477a24611e3159a1a84dae2e
: end

ASKER CERTIFIED SOLUTION
Avatar of Voltz-dk
Voltz-dk
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mafleet
mafleet

ASKER

You are right, and I tried that each time.  I wasn't exactly sure, but I entered the command clear xlate interface inside, as well as clear xlate interface outside.  Still didn't work.  I also did a sh xlate, and got PAT Global 68.x.x.x(22) Local 192.168.0.31(22).  That was why I wondered if there might be some kind of disconnect on the outside interface, since I am assigning it a MAC, and the config shows a MAC address instead of an IP address.
Avatar of mafleet

ASKER

Voltz-dk - thanks for your help.  I looked at the logs, and the NAT rule was working, but the actual connection was timing out.  I know my PC was listening on the proper port, as I did a netstat, but it occurred to me to try everything with a different PC on my network.  Everything works fine.  So it turns out that the communication from the ASA to my PC was one-way - my PC talks to the ASA, but I can not ping the PC from the ASA.  I have no firewall turned on, so I am not sure what is blocking it.  The other interesting thing is that before I got the ASA, I used a Freesco router, and the port forwarding to this PC worked fine.  At any rate, it turns out there was no problem with the ASA or its setup - I just need to figure out why my PC is blocking communication.  I am accepting your solution, as looking at the logs did give me the direction to go.  Thanks again.