Kubernetes/问题记录/Flannel网络不通容器.md
offends 7a2f41e7d6
All checks were successful
continuous-integration/drone Build is passing
synchronization
2024-08-07 18:54:39 +08:00

35 lines
608 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

> 本文作者:丁辉
# Flannel网络不通容器
## 一:缺失路由导致无法通讯
1. 查看路由
```bash
route -n
```
2. 添加路由
```bash
route add -net 10.0.0.0 netmask 255.255.0.0 dev flannel0
```
> 添加路由后,需要重启 flannal 服务
**其他操作**
> 主机处于192.168.10.0/24而想访问192.168.20.0/24网的主机可以这样配置路由。
- 添加默认网关
```bash
route add -net 192.168.20.0 netmask 255.255.255.0 gw 192.168.10.1
```
- 删除默认网关
```bash
route del -net 192.168.20.0 netmask 255.255.255.0
```