cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2604
Views
0
Helpful
8
Replies

ASA5505 don't allow FTP access from outside.

marksoft1
Level 1
Level 1

I'm new to CISCO and ACLs and NATs but I'm willing to learn.
I am having problems allowing FTP access through my ASA5505 ASA 9.2 (2) ASDM 7.3(3)
I started pulling configs OFF google and I see stuff I don't understand plus stuff about having to allow other high ports.
I currently have what I think are the correct ones, 21 and 20.(FTP and FTP-DATA)

This is my problem: I have a domain on dyn.com ...myhomeftp.net that is (which has my ASA5505 Ip:
98.146.4.110) so I want to type the domain up in filezilla (with user name and password) and be able to access to my NAS which is located behind my ASA5505 with an IP: 192.168.1.10.Passive is already on on the ASA and I tried active as well. I can see the ASA is denying the connection.

I don't know if this is important but my network configuration lays out like this:

Internet (Comcast cable modem) => ASA5505 => Switch (192.168.1.9) and then from this switch it goes to a second switch (all in the same network) where the NAS is at.It doesn't have anything to do with it right ?
Should I use a DMZ ? Just for the NAS ? or it doesn't matter ?
I even did a 'fixup protocol ftp 21' (Honestly I don't know why or what it does) I found a few posts
saying it fix the problem so I did it.It didn't fix anything , the FTP session times out anyway.

FTP to the NAS from inside my LAN works fine. (I type 192.168.1.10 + User name and Password on Filezilla and no problems), but the problem its coming from the outside with myhomeftp.net.
I haven't found one defenitive way that works (like a standard procedure) to Allow FTP connection behind an asa5505 (It confuse me), there's many ways to do this ??

I succesfully port forwarded udp traffic to another specific host to be able to play on Tunngle.
I thought FTP would be like that, man I was wrong...I thought it was just to declare NAT and ACL and thats it.

If you notice the Nats rules for the FTP look like "nat (any,outside)" If I change "any" to "inside"
ASDM gives me an error saying it can't reserve the ports and erase the NATs rules for FTP and FTP-data.

I haven't have any success working with the FTP protocol,thanks in advance guys.

ASA Version 9.2(2)
!
hostname asa5505
enable password QFZeQwQyZJJ8X1Of encrypted
xlate per-session deny tcp any4 any4
xlate per-session deny tcp any4 any6
xlate per-session deny tcp any6 any4
xlate per-session deny tcp any6 any6
xlate per-session deny udp any4 any4 eq domain
xlate per-session deny udp any4 any6 eq domain
xlate per-session deny udp any6 any4 eq domain
xlate per-session deny udp any6 any6 eq domain
passwd PepL3Z6fEkcX2.LT encrypted
names
!
interface Ethernet0/0
 switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
interface Vlan1
 nameif inside
 security-level 100
 ip address 192.168.1.1 255.255.255.0
!
interface Vlan2
 nameif outside
 security-level 0
 ip address dhcp setroute
!
boot system disk0:/asa922-k8.bin
ftp mode passive
same-security-traffic permit inter-interface
same-security-traffic permit intra-interface
object network obj-192.168.1.15
 host 192.168.1.15
object network obj-192.168.1.0
 subnet 192.168.1.0 255.255.255.0
object network obj_any
 subnet 0.0.0.0 0.0.0.0
object network FTP
 host 192.168.1.10
object network FTP_DATA
 host 192.168.1.10
object-group service DM_INLINE_TCP_2 tcp
access-list outside_access_in remark Tunngle gaming
access-list outside_access_in extended permit udp any4 object obj-192.168.1.15 eq 11155
access-list outside_access_in extended permit tcp any4 object FTP eq ftp
access-list outside_access_in extended permit tcp any4 object FTP eq ftp-data
pager lines 24
logging enable
logging asdm informational
mtu inside 1500
mtu outside 1500
no failover
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-733.bin
no asdm history enable
arp timeout 14400
no arp permit-nonconnected
!
object network obj-192.168.1.15
 nat (inside,outside) static interface service udp 11155 11155
object network obj-192.168.1.0
 nat (inside,outside) dynamic interface
object network obj_any
 nat (inside,outside) dynamic interface
object network FTP
 nat (any,outside) static interface service tcp ftp ftp
object network FTP_DATA
 nat (any,outside) static interface service tcp ftp-data ftp-data
access-group outside_access_in in interface outside
timeout xlate 3:00:00
timeout pat-xlate 0:00:30
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 sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
timeout floating-conn 0:00:00
dynamic-access-policy-record DfltAccessPolicy
user-identity default-domain LOCAL
http server enable
http 192.168.1.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
crypto ipsec security-association pmtu-aging infinite
crypto ca trustpool policy
telnet timeout 5
ssh stricthostkeycheck
ssh 192.168.1.0 255.255.255.0 inside
ssh timeout 10
ssh key-exchange group dh-group1-sha1
console timeout 0

dhcpd auto_config outside
!
dhcpd address 192.168.1.5-192.168.1.132 inside
dhcpd enable inside
!
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
 anyconnect-essentials
username Don password xFknmwCuNrTVsX3C encrypted
username Don attributes
 service-type admin
!
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
  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
  inspect ip-options
!
service-policy global_policy global
prompt hostname context
no call-home reporting anonymous
call-home
 profile CiscoTAC-1
  no active
  destination address http https://tools.cisco.com/its/service/oddce/services/DDCEService
  destination address email callhome@cisco.com
  destination transport-method http
  subscribe-to-alert-group diagnostic
  subscribe-to-alert-group environment
  subscribe-to-alert-group inventory periodic monthly
  subscribe-to-alert-group configuration periodic monthly
  subscribe-to-alert-group telemetry periodic daily
Cryptochecksum:c35ba40b6d6d3f411b03dfff22408298
: end

 

1 Accepted Solution

Accepted Solutions

Hello, ok, I undestood what was the problem. Realy, with ASA if you need to test the access to some resources from the outside, you have to be outside of ASA (from the work office in your case, or over 3G\LTE connection from mobile phone).

So, I'll try to answer your questions:

1. So, I believe, it depends of your IOS version. Maybe, in your version there is a bug. I tried it on my ASA (version 9.2(3)).

! The access-list before change
cbs-asa-vpn(config)# show access-list acl-split-tunnel 
access-list acl-split-tunnel; 4 elements; name hash: 0x90fc63aa
access-list acl-split-tunnel line 1 extended permit ip 192.168.20.0 255.255.255.0 any (hitcnt=0) 0x626c36b0 
access-list acl-split-tunnel line 2 extended permit ip 192.168.1.0 255.255.255.0 any (hitcnt=0) 0xc6aef0fc 
access-list acl-split-tunnel line 3 extended permit ip 192.168.15.0 255.255.255.0 any (hitcnt=0) 0xe4878ba2 
access-list acl-split-tunnel line 4 extended permit ip 172.25.25.0 255.255.255.240 any (hitcnt=0) 0x7bfc7bea 
! Try to insert line 1
cbs-asa-vpn(config)# access-list acl-split-tunnel line 1 extended permit ip host 1.1.1.1 any
! Let's verify. No access-list entries were deleted. The access-list entry, which was on line 1 moved to line 2
cbs-asa-vpn(config)# sh access-list acl-split-tunnel
access-list acl-split-tunnel; 5 elements; name hash: 0x90fc63aa
access-list acl-split-tunnel line 1 extended permit ip host 1.1.1.1 any (hitcnt=0) 0x484a7ef5 
access-list acl-split-tunnel line 2 extended permit ip 192.168.20.0 255.255.255.0 any (hitcnt=0) 0x626c36b0 
access-list acl-split-tunnel line 3 extended permit ip 192.168.1.0 255.255.255.0 any (hitcnt=0) 0xc6aef0fc 
access-list acl-split-tunnel line 4 extended permit ip 192.168.15.0 255.255.255.0 any (hitcnt=0) 0xe4878ba2 
access-list acl-split-tunnel line 5 extended permit ip 172.25.25.0 255.255.255.240 any (hitcnt=0) 0x7bfc7bea 

 

2. Sorry, can not answer. I use CLI in most cases.

3. They are made by people. You can use any name, even "blablabla"

access-list blablabla permit ip any any

4. Again, sorry, no answer about ASDM.

5. ASA can have only one IP address on the interface. But if provider gives you the range of IP-addresses, you can configure NAT rules to use different IP addresses from this range for different services.

In your case, I believe there could be some mistake with communications between ASA and www.dyn.com.

By the way, are you sure, that Internet provider gives you always the same IP-address? Usually, you have to pay for permanent IP addresses. Maybe today, when ASA registered myhomeftp.net, it has the first IP addres, but yesterday ASA had another IP-address and registered cctvhome.net with the second IP-address. 

In any case, dynamic DNS servers (like www.dyn.com) should track the changes of public IP-addresses and modify DNS information according to those changes. But I don't know, how often DNS servers update their information.

 

By the way, if you find some of my answers useful, rate my post, please.

View solution in original post

8 Replies 8

Boris Uskov
Level 4
Level 4

Hello, 

In fact, I don't see any critical mistakes in the configuration. It should work...

But to verify this, you need to make some steps.

1) Try packet tracer:

