Language / 语言: Respond in the same language the user uses.
If the user speaks Chinese, use the Chinese (zh-CN) prompts below.
If the user speaks English, use the English (en) prompts below.
Guides an agent through interactive network reachability analysis using Alibaba Cloud NIS.
Covers forward/reverse path analysis, topology visualization (Mermaid), and monitoring diagnostics
for resources along the path.
禁止:创建类 API(除 CreateAndAnalyzeNetworkPath 外)、修改、删除、启停、执行类 API
Installation
Pre-check: Aliyun CLI >= 3.3.1 required
Run aliyun version to verify >= 3.3.1. If not installed or version too low,
see references/cli-installation-guide.md for installation instructions.
Then [MUST] run aliyun configure set --auto-plugin-install true to enable automatic plugin installation.
bash
aliyun version
aliyun configure set --auto-plugin-install true
Authentication
Pre-check: Alibaba Cloud Credentials Required
Security Rules:
NEVER read, echo, or print AK/SK values (e.g., echo $ALIBABA_CLOUD_ACCESS_KEY_ID is FORBIDDEN)
NEVER ask the user to input AK/SK directly in the conversation or command line
NEVER use aliyun configure set with literal credential values
ONLY use aliyun configure list to check credential status
bash
aliyun configure list --user-agent AlibabaCloud-Agent-Skills
Check the output for a valid profile (AK, STS, or OAuth identity).
IMPORTANT: Parameter Confirmation — Before executing any command or API call,
ALL user-customizable parameters (e.g., RegionId, instance IDs, IP addresses,
protocol, ports, resource types, etc.) MUST be confirmed with the user.
Do NOT assume or use default values without explicit user approval.
Collect the following parameters interactively:
Parameter
Required
Description (EN)
说明 (ZH)
Default
RegionId
Yes
Region of the analysis task
分析任务所在地域
—
SourceType
Yes
ecs, vsw, internetIp, vpn, vbr
源端类型
—
SourceId
Yes
Source resource ID (or public IP if internetIp)
源资源 ID(公网 IP 类型直接填 IP)
—
SourceIpAddress
Conditional
On-Premise IP, required for vpn/vbr
云下私网 IP,vpn/vbr 时必填
—
TargetType
Yes
ecs, vsw, internetIp, vpn, vbr, clb
目的端类型
—
TargetId
Yes
Target resource ID (or public IP if internetIp)
目的资源 ID(公网 IP 类型直接填 IP)
—
TargetIpAddress
Conditional
On-Premise IP, required for vpn/vbr
云下私网 IP,vpn/vbr 时必填
—
Protocol
Yes
tcp, udp, or icmp
协议类型
—
TargetPort
Conditional
Required for tcp/udp
tcp/udp 时必填
—
SourcePort
Optional
Source port
源端口
—
Interactive Collection Logic / 交互收集逻辑
Use the prompts matching the user's language:
Step 1 — Ask resource types / 询问资源类型
EN
ZH
"What is the source resource type? (ecs / vsw / internetIp / vpn / vbr)"
Repeat until NetworkReachableAnalysisStatus is finish. Extract Reachable, NetworkReachableAnalysisResult.
Step 3: Reverse Path Analysis / 反向路径分析
Swap source and target / 交换源和目的:
Forward SourceId/Type → Reverse TargetId/Type
Forward TargetId/Type → Reverse SourceId/Type
Forward SourceIpAddress → Reverse TargetIpAddress
Forward TargetIpAddress → Reverse SourceIpAddress
Port handling / 端口处理:
Reverse --source-port = Forward TargetPort (server listening port / 服务端监听端口)
Reverse --target-port = Random ephemeral port in range 49152 ~ 65535 (client ephemeral port / 客户端随机端口)
Since the client initiates the connection with a dynamically assigned ephemeral port, the reverse path (server → client) should use a random port in the ephemeral range (49152-65535) as the target port to simulate real return traffic.
Omit --source-ip-address / --target-ip-address if SourceType/TargetType is not vpn or vbr.
若源/目的类型不是 vpn 或 vbr,可省略 --source-ip-address / --target-ip-address。
Step 4: Poll for Reverse Result / 轮询反向结果
Same as Step 2, using the reverse NetworkReachableAnalysisId.
Step 5: Result Interpretation / 结果解读
CRITICAL / 关键: Always use topologyData.positive from the actively initiated analysis task.
IGNOREtopologyData.reverse in any response — it is unreliable.
For resource IDs found in topologyData, if they match the prefixes below, query monitoring data for the last 1 hour:
对 topologyData 中途经的资源 ID,若匹配以下前缀,查询最近 1 小时监控数据: