TR069服务器配置DHCP/IP/PING/Tracert/HTTP/PPPoE等仿真诊断模板及IPWAN和PPPoE WAN模板创建

1.IPOE WAN 连接配置
下发操作步骤:

创建DHCP WAN,
1.	建立InternetGatewayDevice.WANDevice.1.WANConnectionDevice.==1实例(若有预配置WAN,可忽略该步骤)
2.	再增加
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.=={i}实例==2
3.	设置WANIPConnection相关参数
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.X_CMCC_VLANMode =
VLAN启用模式,以下值之一:
0表示不启用
1表示保持原来的标志位值
2表示重写VLAN

InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.{i}.X_CMCC_VLANIDMark =
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.{i}.ConnectionType = IP_Routed
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.{i}.AddressingType = DHCP
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.{i}.X_CMCC_LanInterface = (和LAN侧的绑定关系)InternetGatewayDevice.LANDevice.1.LANEthernetInterfaceConfig.2
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.{i}.X_CMCC_ ServiceList = (业务绑定)
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.{i}.Enable=true
实际操作实践:

1. 先进入TR098数据模型树中 创建Object对象通过AddObject方法去创建,创建后会自动生成一条新的WAN连接:
由于默认WAN连接存在一条预配置IPOE 的TR069 WAN连接,WANConnectionDevice.1该实例默认就已经创建好了,因此创建WANIPConnection.==2实例从2 开始;
如:
InternetGatewayDevice.WANDevice.1.WANConnectionDevice. == 2(实例值)
2.设置WANIPConnection相关参数

InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.X_CMCC_VLANMode     unsignedInt   2 (tag vlan)
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.X_CMCC_VLANIDMark   unsignedInt  200
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.X_CMCC_802-1pMark   unsignedInt   0(0--7)
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.ConnectionType      string      IP_Routed or IP_Bridged
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.AddressingType      string  DHCP 或 Static
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.X_CMCC_LanInterface    string  InternetGatewayDevice.LANDevice.1.LANEthernetInterfaceConfig.2 (绑定LAN2 端口)
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.X_CMCC_ ServiceList    string ("TR069","INTERNET","VOIP","OTHER")
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.Enable   boolean  TRUE 或 FALSE(默认)
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.NATEnabled    boolean  TRUE 或 FALSE(默认)

设置静态WANIP,需要加上以下配置IPAddress,MASK,DNS,default gateway         
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.ExternalIPAddress   string   192.168.1.111
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.SubnetMask        string  255.255.255.0
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.DefaultGateway   string   192.168.1.254
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.DNSEnabled   boolean  TRUE
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.DNSServers  string   192.168.1.254
IP类型设置,默认IPv4
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.X_CMCC_IPMode       unsignedInt   默认为1(IPv4;2:IPv6;3:IPv4/IPv6;3:IPv4/IPv6)
组播VLANID设置
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.X_CMCC_MulticastVlan   Int   1000(-1 表示不启用)
是否启用本WAN绑定的LAN侧端口的DHCP分配IP功能
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.X_CMCC_LanInterface-DHCPEnable  boolean  TRUE 或 FALSE

1.1.DHCP诊断模板信息 (前提是 ONU通过password方式去注册)

查看诊断结果,在TR-098数据模型树中通过GetParameterValue方法查看:
设置路径:InternetGatewayDevice.X_CMCC_IPoEDiagnostics.
可以看到以下所有参数信息,重点看InternetGatewayDevice.X_CMCC_IPoEDiagnostics.Result 这一参数;
仿真结果,如下值之一:
“SendDHCPMsgError” 发送DHCP报文失败
“ServerNotFound” 找不到DHCP服务器
“ServerDeny” DHCP服务器拒绝请求
“GetIPAddressTimeout” 请求IP地址超时
“AllDestinationPingFail” 所有的ping都失败
“SomeDestinationPingFail” 部分ping失败
“Other” 其他错误

InternetGatewayDevice.X_CMCC_IPoEDiagnostics.FailureCount	                  0
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.DefaultGateway	            默认网关IP
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.AverageResponseTime              0
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.MaximumResponseTime	          0
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.PingNumberOfRepetitions	      5
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.Timeout	                      800
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.LocalAddress	             仿真获取到的IP地址(默认会获取WANIP)
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.MinimumResponseTime	          0
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.Result	
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.WANInterface	
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.SuccessCount	                  0
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.UserMac	                 5c:c7:d7:00:a0:11
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.PingDestIPAddress	        192.168.1.254(DHCP连接成功后需要Ping的目的IP)
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.DiagnosticsState	             Complete

配置一下DHCP 诊断模板
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.WANInterface 	    string 	InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.PingDestIPAddress 	string 	192.168.1.254
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.Timeout 	        unsignedInt 	800
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.DiagnosticsState 	string 	Start
InternetGatewayDevice.X_CMCC_IPoEDiagnostics.UserMac 	        string 	5c:c7:d7:00:a0:11

DiagnosticsState:仿真状态,如下值之一:
"None"  空
"Start"  开始
"Stop"  停止
"DHCPProceeding"  DHCP进行中
"Complete" 完成
其中Start和Stop为可写,其它状态只读。

