08-12-2024 08:30 AM
I'm working with a Cisco ASA firewall to allow external traffic from a public IP Y.Y.Y.Y to reach an internal Flask server at 172.16.10.250 on port 8000. My ASA has an external interface (outside) with the public IP X.X.X.X and an internal interface (vlan10) with the subnet 172.16.10.0/24. Despite setting up the necessary NAT and ACL rules, the traffic is not reaching the Flask server.
Interfaces:
NAT Rules:
Rule 2 (vlan10 to outside):
ACLs:
Testing Connectivity:
Routing:
Proxy Consideration:
Even though the traffic from Y.Y.Y.Y to X.X.X.X:8000 is captured on the ASA's outside interface, it is not being translated or forwarded to the Flask server on vlan10. The current NAT and ACL configurations appear to be correct, but the traffic is not reaching its destination.
Can anyone guide me ?
Best regards.
08-14-2024 02:49 AM
Now this correct
the only last Q here are you using IPsec ACL and specify ANY in ACL ?
can I see ACL of IPsec policy
MHM
08-22-2024 09:01 AM
@ztiram wrote:ciscoasa# packet-tracer input outside tcp 1.1.1.1 1234 X.X.X.228 8000 detailed
Phase: 1
Type: UN-NAT
Subtype: static
Result: ALLOW
Config:
nat (vlan10,outside) source static obj_flask_server interface service HTTP_8000 HTTP_8000
Additional Information:
NAT divert to egress interface vlan10
Untranslate X.X.X.228/8000 to 172.16.10.250/8000Phase: 2
Type: ACCESS-LIST
Subtype: log
Result: ALLOW
Config:
access-group outside_access_in in interface outside
access-list outside_access_in extended permit tcp any object obj_flask_server eq 8000
Additional Information:
Forward Flow based lookup yields rule:
in id=0x7fff2c1de430, priority=13, domain=permit, deny=false
hits=10, user_data=0x7fff2375dd40, cs_id=0x0, use_real_addr, flags=0x0, protocol=6
src ip/id=0.0.0.0, mask=0.0.0.0, port=0, tag=0
dst ip/id=172.16.10.250, mask=255.255.255.255, port=8000, tag=0, dscp=0x0
input_ifc=outside, output_ifc=anyPhase: 3
Type: NAT
Subtype:
Result: ALLOW
Config:
nat (vlan10,outside) source static obj_flask_server interface service HTTP_8000 HTTP_8000
Additional Information:
Static translate 1.1.1.1/1234 to 1.1.1.1/1234
Forward Flow based lookup yields rule:
in id=0x7fff2b74ebf0, priority=6, domain=nat, deny=false
hits=8, user_data=0x7fff2a78f570, cs_id=0x0, flags=0x0, protocol=6
src ip/id=0.0.0.0, mask=0.0.0.0, port=0, tag=0
dst ip/id=45.141.173.228, mask=255.255.255.255, port=8000, tag=0, dscp=0x0
input_ifc=outside, output_ifc=vlan10Phase: 4
Type: NAT
Subtype: per-session
Result: ALLOW
Config:
Additional Information:
Forward Flow based lookup yields rule:
in id=0x7fff29b7dbb0, priority=0, domain=nat-per-session, deny=false
hits=8312888, user_data=0x0, cs_id=0x0, reverse, use_real_addr, flags=0x0, protocol=6
src ip/id=0.0.0.0, mask=0.0.0.0, port=0, tag=0
dst ip/id=0.0.0.0, mask=0.0.0.0, port=0, tag=0, dscp=0x0
input_ifc=any, output_ifc=anyPhase: 5
Type: IP-OPTIONS
Subtype:
Result: ALLOW
Config:
Additional Information:
Forward Flow based lookup yields rule:
in id=0x7fff2a7e1580, priority=0, domain=inspect-ip-options, deny=true
hits=25451520, user_data=0x0, cs_id=0x0, reverse, flags=0x0, protocol=0
src ip/id=0.0.0.0, mask=0.0.0.0, port=0, tag=0
dst ip/id=0.0.0.0, mask=0.0.0.0, port=0, tag=0, dscp=0x0
input_ifc=outside, output_ifc=anyPhase: 6
Type: VPN
Subtype: ipsec-tunnel-flow
Result: DROP
Config:
Additional Information:
Forward Flow based lookup yields rule:
in id=0x7fff2b307560, priority=70, domain=ipsec-tunnel-flow, deny=false
hits=8125, user_data=0x0, cs_id=0x7fff2b2fe4e0, reverse, flags=0x0, protocol=0
src ip/id=0.0.0.0, mask=0.0.0.0, port=0, tag=0
dst ip/id=0.0.0.0, mask=0.0.0.0, port=0, tag=0, dscp=0x0
input_ifc=outside, output_ifc=anyResult:
input-interface: outside
input-status: up
input-line-status: up
output-interface: vlan10
output-status: up
output-line-status: up
Action: drop
Drop-reason: (acl-drop) Flow is denied by configured rule
The acl used in the "match address" statement in the crypto map should match all outgoing traffic on the outside interface, that shhould be sent through the vpn tunnel. Usually that is not "any to any". So there may be an issue in our vpn configuration. And you may want to configure a nat exemption for your vpn traffic (in most cases, vpn is used to connect local and remote networks without doing nat between those neworks).
08-14-2024 04:46 AM - edited 08-14-2024 04:46 AM
access-list acl-amzn line 1 extended permit ip any4 10.0.0.0 255.0.0.0 (hitcnt=21970) 0x873edccf
access-list acl-amzn line 2 extended permit ip any4 any4 (hitcnt=13984) 0xf6a0df5b
access-list acl-amzn line 3 extended permit ip 172.16.4.0 255.255.254.0 any (hitcnt=0) 0x00b65006
access-list acl-amzn line 4 extended permit ip 172.16.20.0 255.255.254.0 any (hitcnt=0) 0xeae15225
access-list acl-amzn line 5 extended permit ip 172.16.10.0 255.255.255.0 any (hitcnt=0) 0x29b9d317
access-list acl-amzn line 6 extended permit ip 172.16.99.0 255.255.255.0 any (hitcnt=0) 0xfe602352
access-list acl-amzn line 7 extended permit icmp 172.16.99.0 255.255.255.0 10.0.0.0 255.0.0.0 (hitcnt=0) 0x2c28a2a1
access-list acl-amzn line 8 extended permit ip any any (hitcnt=0) 0x836ef7df
access-list acl-amzn line 9 extended permit icmp 172.16.4.0 255.255.254.0 host 10.0.0.101 echo (hitcnt=0) 0x1c6617f2
access-list amzn-filter extended permit ip 10.0.0.0 255.0.0.0 172.16.4.0 255.255.254.0
access-list amzn-filter extended permit ip any4 any4
access-list amzn-filter extended permit icmp any4 any4
access-list amzn-filter extended permit ip 10.0.0.0 255.0.0.0 172.16.99.0 255.255.255.0
access-list amzn-filter extended permit ip 10.0.0.0 255.0.0.0 172.16.20.0 255.255.254.0
access-list amzn-filter extended permit ip 10.0.0.0 255.0.0.0 172.16.150.0 255.255.255.0
access-list amzn-filter extended permit ip 10.0.0.0 255.0.0.0 172.16.10.0 255.255.255.0
08-14-2024 04:48 AM
Thanks for sharing but which one of these ACL use for ipsec?
MHM
08-14-2024 05:32 AM
Actually my vpn configuration is this one.
crypto ipsec ikev1 transform-set transform-amzn esp-aes esp-sha-hmac
crypto ipsec security-association replay window-size 128
crypto ipsec security-association pmtu-aging infinite
crypto ipsec df-bit clear-df outside
crypto map amzn_vpn_map 1 match address acl-amzn
crypto map amzn_vpn_map 1 set pfs
crypto map amzn_vpn_map 1 set peer
crypto map amzn_vpn_map 1 set ikev1 transform-set transform-amzn
crypto map amzn_vpn_map 1 set security-association lifetime seconds 3600
crypto map amzn_vpn_map interface outside
crypto ca trustpool policy
vpn-filter value amzn-filter
08-14-2024 05:37 AM
172.16.10.250 <<- this server real IP match
access-list acl-amzn line 5 extended permit ip 172.16.10.0 255.255.255.0 any (hitcnt=0) 0x29b9d317
access-list acl-amzn line 2 extended permit ip any4 any4 (hitcnt=13984) 0xf6a0df5b
access-list acl-amzn line 8 extended permit ip any any (hitcnt=0) 0x836ef7df
so friend your ACL of IPsec is drop the access to internal server
you must reconfig your IPsec ACL
MHM
08-30-2024 12:16 AM
Your acl acl-amzn is wrong. it shoud match all outgoing traffic running through your ipsec tunnel and nothhing else. So maybe it should be somethhing llike::
access-list amzn-filter extended permit ip 172.16.4.0 255.255.254.0 10.0.0.0 255.0.0.0
access-list amzn-filter extended permit ip 172.16.99.0 255.255.255.0 10.0.0.0 255.0.0.0
access-list amzn-filter extended permit ip 172.16.20.0 255.255.254.0 10.0.0.0 255.0.0.0
access-list amzn-filter extended permit ip 172.16.150.0 255.255.255.0 10.0.0.0 255.0.0.0
access-list amzn-filter extended permit ip 172.16.10.0 255.255.255.0 10.0.0.0 255.0.0.0
The line "access-list amzn-filter extended permit ip any4 any4" leads to soethhing lie "send all traffic through ipsec tunnel and accept incoing traffic ony if it is ipsec encrypted" and i think, that was not what you want ...
08-14-2024 06:03 AM
If i put a deny first to 172.16.10.250 will it be ok ?
08-14-2024 06:05 AM
This will make server not access any remote LAN over ipsec vpn
But for checking you can add it and check access to server
MHM
08-14-2024 06:11 AM
Do i have any other solution ?
In fact my flask server just need to get webhook messages from my jira cloud server on port 8000 so i think he doesnt need to get access to the remote networks.
08-14-2024 07:11 AM
Even tho i added
access-list acl-amzn line 1 extended deny ip host 172.16.10.250 any (hitcnt=0) 0x61ad46b6
I still get the same result with
packet-tracer input outside tcp 1.1.1.1 1234 X.X.X.228 8000 detailed
08-14-2024 11:07 AM
I dont think the deny work with VPN ACL
you need to reconfig VPN ACL
sorry there is no other solution
MHM
08-26-2024 03:08 AM
Thanks for your answer, so if i make a DMZ network out of the vpn policy it should work ?
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