## IP 查询 ```shell # 查看 IP $ ip addr # 简洁查看 IP $ ip -brief addr # 路由 $ ip route # 公网 IP $ curl ipinfo.io $ curl ifconfig.me $ curl 6.ipw.cn ``` ## DNS 查询 ```shell # 基础查询 $ nslookup google.com # 指定 DNS 服务器 $ dig google.com @8.8.8.8 # 查看解析链路 $ dig +trace google.com ``` ## 连通测试 ```shell # 测试是否能连通 $ ping google.com # 路由路径 $ traceroute google.com $ tracepath google.com ``` ## 端口检测 ```shell # 查看端口是否开放 $ nc -zv 192.168.1.1 80 # 查看本机端口 $ ss -tulnp $ netstat -tulnp ``` ## 网速测试 ```shell $ curl -o /dev/null http://speedtest.tele2.net/100MB.zip $ wget -O /dev/null http://speedtest.tele2.net/100MB.zip ``` ## 代理设置 ```shell $ export https_proxy=http://127.0.0.1:18888 && export http_proxy=http://127.0.0.1:18888 ```