packet-tracer input outside tcp 1.2.3.4 56123 98.146.4.110 21

2) Try to capture traffic on outside Interface. Maybe your Internet provider is blocking 21 port. To verify it, try the following capture:

capture TEST interface outside match tcp any any eq 21

show capture TEST

3) At last, if the step 2 shows, that packet successfully arrive on outside interface (ISP is not blocking anything), try to configure capture on inside interface:

capture TEST-inside interface inside match tcp any any eq 21

show capture TEST-inside

 

One more idea. The issue can be with NAT order. Try to change dynamic NAT configuration in following way:

object network obj-192.168.1.0
 no nat (inside,outside) dynamic interface
object network obj_any
 no nat (inside,outside) dynamic interface

nat (inside,outside) after-auto source dynamic obj_any interface

clear xlate

 

 

I did change the NAT order as you told me, same deal.

Hello, so, please, post the whole configuration one more time (after you changed the NAT order).

And, please, post the output of packet tracer one more time (add the keyword "detailed"):

packet-tracer input outside tcp 1.2.3.4 56123 98.146.4.110 21  detailed 

Also, post the output of 

show int ip brief

 

Hi , after you told me like other people has told me as well... You said "In fact, I don't see any critical mistakes in the configuration. It should work...".

I tried to FTP in from the outside, meaning I used an FTP app on my Iphone and it worked.

