Cisco ASA 上的端口转发规则不起作用 - “丢弃原因:(acl-drop)流被配置的规则拒绝”

网络工程 思科 纳特 转发端口
2021-07-06 05:10:26

思科的新手,所以我希望这个问题不会太菜。我正在尝试设置端口转发规则,以允许从“外部”到 LAN 上的 Web 服务器的“任何”SSL 流量问题显然在于一个“隐式规则”,无论我尝试什么,它都会阻止流量。我一直在尝试添加访问规则来解决这个问题,但它要么不起作用,要么完全破坏了 NAT(或两者兼而有之)。我主要尝试使用 ASDM,也尝试过通过 Putty 使用 CLI(但我对这些命令还不是很满意)。

这是我在 CLI 中的数据包跟踪测试的输出:

    MyASA(config)# packet-tracer input inside tcp 8.8.8.8 443 192.168.3.133 443

Phase: 1
Type: ROUTE-LOOKUP
Subtype: Resolve Egress Interface
Result: ALLOW
Config:
Additional Information:
in   192.168.3.0     255.255.255.0   inside

Phase: 2
Type: ACCESS-LIST
Subtype:
Result: DROP
Config:
Implicit Rule
Additional Information:
 Forward Flow based lookup yields rule:
 in  id=0xcc9bdf80, priority=111, domain=permit, deny=true
        hits=547, user_data=0x0, cs_id=0x0, flags=0x4000, 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=inside, output_ifc=inside

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

MyASA(config)#

这是我的(经过消毒的)“表演节目”-非常感谢大家

    Type help or '?' for a list of available commands.
MyLabASA> enable
Password: *********
MyLabASA# show run
: Saved
:
: Serial Number: 
: Hardware:   ASA5505, 512 MB RAM, CPU Geode 500 MHz
:
ASA Version 9.2(3)
!
hostname MyLabASA
domain-name Labz.local
enable password 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.3.1 255.255.255.0
 dhcprelay information trusted
!
interface Vlan2
 description CenturyLink 100 Mbps fiber
 nameif outside
 security-level 0
 pppoe client vpdn group LabzGroup
 ip address pppoe setroute
!
ftp mode passive
dns server-group DefaultDNS
 domain-name Labz.local
object network Work_Corp_WAN
 host 72.165.30.162
 description Work corporate network
object network Dell-Precision
 host 192.168.3.38
 description Dell-Precision
object network obj-Work_Corp_WAN
object service RDP-TCP
 service tcp source eq 3389 destination eq 3389
 description Win_RDP_port-3389
object network Dell-Optiplex
 host 192.168.3.133
 description Dell-Optiplex
object service SSL
 service tcp source eq https destination eq https
 description SSL
object network inside-subnet
 subnet 192.168.0.0 255.255.255.0
object network Pub_IP_Oct4
 host (Inside_Public_IP)
 description CtLink Pub IP - Oct 4, 2018
object network Allow_inbound_SSL
 host 192.168.3.133
 description Allow inbound SSL to Labnmmon.com IIS site on Dell-Optiplex
access-list OUTSIDE-IN remark Allow HTTPS traffic to Dell-Optiplex
access-list OUTSIDE-IN extended permit tcp any object Dell-Optiplex eq https
access-list Inbound_SSL extended permit tcp interface outside object Dell-Optiplex eq https
access-list from_outside extended permit icmp object Work_Corp_WAN any
access-list from_outside extended permit icmp any object Work_Corp_WAN
access-list OUTSIDE extended permit icmp object Work_Corp_WAN any
access-list OUTSIDE extended permit icmp object Work_Corp_WAN any echo
access-list OUTSIDE extended permit icmp any object Work_Corp_WAN echo
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 echo-reply outside
no asdm history enable
arp timeout 14400
no arp permit-nonconnected
nat (any,outside) source dynamic any interface
nat (inside,outside) source static Dell-Optiplex interface service any SSL
!
object network Dell-Optiplex
 nat (inside,outside) static interface
access-group Inbound_SSL 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
aaa authentication http console LOCAL
aaa authentication serial console LOCAL
aaa authentication ssh console LOCAL
aaa authentication enable console LOCAL
aaa authorization command LOCAL
aaa authorization exec LOCAL
http server enable
http 192.168.3.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
no ssh stricthostkeycheck
ssh 192.168.3.0 255.255.255.0 inside
ssh timeout 60
ssh version 2
ssh key-exchange group dh-group1-sha1
console timeout 0
vpdn group LabzGroup request dialout pppoe
vpdn group LabzGroup localname 
vpdn group LabzGroup ppp authentication chap
vpdn username password ********** store-local

dhcpd dns 1.1.1.1 8.8.8.8
dhcpd domain Labz.local
!
dhcpd address 192.168.3.30-192.168.3.90 inside
dhcpd dns 1.1.1.1 8.8.8.8 interface inside
!
dhcprelay server 192.168.3.4 inside
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
username LabAdmin password encrypted privilege 15
username LabAdmin attributes
 service-type admin
!
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
  inspect icmp
  inspect icmp error
!
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:86a10aca3e2df8250c81c3f9e89b5663
: end
MyLabASA#

更新 在答案中进行建议的更改后,我在数据包跟踪的第 5 阶段没有得到“结果:DROP”(它在第 2 阶段被丢弃):

Phase: 5      
Type: ACCESS-LIST
Subtype: 
Result: DROP
Config:
Implicit Rule
Additional Information:
  Forward Flow based lookup yields rule:
  out id=0xcd49c438, priority=11, domain=permit, deny=true
      hits=1, user_data=0x5, cs_id=0x0, use_real_addr, 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=any, output_ifc=inside

2019 年 2 月更新:
我想不通,所以我发了一篇新帖子,解决并回答了我的问题:
仍然无法在我的 ASA 5505 中进行端口转发 - 现在尝试 DMZ 端口

1个回答
object service SSL
 service tcp source eq https destination eq https

nat (inside,outside) source static Dell-Optiplex interface service any SSL

这是您的静态 PAT 规则吗?如果是,则说明配置错误。

你说的是ASA,任何交通从内部去郊外,源Dell-Optiplex和端口any应该被翻译成interfaceIP地址,并已两者源和目的端口改为443。

ASA 上的 NAT 非常灵活。这篇文章将教你一切你需要知道的。

具体来说,要配置端口转换,这是要遵循的配置语法:

在此处输入图片说明

鉴于此,这样的事情应该可以工作(假设我猜对了您的网络服务器的对象):

object network Dell-Optiplex
 host 192.168.3.133

object service SRC-HTTPS
 service tcp source eq https

nat (inside,outside) source static Dell-Optiplex interface service SRC-HTTPS SRC-HTTPS

上述文章的这一部分将详细解释语法。它还将解释为什么您要从出站流量的角度编写翻译,即使它是您打算匹配的技术上的入站流量。


编辑,评论空间不足:

另外,您的 ACL 似乎不正确:

access-group Inbound_SSL in interface outside
access-list Inbound_SSL extended permit tcp interface outside object Dell-Optiplex eq https

第一行将Inbound_SSLACL 应用到outside接口。您只能将一个 ACL 应用于接口,并配置其他三个。只是指出这一点,以防您打算让其他人也申请。

第二行是实际的 ACL。它允许从外部接口 IP 源到 Web 服务器目标的流量。除非您自己的防火墙正在与您的网络服务器通信,否则这将与您想要的流量不匹配。(这可能是隐式拒绝全部丢弃流量的原因)。

它应该是这样的:

access-list Inbound_SSL extended permit tcp any object Dell-Optiplex eq https

这允许流量any通过端口 443源到您的网络服务器的目的地。