Print

portal认证失败,网络故障或者portal服务器没有响应排查方法

组网及说明

组网不涉及

问题描述

某句点组网时,对portal服务器做了NAT,发现web页面可以拨号正常上线,但是使用inode客户端进行拨号时报portal认证失败,网络故障或者portal服务器没有响应


过程分析

1、客户端发送CODE_PP_DOMAIN_REQUSET报文给portal服务器,此时可以看到客户端发送给portal是服务器NAT后地址10.217.90.20

[2019-09-20 15:47:02] [DtlCmn] [1250] PortalPkt

Packet Type: [CODE_PP_DOMAIN_REQUEST]  Client ---> Server/Bas

Head: Version = 0x2(Portal); HeadType = 0x6e; AuthType = 0; Rsvd = 0; SeriOno= 6085; ReqId = 0; UserIP = 10.222.22.71; UserPort = 0; ErrCode = 0; AttrNum = 2;

EX_ATTR_PRIVATE_IP_ADDRESS = 10.222.22.71;

EX_ATTR_PUBLIC_IP_ADDRESS = 10.222.22.71;

[2019-09-20 15:47:02] [Dbg] [1250] Portal sendAndReceivePkt: PKT to 10.217.90.20 and 50200. TimeOut is 5000

2portal服务器回应CODE_PP_DOMAIN_RESPONES报文给客户端,注意此时在回应此报文时,报文使用EX_ATTR_PORTAL_SERVER_ADDR携带了portal服务器的真实的IP地址10.49.66.140

 [2019-09-20 15:47:02] [DtlCmn] [1250] PortalPkt

Packet Type: [CODE_PP_DOMAIN_RESPONES]  Client <--- Server/Bas

Head: Version = 0x2(Portal); HeadType = 0x6f; AuthType = 1; Rsvd = 0; SeriOno= 6085; ReqId0 = 0; ReqId1 = 0; UserIP = 10.222.22.71; UserPort = 0; ErrCode = 0; AttrNum = 26;

Attributes: EX_ATTR_USER_ID = 8996123784895677117;

EX_ATTR_PORTAL_VERSION = 2;

EX_ATTR_PROTOCAL_TYPE = http;

EX_ATTR_LOGIN_LANGUAGE = Dynamic;

EX_ATTR_NEED_NAME = 1;

 =

EX_ATTR_NAT_TYPE = 0

EX_ATTR_HANDSHAKE_DELAY = 0;

EX_ATTR_HANDSHAKE_OVERTIME = 9223372036854775807;

EX_ATTR_LOGIN_TIMEOUT = 4000;

EX_ATTR_LOGOUT_TIMEOUT = 8000;

EX_ATTR_DHCP_DELAY = 3000;

EX_ATTR_DHCP_TIMES = 3;

EX_ATTR_DEVICE_IP2FLAG = 0;

EX_ATTR_PORTAL_SERVER_ADDR = 10.49.66.170;

EX_ATTR_PORTAL_SERVER_PORT = 50200;

EX_ATTR_SERVER_TYPE_ID = ZWWW,HLW;

EX_ATTR_SERVER_TYPE_DESC = zwww,hlw;

EX_ATTR_ENCRYPT_FLAG = 1;

 

3、客户端发送CODE_PP_LOGIN_REQUEST报文给PORTAL服务器,注意此时发送给的PORTAL服务器的IP地址是NAT前的IP地址(真实PORTAL服务器的IP地址)10.49.66.170,IP地址就是从上个报文中携带过来的,可以看到发送此报文给PORTAL服务器的真实IP地址后,实际网络是不通的,PORTAL服务器一直没有回应此报文,导致认证失败。

[2019-09-20 15:47:02] [DtlCmn] [1250] PortalPkt

Packet Type: [CODE_PP_LOGIN_REQUEST]  Client ---> Server/Bas

Head: Version = 0x2(Portal); HeadType = 0x64; AuthType = 1; Rsvd = 0; SeriOno= 6085; ReqId = 0; UserIP = 10.222.22.71; UserPort = 0; ErrCode = 0; AttrNum = 7;

 

 

[2019-09-20 15:47:03] [Dbg] [1250] Portal sendAndReceivePkt: PKT to 10.49.66.170 and 50200. TimeOut is 4000

[2019-09-20 15:47:07] [Err] [1250] Portal sendAndReceivePkt: recvfrom packets failed, ErrCode is: 10060.

[2019-09-20 15:47:07] [Err] [1250] Portal sendAndReceivePkt:  An error occured while sending or receiving packet.

[2019-09-20 15:47:07] [Err] [1250] Portal authentiction: Failed to send/receive a packet type= CODE_PP_LOGIN_REQUEST

 

4、此时web界面认证是正常的,抓取此时终端和PORTAL服务器的交互报文,认证报文如下,可以看到整个认证报文,都是和NAT后的PORTAL服务器IP=10.217.90.20交互报文,这个IP对于客户端而言是可达的,所以报文交互正常,没有出现认证失败的问题。


 

解决方法

截止到此案例发表为止,INODE还不支持PORTAL服务器做NAT的场景,因此如果PORTAL服务器做了NAT后,无法使用INODE进行拨号

建议改成使用WEB界面进行拨号认证