内网服务器(10.55.0.17)---防火墙(192.100.63.43)---监控台(192.100.161.3)
防火墙上global地址192.100.63.43映射内网服务器inside地址10.55.0.17。对应会话如下:
Initiator:
Source IP/port: 192.100.161.3/7100
Destination IP/port: 192.100.63.43/7100
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: UDP(17)
Inbound interface: GigabitEthernet1/0/10
Source security zone: GA
Responder:
Source IP/port: 10.55.0.17/7100
Destination IP/port: 192.100.161.3/7100
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: UDP(17)
Inbound interface: Route-Aggregation1
Source security zone: Trust
State: UDP_READY
Application: SIP
Rule ID: 0
Rule name: 1
Start time: 2022-11-29 23:07:03 TTL: 285s
Initiator->Responder: 15 packets 11970 bytes
Responder->Initiator: 22 packets 12161 bytes
不涉及
故障现象:监控中心无法获取视频画面,内网服务器的资源无法传递。
关键配置如下:
#
port-mapping application sip port 7100
#
nat alg sip
nat static inbound 192.100.63.43 10.55.0.17
#
interface GigabitEthernet1/0/10
port link-mode route
ip address 192.100.63.43 255.255.255.128
ip last-hop hold
nat outbound 2000
nat static enable
manage ping inbound
manage ping outbound
#
acl basic 2000
rule 0 permit
#
根据现场反馈访问监控中心侧发起的INVITE保卫没有进行NAT转换,No.1报文(192.100.161.3/7100--->192.100.63.43/7100),没有抓到NAT转换后的报文(192.100.161.3/7100--->10.55.0.17/7100):
查看192.100.161.3/7100--->192.100.63.43/7100的会话,发现没有检索到。怀疑是会话冲突导致NAT转换失败,创建的会话被删除掉了。
优化配置如下:
#
nat staticoutbound 10.55.0.17 192.100.63.43 //实现双向互转,原来的配置只能外访内实现NAT转换,因为没加reversible参数
#
interface GigabitEthernet1/0/10
port link-mode route
ip address 192.100.63.43 255.255.255.128
ip last-hop hold
nat outbound 3005
nat static enable
manage ping inbound
manage ping outbound
#
acl advanced 3005
rule 10 deny ip source 10.55.0.17
rule 15 permit ip
#
进行配置优化后,现场反馈业务还是不正常。进一步抓包定位问题,首先看NAT转换已经没有问题了,报文都是成对出现。
问题显而易见出现在No.8和No.9报文,监控中心连接服务器的1052端口,连接被重置了,导致获取视频信息失败。
对于TCP连接来说,连接被重置的原因有很多,最可能的原因是请求了一个不存在的端口,即服务器的1052端口并没有提供服务。
那么,为什么监控中心会去连接服务器的1052端口呢,问题可以从服务器回给监控中心的200 OK报文中(No.5和No.6)找到答案。
很显然,服务器回应给监控中心的报文中,打开端口由26126变成了1052。
原因在于防火墙开启了NAT SIP ALG功能,会对应用层端口进行转换,并建立对应的关联表项。但是对于现场的业务模型来说,内网服务器做了B2BUA,把自己插入到了后续sip信令的路径上,实际是不需要防火墙开启ALG功能的。
关闭NAT SIP ALG功能。
建议:针对SIP的问题,建议在防火墙上抓取NAT前后的报文进行分析,同时把正向的报文和反向的报文都打印出来(打印会话添加verbose参数!!),关联表(disp session relation-table ipv4)作为辅助,一起分析吧~