docker0: iptables: No chain/target/match by that name错误处理

今天运行这个命令时报错

docker run -it --name Haproxy --link app1:app1 --link app2:app2 -p 6302:6301 -v ~/Projects/HAProxy:/tmp haproxy /bin/bash

报错信息:

docker: Error response from daemon: failed to create endpoint Haproxy on network bridge: iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 6302 -j DNAT --to-destination 192.168.0.8:6301 ! -i docker0: iptables: No chain/target/match by that name.

看着信息提示,可以大概知道iptables配置的问题,且跟docker有关。

查看iptables配置文件

cat /etc/sysconfig/iptables (主要是filter和nat的配置)

*filter

:INPUT DROP [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [17:2536]

:syn-flood - [0:0]

-A INPUT -i lo -j ACCEPT

*nat

:PREROUTING ACCEPT [0:0]

:INPUT ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

:POSTROUTING ACCEPT [0:0]

:OUTPUT_direct - [0:0]

:POSTROUTING_ZONES - [0:0]

:POSTROUTING_ZONES_SOURCE - [0:0]

这里看到filter和nat并没有docker的配置信息,所以添加上对应的信息如下:

*filter

:INPUT DROP [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [17:2536]

:syn-flood - [0:0]

:DOCKER - [0:0]

*nat

:PREROUTING ACCEPT [0:0]

:INPUT ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

:DOCKER - [0:0]

重启iptables

sudo systemctl restart iptables.service

重新启动容器即可

时间: 2024-08-24 04:33:33

docker0: iptables: No chain/target/match by that name错误处理的相关文章

docker运行报错docker0: iptables: No chain/target/match by that name.

转自:https://blog.csdn.net/wohaqiyi/article/details/84450562 docker运行报错docker0: iptables: No chain/target/match by that name.  最近在一个新的服务器上装服务,没有安装iptables ,后来安装了iptables 之后,忽然发现我的docker 不能运行了.  注意,可能别人的不行,我这个原因是,开始在新服务器上没有安装iptables ,先安装的docker ,后来才停用默

docker启动容器报"iptables No chain/target/match"

Centos 7 docker 启动grafana容器报"iptables No chain/target/match by that name" docker run -d -p 3000:3000  grafana/grafana:5.1.0   Error response from daemon: Cannot start container 565c06efde6cd4411e2596ef3d726817c58dd777bc5fd13762e0c34d86076b9e: ip

arm,iptables: No chain/target/match by that name.

最近由于项目需要,需要打开防火墙功能. 公司有 arm linux 3.0x86 linux 3.2x86 linux 2.4 的三个嵌入式.都需要打开防火墙功能. 执行“whereis iptables”命令,如果结果不为空,则说明防火墙软件已安装 # whereis iptables iptables: /sbin/iptables /usr/share/iptables /usr/share/man/man8/iptables.8.gz [email protected]:~ 9:26:5

iptables的CLUSTER target与以太网交换机的思想

周末的空气闷热,一想到以后再也不会像样地下雨就心里一阵悲哀.每个周末我都会抽出一个晚上总结一周的所有事情,不管是工作的,生活的,还是上下班路上的所见所闻抑或者路上的读后感,由于不再下雨,我决定周六晚上好好睡一觉,那就周五晚上折腾.       在给同事解释交换机和HUB的原理的时候,想到了某些时候,HUB才是更加高效的选择,你看,iptables的朴实的CLUSTER target和F5的高大上负载均衡设备之间区别不就是一台HUB和一台学习型以太网交换机之间的区别吗?我们先来看看CLUSTER

"flash download failed - Target dll has been cancelled"错误解决办法

在用mdk通过stlink烧写官方例程到stm32f429I discovery时,烧写了十来个程序都没问题,突然在烧写一个程序时, 弹出了"flash download failed - Target dll has been cancelled",然后后续的烧写都失败了. 原因可能是其中一个程序将stm32开发板设置成了休眠模式,导致后续的烧写都失败了. 从keil论坛帖子中 看到可以通过st-link utility来将flash全部擦除就能烧写了. 从http://www.st

Target host is not specified错误

对于httpClient4.3访问指定页面,可以从下面的demo抽取方法使用. 注意:对于URL必须使用 http://开始,否则会有如下报错信息: 或者在设置cookie时带上domain: cookie.setDomain(domain); 或者:cookie.setDomain("0.0.0.0"); Caused by: org.apache.http.ProtocolException: Target host is not specified    at org.apach

运行容器出现docker: Error response from daemon: driver failed programming external connectivity on endpoint elegant_ptolemy (7fe85ca6bd744449ff82b81c1577d73b6821c4e51780c8238fad6aa0cb940522): (iptables fai

运行容器时出现以下报错: docker: Error response from daemon: driver failed programming external connectivity on endpoint elegant_ptolemy (7fe85ca6bd744449ff82b81c1577d73b6821c4e51780c8238fad6aa0cb940522):  (iptables failed: iptables --wait -t nat -A DOCKER -p tc

docker端口映射或启动容器时报错Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen

现象: [[email protected] ~]# docker run -d -p 9000:80 centos:httpd /bin/sh -c /usr/local/bin/start.shd5b2bd5a7bc4895a973fe61efd051847047d26385f65c278aaa09e4fa31c4d76docker: Error response from daemon: driver failed programming external connectivity on

docker在centos7下的一些坑

1.Centos7安全Selinux禁止了一些安全权限,导致mysql和mariadb在进行挂载/var/lib/mysql的时候会提示如下信息: 1 [[email protected] mariadb]# docker run -d -v ~/mariadb/data/:/var/lib/mysql -v ~/mariadb/config/:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD='123456' test01/mariadb 2 19c4aa113