【问题标题】:Ubuntu host with CentOS 6 as docker container, how do I access iptables?使用 CentOS 6 作为 docker 容器的 Ubuntu 主机,如何访问 iptables?
【发布时间】:2015-02-03 17:59:00
【问题描述】:

在以 Ubuntu 为主机的 CentOS 6 容器内,服务 iptables 失败,错误代码如下

我已经在某处阅读过作为 cgroup ro 容器的停靠。如果我想做“服务 iptables 重启”,这是访问 iptables 的正确方法吗?

如果是这样,这是否也适用于 CentOS 7 主机?

参考资料: http://rhatdan.wordpress.com/2014/04/30/running-systemd-within-a-docker-container/ http://maci0.wordpress.com/2014/07/23/run-systemd-in-an-unprivileged-docker-container/

【问题讨论】:

标签: linux ubuntu docker centos6 centos7


【解决方案1】:

“以 Ubuntu 为主机的 Centos 6 容器”没有 iptables 服务,因为 Ubuntu 没有 iptables 服务并且 Docker 没有虚拟化系统的这方面。所以你将无法做到service iptables restart

【讨论】:

    【解决方案2】:

    唯一的办法就是在ubuntu上安装iptable-persistent,然后通过容器访问centos主机重启iptables。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-17
      • 1970-01-01
      • 1970-01-01
      • 2016-09-11
      • 1970-01-01
      • 2021-11-04
      • 1970-01-01
      相关资源
      最近更新 更多