Docker的iptables规则在iptables重启后丢失
前因后果
1、在跳板机上使用ansible命令测试机器B时,报错如下,于是就怀疑是网络防火墙的问题
10.10.0.86 | FAILED >> {
"failed": true,
"msg": "/bin/sh: /usr/bin/python: No such file or directory\r\nOpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: mux_client_request_session: master session id: 2\r\nShared connection to 10.10.0.86 closed.\r\n",
"parsed": false
}
2、登录到机器B上,这是一台线上的机器,里面运行docker容器,然后我看平时的经验一般是网络防火墙有问题就直接
iptables -F
systemctl stop iptables
systemctl stop firewalld
3、然后我想着这应该不会影响容器吧,就看容器的日志,没想到10几个全部报错,都是连接不上,有点慌...,重启容器,完全是起不来的,报错如下
docker: Error response from daemon: driver failed programming external connectivity on endpoint happy_ptolemy (9cedc114be35eb86cd6f7f7bb4f11f93b5f8d2c0745afc72664cef8e96aad439): iptables failed: iptables --wait -t filter -A DOCKER ! -i docker0 -o docker0 -p tcp -d 10.10.0.86 --dport -j ACCEPT: iptables: No chain/target/match by that name. (exit status ).
4、解决办法,重启docker
systemctl restart docker
知识点


总结
Docker的iptables规则在iptables重启后丢失的更多相关文章
- [转]ubuntu linux下DNS重启后丢失
从网上得知 /etc/resolv.conf中的DNS配置是从/etc/resolvconf/resolv.conf.d/head中加载而来,所以每回改resolv.conf都会失效,在此文件里面已经 ...
- [转]ubuntu linux下DNS重启后丢失(不是Network-manager造成的情况)
从网上得知 /etc/resolv.conf中的DNS配置是从/etc/resolvconf/resolv.conf.d/head中加载而来,所以每回改resolv.conf都会失效,在此文件里面已经 ...
- Debian9.5 系统配置持久化iptables规则
RedHat和SUSE系列下有比较好用的iptables管理工具,可以像控制服务进程一样来对防火墙进行管理及控制,Debian系发行版默认不开启iptables,当然也没有与之相关的能直接管理的工具了 ...
- ifconfig 命令,改变主机名,改DNS hosts、关闭selinux firewalld netfilter 、防火墙iptables规则
ifconfig 命令用于查看网络相关的命令: 安装:yum install net-tools -y ifdown eth_name 关闭网卡 ifup eth_name 开启网卡 配 ...
- iptables规则备份和恢复 firewalld的9个zone firewalld关于zone的操作 firewalld关于service的操作
iptables规则备份和恢复 保存和备份iptables规则Service iptables save //会把规则保存到/etc/sysconfig/iptables把iptables规则备份到m ...
- 服务器iptables规则记录
很多时候,我在我自己的VPS上面部署了Cobalt Strike,可是网上很多叼毛就会扫描我们的VPS,然后发现我们的Cobalt Strike,如果你还建有web delivery,还会被人家下载上 ...
- Linux centosVMware iptables规则备份和恢复、firewalld的9个zone、firewalld关于zone的操作、firewalld关于service的操作
一.iptables规则备份和恢复 保存和备份iptables规则 service iptables save //会把规则保存到 /etc/sysconfig/iptables 把iptables规 ...
- 要想重启后也生效LINUX防火墙配置
新配置的一台服务器,安装的是CentOS6.3系统,在安装完LNMP之后,发现nginx进程存在,且php解析正常,但是用分配的独立IP去访问的时候发现无法访问. 查了下网上的资料,发现可能是Linu ...
- 使用systemd将iptables规则在docker启动后自动导入
编写systemd文件 $ sudo vi /etc/systemd/system/iptables-import.service # /etc/systemd/system/iptables-imp ...
随机推荐
- ST函数(ST表)RMQ O(1)查询 离线
ST算法是基于倍增的动态规划算法. #include<iostream> #include<cstdio> #include<cstdlib> #include&l ...
- RF(读写 excel)
1.安装 ExcelLibrary 库:pip install robotframework-ExcelLibrary 但是 Python3.0 通过上面的命令安装 ExcelLibrary 时,会发 ...
- 学习HTML
前端三剑客:HTML.CSS.JavaScript.现在就开始学习HTML啦. 学习资源:http://www.freecodecamp.cn/ 学习笔记: h1,head1,一级标题 <h1& ...
- Objective-C对象模型
Objective-C是一门面向对象的编程语言,每一个对象都是一个类的实例.XCode中打开objc.h可以看到如下定义: /// An opaque type that represents an ...
- JSP+Spring+SpringMVC+Hibernate+Mysql实现的校园失物招领网站
项目简介 项目来源于:https://github.com/wenlongup/LostAndFound 因原github仓库无数据库文件,经过本人修改,现将该仓库重新上传至个人gitee仓库. ht ...
- Golang 实现 Redis(5): 使用跳表实现 SortedSet
本文是使用 golang 实现 redis 系列的第五篇, 将介绍如何使用跳表实现有序集合(SortedSet)的相关功能. 跳表(skiplist) 是 Redis 中 SortedSet 数据结构 ...
- Spring 循环引用(三)源码深入分析版
@ 目录 前言 正文 分析 doGetBean 为什么Prototype不可以 createBean doCreateBean getEarlyBeanReference getSingleton b ...
- Day_13【IO流】扩展案例2_统计键盘录入字符在指定项目文件中出现的次数
分析以下需求,并用代码实现 键盘录入一个字符(以字符串的形式录入) 判断当前字符在info3.txt当中是否存在 如果不存在, 给出提示 如果存在, 请统计出该字符出现的次数 Info3.txt内容如 ...
- linux centos7搭建mysql-5.7.29
1. 下载mysql 1.1 下载地址 https://downloads.mysql.com/archives/community/ 1.2 版本选择 2. 管理组及目录权限 2.1 解压my ...
- 变分深度嵌入(Variational Deep Embedding, VaDE)
变分深度嵌入(Variational Deep Embedding, VaDE) 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 这篇博文主要是对论文“ ...