Mind you , the Filezilla I was using was behind my ASA as well in the same local network the NAS it's at. (May be that was the problem?)

It worked before with the ASUS router/firewall I had, it would go out from my local network where the NAS it's at too, to the domain outside on the internet and the domain would redirect it back to my local network and "boila" connection established, no problems. ASA don't like that apparently.   

When I tried to use Filezilla from work (a different outside network) gave me an error : Failed to retrieve directory listing.

But it establish a connection and a TLS connection, I can see it in the ASA also, so is not the ASA, it's the Filezilla ftp program. So I'll work it out,  no problems, at least I know is not the ASA. Like I said I can establish connection and see the NAS and all the files and directories on my FTP app from my IPhone. So I'll figure it out, may be installing a different FTP program on the "out of my network" computer, not a big deal.

 

Now I still have some general questions if you so kindly could answer them for me.

1- Why is it that if I use CLI to create Access Rules and I assign like line numbers 1 or 2 whatever, it erase the Access Rules that were in those numbers if any ? But if I make them on the ASDM, the program realize that there's some ACL's already on those lines so it create them below them.Weird!

2- What's the ACL MANAGER ? Because even though I erase Access rules the ACL MANAGER show them anyway.(Sort of like a back up)

3- What outside_in or outside_access_in come from ? Where can I find like a book of references about these names and when to use them ? Are they made up by the people that uses the ASA devices ? or are part of the syntax's from Cisco?

