360 Secure SkillHub
360 安全技能中心

Myip

通过 curl 调用公共 IP 查询服务获取公网(外部)IP,Windows 下用 ipconfig、Linux 下用 hostname -I 获取本地(内网)IPv4 地址;无需 API key,所查询的服务免费且匿名,适用于防火墙、VPN 白名单配置和局域网连通性排查。

chenxinjie005
chenxinjie005
热度 51.68
最近更新 2026-05-11 17:31:25
分类:自动化依赖:代码执行 / 第三方 API应用场景:工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add cxj-ip-2026
Metadata
name
my-ip-checker
description
Get both public (external) and local (internal) IP addresses using simple shell commands. Use when the user asks for their IP, public IP, or local network address.
metadata
{"clawdbot":{"emoji":"🌐","requires":{"bins":["curl.exe"]}}}

My IP Checker

This skill discovers both the public (external) IP and the local (internal) IP of the current machine.

Step 1: Get public IP

Use a simple HTTPS endpoint that returns your public IP as plain text:

curl.exe -s https://ifconfig.me

If the service is blocked or slow, try:

curl.exe -s https://api.ipify.org

Step 2: Get local IPv4 address

On Windows (PowerShell or cmd):

ipconfig

Then filter the output for lines containing IPv4 地址 or IPv4 Address.

On Linux:

hostname -I

This typically returns one or more local IPs separated by spaces.

Usage notes

  • Use Step 1 when configuring firewalls, VPNs, or any external allowlist.
  • Use Step 2 when debugging LAN connectivity, port forwarding, or internal routing.
  • Prefer HTTPS endpoints and avoid adding API keys; these services are free and anonymous.