11-25-2013 04:15 PM - edited 03-07-2019 04:46 PM
I have a ASA 5505 with the basic license. The three VLANs are inside, outside, and guest where guest has the 'no forward interface Vlan1' setting required on the third interface by the basic license. The outside interface is a private LAN with access to the Internet. On the outside interface is a host that we want to allow to SSH into hosts on the inside interface. In the past I've used access-lists to do this on other routers but this ASA 5505 doesn't appear to use the access-list. How can I allow SSH traffic from the host on the outside LAN to multiple hosts on the inside?
This is not for ASA 5505 remote management (that already works).
show startup-config
: Saved
: Written by enable_15 at 10:34:21.676 UTC Mon Nov 25 2013
!
ASA Version 8.2(5)
!
hostname ASA5505
enable password xxxxxxxxxxxxxx encrypted
passwd xxxxxxxxxxxxxx encrypted
names
!
interface Ethernet0/0
switchport access vlan 2
!
interface Ethernet0/1
switchport access vlan 3
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
switchport access vlan 3
!
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 192.168.2.4 255.255.255.0
!
interface Vlan3
no forward interface Vlan1
nameif guest
security-level 25
ip address 192.168.10.1 255.255.255.0
!
ftp mode passive
pager lines 24
logging asdm informational
mtu inside 1500
mtu outside 1500
mtu guest 1500
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 0.0.0.0 0.0.0.0
nat (guest) 1 0.0.0.0 0.0.0.0
route outside 0.0.0.0 0.0.0.0 192.168.2.1 1
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 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
aaa authentication ssh console LOCAL
http server enable
http 192.168.1.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 security-association lifetime seconds 28800
crypto ipsec security-association lifetime kilobytes 4608000
telnet timeout 5
ssh 192.168.1.0 255.255.255.0 inside
ssh 192.168.2.5 255.255.255.255 outside
ssh timeout 5
ssh version 2
console timeout 0
dhcpd dns 208.67.222.222 208.67.220.220
dhcpd auto_config outside
dhcpd option 43 ip 192.168.2.5
!
dhcpd address 192.168.1.5-192.168.1.254 inside
dhcpd enable inside
!
dhcpd address 192.168.10.5-192.168.10.254 guest
dhcpd enable guest
!
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
username xxxxxxxxxx password xxxxxxxxxxxx encrypted
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum client auto
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
Cryptochecksum:
Solved! Go to Solution.
11-26-2013 06:15 AM
Kim
You need a static command ie.
static (inside,outside) tcp 192.168.1.0 22 192.168.1.0 22 netmask 255.255.255.0
or
static (inside,outside) 192.168.1.0 192.168.1.0 netmask 255.255.255.0
the first only does NAT for ssh specifically. If you want to allow other ports through then either do an individual port entry like the first statement just changing the port or use the second statement which allows all ports. Obviously you would still need to add an entry in the acl on the outside interface for each port.
I generally prefer to use to use the second option but either should work.
Jon
11-26-2013 01:47 AM
The ASA does use access-lists. You have to create one, then apply it to the desired interface in the desired direction.
ip access-list ACL permit tcp
access-group ACL in interface outside
The ASA also uses object groups to make access-list management simpler.
11-26-2013 05:45 AM
Thanks for the help. My statement above that the ASA 5505 doesn't appear to use access-list was poorly worded. I've tried various combinations of access lists without success. It appears the ASA ignores them. From my limited understanding adding the entries you suggest should allow the traffice from the outside interface to the inside and because it is a tcp connection the inside interface should allow the traffic back to the source. I'm sure it is something I'm doing wrong, but after putting the ACL in and assigning it to the outside interface it still doesn't allow SSH from the outside host to the inside hosts.
I'm not really familiar with using object groups and haven't tried that yet, but will start looking at it.
Below is a configuration with the changes you suggest. I'm not able to SSH to the hosts on the inside.
show run
: Saved
:
ASA Version 8.2(5)
!
hostname ASA5505
enable password xxxxxxxxxx encrypted
passwd xxxxxxxxxx encrypted
names
!
interface Ethernet0/0
switchport access vlan 2
!
interface Ethernet0/1
switchport access vlan 3
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
switchport access vlan 3
!
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 192.168.2.4 255.255.255.0
!
interface Vlan3
no forward interface Vlan1
nameif guest
security-level 25
ip address 192.168.10.1 255.255.255.0
!
ftp mode passive
access-list OUTSIDE_IN extended permit tcp host 192.168.2.5 192.168.1.0 255.255.255.0 eq ssh
pager lines 24
logging asdm informational
mtu inside 1500
mtu outside 1500
mtu guest 1500
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 0.0.0.0 0.0.0.0
nat (guest) 1 0.0.0.0 0.0.0.0
access-group OUTSIDE_IN in interface outside
route outside 0.0.0.0 0.0.0.0 192.168.2.1 1
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 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
aaa authentication ssh console LOCAL
http server enable
http 192.168.1.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 security-association lifetime seconds 28800
crypto ipsec security-association lifetime kilobytes 4608000
telnet timeout 5
ssh 192.168.1.0 255.255.255.0 inside
ssh 192.168.2.5 255.255.255.255 outside
ssh timeout 5
ssh version 2
console timeout 0
dhcpd dns 208.67.222.222 208.67.220.220
dhcpd auto_config outside
dhcpd option 43 ip 192.168.2.5
!
dhcpd address 192.168.1.5-192.168.1.254 inside
dhcpd enable inside
!
dhcpd address 192.168.10.5-192.168.10.254 guest
dhcpd enable guest
!
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
username xxxxxxxx password xxxxxxxxxx encrypted
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum client auto
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
Cryptochecksum:
: end
ASA5505#
11-26-2013 06:15 AM
Kim
You need a static command ie.
static (inside,outside) tcp 192.168.1.0 22 192.168.1.0 22 netmask 255.255.255.0
or
static (inside,outside) 192.168.1.0 192.168.1.0 netmask 255.255.255.0
the first only does NAT for ssh specifically. If you want to allow other ports through then either do an individual port entry like the first statement just changing the port or use the second statement which allows all ports. Obviously you would still need to add an entry in the acl on the outside interface for each port.
I generally prefer to use to use the second option but either should work.
Jon
11-26-2013 07:02 AM
Jon,
Thanks! That is what I was missing. Works great.
Kim
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