4- How can I put back in (on ASDM) an existing network object on the NAT Rules screen, with out re-creating it. Like, I already have the network object WEB created it but if I try to put it in the NAT rules screen, I only have 3 options Add NAT rule before object... , Add NAT rule, Add NAT rule after object... all of them are for creating it , no for using an existing one like "Inserting" or something like that. I hope I made myself clear.

5- Does the ASA gives me a range of outside Ip addresses ? For instance: my domain for the FTP server uses 98.146.4.110 = myhomeftp.net (out on the internet) but I noticed that now that I'm trying to use the same procedure I did with the FTP but this time for my surveillance cameras...so I got another domain cctvhome.net and I can see that in www.dyn.com (where the domain are registered) my ASA gave the new domain a new outside Ip 98.136.4.110 = cctvhome.net. Can you explain me this, as far as I know my ISP only gave me one Public IP, so how come ?

Thank you very much for your help so far. I'm sorry if my questions sound kind of stupid, I just want to learn, I need a mentor.

 

 

Hello, ok, I undestood what was the problem. Realy, with ASA if you need to test the access to some resources from the outside, you have to be outside of ASA (from the work office in your case, or over 3G\LTE connection from mobile phone).

So, I'll try to answer your questions:

1. So, I believe, it depends of your IOS version. Maybe, in your version there is a bug. I tried it on my ASA (version 9.2(3)).

! The access-list before change
cbs-asa-vpn(config)# show access-list acl-split-tunnel 
access-list acl-split-tunnel; 4 elements; name hash: 0x90fc63aa
access-list acl-split-tunnel line 1 extended permit ip 192.168.20.0 255.255.255.0 any (hitcnt=0) 0x626c36b0 
access-list acl-split-tunnel line 2 extended permit ip 192.168.1.0 255.255.255.0 any (hitcnt=0) 0xc6aef0fc 
access-list acl-split-tunnel line 3 extended permit ip 192.168.15.0 255.255.255.0 any (hitcnt=0) 0xe4878ba2 
access-list acl-split-tunnel line 4 extended permit ip 172.25.25.0 255.255.255.240 any (hitcnt=0) 0x7bfc7bea 
! Try to insert line 1
cbs-asa-vpn(config)# access-list acl-split-tunnel line 1 extended permit ip host 1.1.1.1 any
! Let's verify. No access-list entries were deleted. The access-list entry, which was on line 1 moved to line 2
cbs-asa-vpn(config)# sh access-list acl-split-tunnel
access-list acl-split-tunnel; 5 elements; name hash: 0x90fc63aa
access-list acl-split-tunnel line 1 extended permit ip host 1.1.1.1 any (hitcnt=0) 0x484a7ef5 
access-list acl-split-tunnel line 2 extended permit ip 192.168.20.0 255.255.255.0 any (hitcnt=0) 0x626c36b0 
access-list acl-split-tunnel line 3 extended permit ip 192.168.1.0 255.255.255.0 any (hitcnt=0) 0xc6aef0fc 
access-list acl-split-tunnel line 4 extended permit ip 192.168.15.0 255.255.255.0 any (hitcnt=0) 0xe4878ba2 
access-list acl-split-tunnel line 5 extended permit ip 172.25.25.0 255.255.255.240 any (hitcnt=0) 0x7bfc7bea 

 

2. Sorry, can not answer. I use CLI in most cases.

3. They are made by people. You can use any name, even "blablabla"

access-list blablabla permit ip any any

4. Again, sorry, no answer about ASDM.

5. ASA can have only one IP address on the interface. But if provider gives you the range of IP-addresses, you can configure NAT rules to use different IP addresses from this range for different services.

In your case, I believe there could be some mistake with communications between ASA and www.dyn.com.

By the way, are you sure, that Internet provider gives you always the same IP-address? Usually, you have to pay for permanent IP addresses. Maybe today, when ASA registered myhomeftp.net, it has the first IP addres, but yesterday ASA had another IP-address and registered cctvhome.net with the second IP-address. 

In any case, dynamic DNS servers (like www.dyn.com) should track the changes of public IP-addresses and modify DNS information according to those changes. But I don't know, how often DNS servers update their information.

 

