# ICMP：从10.0.0.2:53到10.0.0.1:54321的端口不可达

- **ID:** `networking/udp-port-unreachable`
- **领域:** networking
- **类别:** protocol_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

UDP数据包被发送到目标主机（10.0.0.2:53）上的一个关闭端口，目标主机响应ICMP端口不可达消息，表明该端口上没有应用程序在监听。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Linux kernel 5.10-6.8 | active | — | — |
| Windows Server 2022/2025 | active | — | — |
| FreeBSD 13-14 | active | — | — |
| DNS servers (BIND 9.18-9.20, Unbound 1.17-1.22) | active | — | — |
| syslog-ng 4.0-4.8 | active | — | — |

## 解决方案

1. ```
   Verify the destination service is running and listening: `ss -ulpn | grep :53` on Linux; if not, start the service (e.g., `systemctl start named` for BIND).
   ```
2. ```
   Check the source application configuration to ensure it sends to the correct port: e.g., in `/etc/resolv.conf` for DNS, ensure `nameserver` points to 10.0.0.2 and port is 53.
   ```
3. ```
   If the service is intentionally not running, update the source to use a different destination or port, or install the required service.
   ```

## 无效尝试

- **Adding a firewall rule to drop ICMP Port Unreachable messages** — This hides the error but does not fix the underlying issue; the source application still fails to communicate and may timeout instead of getting a fast failure. (85% 失败率)
- **Restarting the destination service without verifying it's listening on the correct port** — The service may be misconfigured to listen on a different port or interface, so restarting does not resolve the mismatch. (70% 失败率)
- **Assuming the source is sending to the wrong IP address and changing routing** — The ICMP message confirms the IP is reachable; the issue is the port, not the address. (60% 失败率)
