You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
obsidian-sync/问题排查/踩坑记录/docker 映射后无法远程访问服务.md

13 lines
835 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

排查过程:
1.检查防火墙和端口出入规则
firewalld和iptables
2.检查IP转发是否开启
出于安全考虑Linux系统默认是禁止数据包转发的。所谓转发即当主机拥有多于一块的网卡时其中一块收到数据包根据数据包的目的ip地址将数据包发往本机另一块网卡该网卡根据路由表继续发送数据包。这通常是路由器所要实现的功能。
要让Linux系统具有路由转发功能需要配置一个Linux的内核参数`net.ipv4.ip_forward`。这个参数指定了Linux系统当前对路由转发功能的支持情况其值为0时表示禁止进行IP转发如果是1,则说明IP转发功能已经打开。
执行以下命令如果为0说明没有开启
```shell
sysctl net.ipv4.ip_forward
```
![[05b2e78f8b1f761f882f92c937f22ed.png]]