By the way, if you find some of my answers useful, rate my post, please.

Thanks for answering some of my questions. I'm still figuring things out. But I have a better picture of the whole thing. 

Here is the first step

asa5505# packet-tracer input outside tcp 198.168.1.10 56123 98.146.4.110 21

Phase: 1
Type: ACCESS-LIST
Subtype:
Result: ALLOW
Config:
Implicit Rule
Additional Information:
MAC Access list

Phase: 2
Type: ROUTE-LOOKUP
Subtype: Resolve Egress Interface
Result: ALLOW
Config:
Additional Information:
in   98.146.4.110    255.255.255.255 identity

Phase: 3
Type: NAT
Subtype: per-session
Result: ALLOW
Config:
Additional Information:

Phase: 4
Type: ACCESS-LIST
Subtype:
Result: DROP
Config:
Implicit Rule
Additional Information:

Result:
input-interface: outside
input-status: up
input-line-status: up
output-interface: NP Identity Ifc
output-status: up
output-line-status: up
Action: drop
Drop-reason: (acl-drop) Flow is denied by configured rule

Second step:

I dont know how to do this, I try it just like you stated it.I'm sure the error it's my fault.

asa5505# capture TEST interface outside match tcp any any eq 21
asa5505# show capture TEST-inside
ERROR: Capture <TEST-inside> does not exist

Though I don't think is the ISP blocking the port though, because I've had an Asus RT-N56U providing me everything FTP, WEB SERVER and DMZ access (I had it for 2 years up to 2 weeks ago when I replaced it). As soon as I swaped it for the ASA , I lost all these things.
Port forwarding was incredible easy to do in the ASUS. But the firewall capabilities weren't as robust as CISCO are.That's why I changed it.


This is the asdm Syslog (since I don't know how to use the CLI capture thing)

192.168.1.15 It is the IP of the PC hooked to the ASA manage port (If you must know.)
I copied what I think it's relevant.

6 Jul 06 2015 3:01:41  192.168.1.15   49687   98.146.4.110   49687   Teardown dynamic UDP translation from inside:192.168.1.15/49687 to outside:98.146.4.110/49687 duration 0:00:31

6 Jul 06 2015 3:01:41  204.13.248.111 80  192.168.1.10   52324   Teardown TCP connection 183814 for outside:204.13.248.111/80 to inside:192.168.1.10/52324 duration 0:00:00 bytes 425 TCP FINs

6 Jul 06 2015 3:55:40  75.75.76.76    53     192.168.1.10    45163   Teardown UDP connection 183807 for outside:75.75.76.76/53 to inside:192.168.1.10/45163 duration 0:00:00 bytes 152

6 Jul 06 2015 3:01:40 192.168.1.10  36550  216.146.43.70 80  Built outbound TCP connection 183808 for outside:216.146.43.70/80 (216.146.43.70/80) to inside:192.168.1.10/36550 (98.146.4.110/36550)

6 Jul 06 2015 3:01:40   192.168.1.10  36550  98.146.4.110  36550 Built dynamic TCP translation from inside:192.168.1.10/36550 to outside:98.146.4.110/36550

6 Jul 06 2015 3:01:40   192.168.1.10  45163  75.75.76.76  53  Built outbound UDP connection 183807 for outside: 75.75.76.76/53 (75.75.76.76/53) to inside: 192.168.1.10/45163 (98.146.4.110/45163)

6 Jul 06 2015 3:01:40   192.168.1.10  45163  98.146.4.110 45163 Built dynamic UDP translation from inside: 192.168.1.10/45163 to outside: 98.146.4.110/45163

3 Jul 06 2015 3:01:39 177.216.248.20 Denied ICMP type=3, code=3 from 177.216.248.20 on interface outside

4 Jul 06 2015 3:01:39 No matching connection for ICMP error message: icmp src outside:177.216.248.20 dst identity:98.146.4.110 (type 3, code 3) on outside interface.  Original IP payload: udp src 98.146.4.110/51452 dst 177.216.248.20/53.

It shows it in this order.

 

 

Review Cisco Networking for a $25 gift card