简介
本文档介绍在针对尝试穿过防火墙的 TCP 会话发送 TCP 重置时思科防火墙的行为。
先决条件
要求
Cisco 建议您了解以下主题:
- ASA数据包流
- FTD数据包流
- ASA/FTD数据包捕获
注意:此描述的行为适用于ASA和安全防火墙威胁防御。
使用的组件
本文档中的信息基于以下软件:
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
故障排除
防火墙为尝试通过防火墙的TCP会话发送TCP重置 防火墙会根据访问列表拒绝该请求。防火墙还会对访问列表允许但不属于防火墙中存在的连接且因此被有状态功能拒绝的数据包发送重置。
案例研究1:服resetoutbound
务已启用且客户端到服务器的流量被拒绝。
默认情况下,所有接口都启用service resetoutbound。在本案例研究中,没有允许客户端到服务器流量的规则。
以下是在防火墙中配置的捕获:
# show capture
capture cap_I type raw-data trace trace-count 50 interface INSIDE [Capturing - 0 bytes]
match tcp host 192.168.191.250 host 10.10.20.250
capture cap_O type raw-data trace trace-count 50 interface OUTSIDE [Capturing - 0 bytes]
match tcp host 192.168.191.250 host 10.10.20.250
capture asp type asp-drop all [Capturing - 0 bytes]
match tcp host 192.168.191.250 host 10.10.20.250
默认情况下启用服务resetoutbound。因此,如果命令的输出未显show run service
示任何内容,则意味着该命令处于启用状态:
# show run service ...
- 客户端通过防火墙将TCP SYN发送到服务器10.10.20.250/17111。此捕获中的1号数据包:
# show capture cap_I
1: 19:48:55.512500 192.168.191.250.46118 > 10.10.20.250.17111: S 3490277958:3490277958(0) win 29200
- 由于没有允许此流量的ACL,因此安全防火墙会出于原因丢弃此数据
acl-drop
包。此数据包在asp-drop捕获中捕获。
# show capture cap_I packet-number 1 trace det
1: 19:48:55.512500 a2c7.1e00.0004 0050.56b3.05b1 0x0800 Length: 74
192.168.191.250.46118 > 10.10.20.250.17111: S [tcp sum ok] 3490277958:3490277958(0) win 29200
(DF) (ttl 49, id 60335)
- 防火墙发送一个RST数据包,其中服务器ip地址作为源ip地址。此捕获中的2号数据包:
# show capture cap_I
1: 19:48:55.512500 192.168.191.250.46118 > 10.10.20.250.17111: S 3490277958:3490277958(0) win 29200
2: 19:48:55.512806 10.10.20.250.17111 > 192.168.191.250.46118: R 0:0(0) ack 3490277959 win 29200
案例研究2:未启用服务resetoutbound,并拒绝客户端到服务器的流量。
在案例研究2中,没有允许客户端到服务器流量的规则,且服务resetoutbound已禁用。
命令show run service
显示已禁用服务resetoutbound。
# show run service
no service resetoutbound
- 客户端通过Firewall将TCP TCP发送到服务器10.10.20.250/17111。此捕获中的1号数据包:
# show capture cap_I
1: 19:48:55.512500 192.168.191.250.46118 > 10.10.20.250.17111: S 3490277958:3490277958(0) win 29200
2.由于没有允许此流量的ACL,因此安全防火墙会出于原因丢弃此数据acl-drop
包。此数据包在 asp-drop capture.
# show capture cap_I packet-number 1 trace det
1: 19:48:55.512500 a2c7.1e00.0004 0050.56b3.05b1 0x0800 Length: 74 192.168.191.250.46118 > 10.10.20.250.17111: S [tcp sum ok] 3490277958:3490277958(0) win 29200
(DF) (ttl 49, id 60335)
Subtype: log Result: DROP Config: access-group allow_all global access-list allow_all extended deny ip any any Additional Information: Result: input-interface: INSIDE input-status: up input-line-status: up output-interface: OUTSIDE output-status: up output-line-status: up Action: drop Drop-reason: (acl-drop) Flow is denied by configured rule, Drop-location: frame 0x0000561961c8333f flow (NA)/NA
3.显示asp-drop capture
了SYN数据包,但没有通过内部接口发回cap_I capture
的RST数据包:
# show cap cap_I
1: 23:58:32.850755 192.168.191.250.46118 > 10.10.20.250.17111: S 3490277958:3490277958(0) win 29200
# show cap asp 1: 23:58:32.850999 192.168.191.250.46118 > 10.10.20.250.17111: S 3490277958:3490277958(0) win 29200
案例研究3:Service resetoutbound disabled(默认)service resetinbound disabled(默认)
默认情况下,为所有接口启用service resetoutbound,并禁用service resetinbound。
1.服务器通过防火墙向客户端发送TCP数据包(SYN/ACK)。防火墙没有用于此流量的内置连接。
# show capture cap_O
1: 00:22:35.111993 10.10.20.250.17111 > 192.168.191.250.46118: S 3475024584:3475024584(0) ack 3490277959 win 4140
2.重置不会从防火墙发送到服务器。此SYN/ACK数据包被无提示丢弃tcp-not-syn
。它也被捕获到 asp-drop capture
中。
# show capture cap_O packet-number 1 trace detail
1: 00:22:35.111993 a2c7.1e00.003e 0050.56b3.1ef5 0x0800 Length: 70
10.10.20.250.17111 > 192.168.191.250.46118: S [tcp sum ok] 3475024584:3475024584(0) ack 3490277959 win 4140
(DF) (ttl 255, id 62104)
Result: input-interface: OUTSIDE input-status: up input-line-status: up output-interface: INSIDE output-status: up output-line-status: up Action: drop Drop-reason: (tcp-not-syn) First TCP packet not SYN, Drop-location: frame 0x0000561961c89aaa flow (NA)/NA
# show capture asp 1: 00:22:35.112176 10.10.20.250.17111 > 192.168.191.250.46118: S 3475024584:3475024584(0) ack 3490277959 win 4140
案例研究4:已禁用Service resetoutbound disabled(默认)service resetinbound disabled。
默认情况下,为所有接口禁用service resetoutbound,同时使用配置命令禁用service resetinbound。
命令的输出显示 show run service
,service resetoutbound已禁用(默认),service resetinbound已被配置命令禁用。
# show run service
service resetinbound
1.服务器通过防火墙向客户端发送TCP数据包(SYN/ACK)。
# show cap cap_O
1: 00:32:26.434395 10.10.20.250.17111 > 192.168.191.250.46118: S 3475024584:3475024584(0) ack 3490277959 win 4140
2.防火墙没有为此流建立的连接并丢弃该流。显asp-drop captures
示数据包:
# show capture cap_O packet-number 1 trace detail
1: 00:32:26.434395 a2c7.1e00.003e 0050.56b3.1ef5 0x0800 Length: 70
10.10.20.250.17111 > 192.168.191.250.46118: S [tcp sum ok] 3475024584:3475024584(0) ack 3490277959 win 4140
(DF) (ttl 255, id 62104)
Result: input-interface: OUTSIDE input-status: up input-line-status: up output-interface: INSIDE output-status: up output-line-status: up Action: drop Drop-reason: (tcp-not-syn) First TCP packet not SYN, Drop-location: frame 0x0000561961c89aaa flow (NA)/NA
3.自service resetinbound以来,防火墙使用客户端的源ip地址向服务器发送RST数据包。
# show capture cap_O
1: 00:32:26.434395 10.10.20.250.17111 > 192.168.191.250.46118: S 3475024584:3475024584(0) ack 3490277959 win 4140
2: 00:32:26.434608 192.168.191.250.46118 > 10.10.20.250.17111: R 3490277959:3490277959(0) ack 3475024585 win 4140
相关信息