DHCP 仿真成功,如下图所示:
TR069服务器配置DHCP/IP/PING/Tracert/HTTP/PPPoE等仿真诊断模板及IPWAN和PPPoE WAN模板创建_第1张图片
仿真失败图:TR069服务器配置DHCP/IP/PING/Tracert/HTTP/PPPoE等仿真诊断模板及IPWAN和PPPoE WAN模板创建_第2张图片
1.2. Ping诊断 模板配置
查看诊断结果时路径:InternetGatewayDevice.IPPingDiagnostics.
DiagnosticsState:诊断状态,如下值之一:
None
Requested
Complete
Error_CannotResolveHostName
Error_Internal
Error_Other
当执行写操作时,取值只能为Requested。其他状态只可读
重点看ping 成功后返回的Ping包个数,看参数SuccessCount=5(由于设置了Ping包个数NumberOfRepetitions为5个)

配置一下Ping 诊断模板参数
InternetGatewayDevice.IPPingDiagnostics.Interface 	string 	InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1 (只针对路由WAN连接)
InternetGatewayDevice.IPPingDiagnostics.Host 	    string 	192.168.1.254(ping目标地址)
InternetGatewayDevice.IPPingDiagnostics.Timeout 	unsignedInt 	1000
InternetGatewayDevice.IPPingDiagnostics.DiagnosticsState 	string 	Requested 
InternetGatewayDevice.IPPingDiagnostics.NumberOfRepetitions 	unsignedInt  5	

1.3. Traceroute诊断
查看诊断结果时路径:InternetGatewayDevice.TraceRouteDiagnostics.
DiagnosticsState:诊断状态,如下值之一:
None
Requested
Complete
Error_CannotResolveHostName
Error_MaxHopCountExceeded
当执行写操作时,取值只能为Requested。

配置一下Traceroute诊断模板参数

InternetGatewayDevice.TraceRouteDiagnostics.Interface 	string 	InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1 (只针对路由WAN连接)
InternetGatewayDevice.TraceRouteDiagnostics.Host 	    string 	192.168.1.254(ping目标地址)
InternetGatewayDevice.TraceRouteDiagnostics.DiagnosticsState 	string 	Requested 
InternetGatewayDevice.TraceRouteDiagnostics.Mode        string    UDP 或 ICMP(默认,默认值都可以不设置)
InternetGatewayDevice.TraceRouteDiagnostics.NumberOfTries unsignedInt  3 默认值
InternetGatewayDevice.TraceRouteDiagnostics.Timeout 	unsignedInt 	5000  默认值

查看Traceroute诊断记录列表
InternetGatewayDevice.TraceRouteDiagnostics.RouteHops.{i}.

1.4. HTTP下载仿真
查看诊断结果时路径:InternetGatewayDevice.DownloadDiagnostics.
DiagnosticsState:诊断状态,如下值之一:
None
Requested
Completed
Error_InitConnectionFailed
Error_NoResponse
Error_PasswordRequestFailed
Error_LoginFailed
Error_NoTransferMode
Error_NoPASV
Error_NoCWD
Error_NoSTOR
Error_NoTransferComplete
当执行写操作时,取值只能为 Requested。

配置一下HTTP下载仿真模板参数
InternetGatewayDevice.DownloadDiagnostics.Interface 	        string 	InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1 (只针对路由WAN连接)
InternetGatewayDevice.DownloadDiagnostics.DownloadURL  	    string 	192.168.1.254(用于下载的URL )
InternetGatewayDevice.DownloadDiagnostics.DiagnosticsState 	string 	Requested 
InternetGatewayDevice.DownloadDiagnostics.DSCP              unsignedInt    0(用来测试包的DSCP值)
InternetGatewayDevice.DownloadDiagnostics.EthernetPriority  unsignedInt  0 (用来测试包的优先级)

2. PPPOE WAN连接配置

1.上行路由连接PPPoE模式建立流程,若已经建立PPPoE_Bridge 桥连接,则创建PPPoE的WANID是2
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.==1 (若存在预配置,该WANConnectionDevice会自动生成1)
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.=={i}
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.{i}.X_CMCC_VLANMode = 2
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.{i}.X_CMCC_VLANIDMark= 100
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.{i}.ConnectionType=PPPoE_Routed  或PPPoE_Bridged
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.{i}.Username =(PPPoE账号)2222
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.{i}.Password=(PPPoE密码)2222
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.{i}.X_CMCC_LanInterface = (和LAN侧的绑定关系)设置为空或不下发
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.{i}.X_CMCC_ServiceList = (业务绑定)INTERNET or VOIP or TR069 or..
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.{i}.Enable=true
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.{i}.NATEnabled=true 默认FALSE

2.1 PPPoE 仿真

查看诊断结果时路径:InternetGatewayDevice.X_CMCC_PPPOE_EMULATOR.

配置PPPoE诊断 模版信息
InternetGatewayDevice.X_CMCC_PPPOE_EMULATOR.WANInterface   String  InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.{i}     (针对桥接和路由WAN均适用)
InternetGatewayDevice.X_CMCC_PPPOE_EMULATOR.PPPAuthenticationProtocol  string   PAP或CHAP
InternetGatewayDevice.X_CMCC_PPPOE_EMULATOR.RetryTimes    unsignedInt  3 (3次以内可设置)
InternetGatewayDevice.X_CMCC_PPPOE_EMULATOR.Username   string  2222
InternetGatewayDevice.X_CMCC_PPPOE_EMULATOR.Password   string   2222
InternetGatewayDevice.X_CMCC_PPPOE_EMULATOR.DiagnosticsState  string   Start

诊断状态,如下值之一:
“None” 空
“Start” 开始
“Stop” 停止
“Complete” 完成
“Running” 运行中
其中Start和Stop为可写,其它状态只读。

注意: 以上配置模版操作下发配置,需要在下一个inform上报时设置对应参数值;最后在WEB页面通过手动上报Inform方式更容易看到结果值

你可能感兴趣的:(移动API接口测试)