odewulf
asked on
port forwarding issue on a ASA 5505
I have configured 2 cisco asa 5505 and they are connected via VPN tunnel.
the emails are going through the first firewall and should be redirected to the second firewall,
so I added those lines to the first firewall but the forwarding doesn't seem to work:
access-list inbound extended permit tcp any interface outside eq smtp
static (inside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
where apfelcore is the name of the exchange server behind the second firewall.
FYI I can ping the server but when never I tried to telnet port 25 I got a connection time out
I tried to send smtp traffic to internal interface of asa1, then forward the smtp traffic from asa1 to asa2 but that didn't work either...
I am trying to forward the https port as well and I am having the same issue so I believe that I am doing something wrong and stupid :-(
thanks for your help
the emails are going through the first firewall and should be redirected to the second firewall,
so I added those lines to the first firewall but the forwarding doesn't seem to work:
access-list inbound extended permit tcp any interface outside eq smtp
static (inside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
where apfelcore is the name of the exchange server behind the second firewall.
FYI I can ping the server but when never I tried to telnet port 25 I got a connection time out
I tried to send smtp traffic to internal interface of asa1, then forward the smtp traffic from asa1 to asa2 but that didn't work either...
I am trying to forward the https port as well and I am having the same issue so I believe that I am doing something wrong and stupid :-(
thanks for your help
Are you using the external IP for 'apfelcore' and have a Static NAT rule to translate 'apfelcore' to an external IP?
your two lines are ok.
do you have bound you access list to outside interface like following?
access-group inbound in interface outside
do you have bound you access list to outside interface like following?
access-group inbound in interface outside
FYI on ping you will get answer from asa not from exchange-server because you dont translates ICMP-requests. but you will have enabled ICMP to outside-inderface.
Why not connect to the internal IP address of the exchange server if there is a VPN tunnel between sites? Or you specifically want to route SMTP and 443 over the Internet instead of through the tunnel for some reason?
hi JFrederick29,
for internal connections exchange is automaticaly using internal addressing because of all internal DC's are registered in common AD. only when leaving your domain (oragnisation) exchange is using external dns servers. but always you need to recieve mails from external servers and https access to you server for funktionaliy like OWA, OMA and ActiveSync-protocol.
for internal connections exchange is automaticaly using internal addressing because of all internal DC's are registered in common AD. only when leaving your domain (oragnisation) exchange is using external dns servers. but always you need to recieve mails from external servers and https access to you server for funktionaliy like OWA, OMA and ActiveSync-protocol.
ASKER
Are you using the external IP for 'apfelcore' and have a Static NAT rule to translate 'apfelcore' to an external IP? No I am using the internal IP address. for apfelcore... I think I tried with the external adrress.
yes I have that line: access-group inbound in interface outside
so now I am going to try
access-list inbound extended permit tcp any interface outside eq smtp
static (inside,outside) tcp interface smtp apfelcoreexternal smtp netmask 255.255.255.255
and on the asa 2
access-list inbound extended permit tcp any interface outside eq smtp
static (inside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
I let you know
yes I have that line: access-group inbound in interface outside
so now I am going to try
access-list inbound extended permit tcp any interface outside eq smtp
static (inside,outside) tcp interface smtp apfelcoreexternal smtp netmask 255.255.255.255
and on the asa 2
access-list inbound extended permit tcp any interface outside eq smtp
static (inside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
I let you know
if first asa has already translated the second one will get a translated package and so it hast to prevent such packages fraom tranlation. additionaly you have to enable same-security-traffic if incoming interface is on outside and VPN-interface as well.
ASKER
that didn't work so here are my 2 configurations:
asa1:
domain-name default.domain.invalid
enable password Ahr2yH4EOCc5lpbx encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
name 192.168.125.1 apfelcore
name 192.168.126.1 PDNVSurvey
!
interface Vlan1
nameif inside
security-level 100
ip address 192.168.126.2 255.255.255.0
!
interface Vlan2
nameif outside
security-level 0
ip address x.x.x.x 255.255.255.0
!
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
!
ftp mode passive
dns server-group DefaultDNS
domain-name default.domain.invalid
access-list inbound extended permit tcp any interface outside eq 3389
access-list inbound extended permit tcp any interface outside eq www
access-list inbound extended permit tcp any interface outside eq https
access-list inbound extended permit tcp any interface outside eq 4444
access-list inbound extended permit tcp any interface outside eq smtp
access-list outside_1_cryptomap extended permit ip 192.168.126.0 255.255.255.0 1
92.168.125.0 255.255.255.0
access-list inside_nat0_outbound extended permit ip 192.168.126.0 255.255.255.0
192.168.125.0 255.255.255.0
access-list inside_nat0_outbound extended permit ip 192.168.126.0 255.255.255.0
192.168.128.0 255.255.255.0
access-list inside_nat0_outbound extended permit ip 192.168.126.0 255.255.255.0
192.168.111.0 255.255.255.0
access-list outside_2_cryptomap extended permit ip 192.168.126.0 255.255.255.0 1
92.168.128.0 255.255.255.0
access-list outside_3_cryptomap extended permit ip 192.168.126.0 255.255.255.0 1
92.168.111.0 255.255.255.0
pager lines 24
logging enable
logging asdm debugging
logging class vpn asdm debugging
mtu inside 1500
mtu outside 1500
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-524.bin
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list inside_nat0_outbound
nat (inside) 1 0.0.0.0 0.0.0.0
static (inside,outside) tcp interface 3389 PDNVSurvey 3389 netmask 255.255.255.255
static (inside,outside) tcp interface https apfelcore https netmask 255.255.255.255
static (inside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
access-group inbound in interface outside
route outside 0.0.0.0 0.0.0.0 128.218.240.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
http 192.168.125.0 255.255.255.0 inside
http 192.168.126.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-3DES-SHA esp-3des esp-sha-hmac
crypto ipsec transform-set ESP-AES-256-MD5 esp-aes-256 esp-md5-hmac
crypto ipsec transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac
crypto map outside_map 1 match address outside_1_cryptomap
crypto map outside_map 1 set pfs group1
crypto map outside_map 1 set peer
crypto map outside_map 1 set transform-set ESP-3DES-SHA
crypto map outside_map 2 match address outside_2_cryptomap
crypto map outside_map 2 set pfs group1
crypto map outside_map 2 set peer
crypto map outside_map 2 set transform-set ESP-3DES-SHA
crypto map outside_map 3 match address outside_3_cryptomap
crypto map outside_map 3 set pfs
crypto map outside_map 3 set peer
crypto map outside_map 3 set transform-set ESP-3DES-MD5
crypto map outside_map interface outside
crypto isakmp enable outside
crypto isakmp policy 30
authentication pre-share
encryption 3des
hash md5
group 2
lifetime 86400
telnet 192.168.125.0 255.255.255.0 inside
telnet 192.168.126.0 255.255.255.0 inside
telnet timeout 5
ssh timeout 5
console timeout 0
dhcpd dns
!
dhcpd address 192.168.126.150-192.168.126.160 inside
dhcpd enable inside
!
tunnel-group DefaultL2LGroup ipsec-attributes
pre-shared-key *
tunnel-group type ipsec-l2l
tunnel-group ipsec-attributes
pre-shared-key *
tunnel-group type ipsec-l2l
tunnel-group ipsec-attributes
pre-shared-key *
tunnel-group type ipsec-l2l
tunnel-group ipsec-attributes
pre-shared-key *
!
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 icmp
!
service-policy global_policy global
prompt hostname context
Cryptochecksum:f9df8b89bbcc2d8ff6a1286ff507085c
: end
asa2
User Access Verification
Password:
Type help or '?' for a list of available commands.
MtZion> enable
Password: ********
MtZion# sh run
: Saved
:
ASA Version 7.2(4)
!
hostname MtZion
domain-name default.domain.invalid
enable password Ahr2yH4EOCc5lpbx encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
name 192.168.125.1 apfelcore
name 192.168.126.1 PDNVSurvey
!
interface Vlan1
nameif inside
security-level 100
ip address 192.168.125.2 255.255.255.0
!
interface Vlan2
nameif outside
security-level 0
ip address 255.255.255.0
!
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
!
ftp mode passive
dns server-group DefaultDNS
domain-name default.domain.invalid
access-list inbound extended permit tcp any interface outside eq smtp
access-list inbound extended permit tcp any interface outside eq www
access-list inbound extended permit tcp any interface outside eq https
access-list inbound extended permit tcp any interface outside eq 3389
access-list outside_1_cryptomap extended permit ip 192.168.125.0 255.255.255.0 1
92.168.126.0 255.255.255.0
access-list inside_nat0_outbound extended permit ip 192.168.125.0 255.255.255.0
192.168.126.0 255.255.255.0
access-list inside_nat0_outbound extended permit ip 192.168.125.0 255.255.255.0
192.168.111.0 255.255.255.0
access-list inside_nat0_outbound extended permit ip 192.168.125.0 255.255.255.0
192.168.128.0 255.255.255.0
access-list outside_2_cryptomap extended permit ip 192.168.125.0 255.255.255.0 1
92.168.111.0 255.255.255.0
access-list outside_3_cryptomap extended permit ip 192.168.125.0 255.255.255.0 1
92.168.128.0 255.255.255.0
pager lines 24
logging enable
logging asdm informational
mtu inside 1500
mtu outside 1500
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-524.bin
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list inside_nat0_outbound
nat (inside) 1 0.0.0.0 0.0.0.0
static (inside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
static (inside,outside) tcp interface https apfelcore https netmask 255.255.255.
255
static (inside,outside) tcp interface 3389 apfelcore 3389 netmask 255.255.255.25
5
static (inside,outside) tcp interface www apfelcore www netmask 255.255.255.255
access-group inbound in interface outside
route outside 0.0.0.0 0.0.0.0 64.54.114.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
http server enable 4444
http 192.168.125.0 255.255.255.0 inside
http 192.168.126.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-3DES-SHA esp-3des esp-sha-hmac
crypto ipsec transform-set ESP-AES-256-MD5 esp-aes-256 esp-md5-hmac
crypto ipsec transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac
crypto map outside_map 1 match address outside_1_cryptomap
crypto map outside_map 1 set pfs group1
crypto map outside_map 1 set peer
crypto map outside_map 1 set transform-set ESP-3DES-SHA
crypto map outside_map 2 match address outside_2_cryptomap
crypto map outside_map 2 set pfs
crypto map outside_map 2 set peer
crypto map outside_map 2 set transform-set ESP-3DES-MD5
crypto map outside_map 3 match address outside_3_cryptomap
crypto map outside_map 3 set pfs group1
crypto map outside_map 3 set peer
crypto map outside_map 3 set transform-set ESP-3DES-SHA
crypto map outside_map interface outside
crypto isakmp enable outside
crypto isakmp policy 10
authentication pre-share
encryption 3des
hash md5
group 2
lifetime 86400
telnet 192.168.126.0 255.255.255.0 inside
telnet 192.168.125.0 255.255.255.0 inside
telnet 128.218.240.123 255.255.255.255 outside
telnet timeout 5
console timeout 0
dhcpd dns 128.218.241.111 28.218.254.10
!
tunnel-group type ipsec-l2l
tunnel-group ipsec-attributes
pre-shared-key *
tunnel-group type ipsec-l2l
tunnel-group ipsec-attributes
pre-shared-key *
tunnel-group type ipsec-l2l
tunnel-group ipsec-attributes
pre-shared-key *
!
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 icmp
!
service-policy global_policy global
prompt hostname context
Cryptochecksum:a7ef4c545db8d6224fb668041d7780eb
: end
MtZion#
Remove these from ASA1:
conf t
no static (inside,outside) tcp interface https apfelcore https netmask 255.255.255.255
no static (inside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
What is the IP address of the exchange server? Is it 192.168.125.1?
conf t
no static (inside,outside) tcp interface https apfelcore https netmask 255.255.255.255
no static (inside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
What is the IP address of the exchange server? Is it 192.168.125.1?
ok this clears many things.
on first ASA you will get your smtp and https traffic. because of the redirection to VPN you need to translatem from and to outside interface:
static (outside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
static (outside,outside) tcp interface https apfelcore https netmask 255.255.255.255
then you must enable same-security-traffic
same-security-traffic permit intra-interface
your traffic-selection for outside_1_cryptomap does not include traffic from any to apfelcore smtp and https
add
access-list outside_1_cryptomap extended permit tcp any 192.168.125.0 255.255.255.0 eq smtp
access-list outside_1_cryptomap extended permit tcp any 192.168.125.0 255.255.255.0 eq https
prevent smtp and https also from translating
access-list inside_nat0_outbound extended permit tcp any host apfelcore eq smtp
access-list inside_nat0_outbound extended permit tcp any host apfelcore eq https
on your second asa you have to prevent this traffice from translation and to add this traffic to your tunnel.
access-list outside_1_cryptomap extended permit tcp host apfelcore any eq smtp
access-list outside_1_cryptomap extended permit tcp host apfelcore any eq https
access-list inside_nat0_outbound extended permit ip host apfelcore any eq smtp
access-list inside_nat0_outbound extended permit ip host apfelcore any eq https
on first ASA you will get your smtp and https traffic. because of the redirection to VPN you need to translatem from and to outside interface:
static (outside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
static (outside,outside) tcp interface https apfelcore https netmask 255.255.255.255
then you must enable same-security-traffic
same-security-traffic permit intra-interface
your traffic-selection for outside_1_cryptomap does not include traffic from any to apfelcore smtp and https
add
access-list outside_1_cryptomap extended permit tcp any 192.168.125.0 255.255.255.0 eq smtp
access-list outside_1_cryptomap extended permit tcp any 192.168.125.0 255.255.255.0 eq https
prevent smtp and https also from translating
access-list inside_nat0_outbound extended permit tcp any host apfelcore eq smtp
access-list inside_nat0_outbound extended permit tcp any host apfelcore eq https
on your second asa you have to prevent this traffice from translation and to add this traffic to your tunnel.
access-list outside_1_cryptomap extended permit tcp host apfelcore any eq smtp
access-list outside_1_cryptomap extended permit tcp host apfelcore any eq https
access-list inside_nat0_outbound extended permit ip host apfelcore any eq smtp
access-list inside_nat0_outbound extended permit ip host apfelcore any eq https
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hope my drawing is correct, what you're expecting. two sites connected by VPN. first has ip of MX but exchange-server is placed on second site.
a23682709.PNG
a23682709.PNG
ASKER
thanks Heiko and JFrederick29:... you are wonderful I am going to check that configuration and give it another try
ASKER
OK i had more issue so I am going to restart from scratch.
Heiko, when you said that because of the redirection to VPN you need to translatem from and to outside interface using the following command
static (outside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
where apfelcore is the internal IP correct?
I thought that having a VPN tunnel between the 2 servers won't require any other forwarding or routing but it seems that I am totally wrong. so will it not be easier to forward the smtp traffic going to the interface directly to the external IP address of the apfelcore server and on the second asa, redirect the traffic from the interface to the internal IP of the server. that way we don't have to use the VPN at all... well let me test it and I will repost the configuration tomorrow morning
thanks again for all your help
Heiko, when you said that because of the redirection to VPN you need to translatem from and to outside interface using the following command
static (outside,outside) tcp interface smtp apfelcore smtp netmask 255.255.255.255
where apfelcore is the internal IP correct?
I thought that having a VPN tunnel between the 2 servers won't require any other forwarding or routing but it seems that I am totally wrong. so will it not be easier to forward the smtp traffic going to the interface directly to the external IP address of the apfelcore server and on the second asa, redirect the traffic from the interface to the internal IP of the server. that way we don't have to use the VPN at all... well let me test it and I will repost the configuration tomorrow morning
thanks again for all your help