【问题标题】:Redirect traffic from docker container into localhost将来自 docker 容器的流量重定向到 localhost
【发布时间】:2016-05-03 11:56:34
【问题描述】:

我有一个 Docker 主机,其隧道在 127.0.0.1 上侦听。有一个发送流量的容器。我需要让这些流量进入​​隧道。

Docker 主机运行的是 CentOS 7.2,我已让 Docker 容器内的服务将所有内容发送到 172.17.42.1,这是 docker0 接口的 IP。

在 firewalld 中,我创建了一个 docker 区域,如下所示:

docker (active)
  interfaces: docker0
  sources: 
  services: 
  ports: 
  masquerade: yes
  forward-ports: port=514:proto=udp:toport=514:toaddr=127.0.0.1
  icmp-blocks: 
  rich rules: 

使用 tcpdump 检查,在端口 514 上的 docker0 上有流量,但在端口 514 上的 lo 上没有流量。

我做错了什么?

【问题讨论】:

    标签: networking docker firewalld


    【解决方案1】:

    检查您的 Docker 版本是否与 firewalld 兼容。 最近才修复:https://github.com/docker/docker/issues/16137

    RedHat 仍然建议使用包含在其存储库中的 Docker 版本(当前为 1.10.3)禁用 firewalld:https://access.redhat.com/documentation/en/red-hat-enterprise-linux-atomic-host/version-7/getting-started-with-containers/#setting_up_to_deploy_docker_containers_with_kubernetes

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-12-10
      • 2017-05-07
      • 1970-01-01
      • 1970-01-01
      • 2015-10-04
      • 1970-01-01
      • 2022-01-20
      相关资源
      最近更新 更多