AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1446820
Accepted
Max Ehrlich
Max Ehrlich
Asked: 2019-06-10 18:52:01 +0800 CST2019-06-10 18:52:01 +0800 CST 2019-06-10 18:52:01 +0800 CST

我没有 IPTables

  • 772

我发生了一些非常奇怪的事情,经过大量谷歌搜索后我似乎找不到任何参考。我好像没有iptables。并不是说链被刷新或者它们都是 ACCEPT 规则之类的,表本身似乎不存在。这就是我的意思:

故事是,我的码头工人在过去几个月的某个时候停止工作,我终于抽出时间来修复它。该错误是由以下命令引起的:

$ iptables -A DOCKER-ISOLATION-STAGE-1 -j RETURN
iptables: No chain/target/match by that name.

哪个 docker 作为其启动的一部分运行,我试图手动运行以进行调试。

因此,我开始四处乱逛,尝试在不同的地方添加不同的链和规则,但一切都出现了这个错误。所以最后我试着列出所有的东西

$sudo iptables -S 
iptables: No chain/target/match by that name.
$ sudo iptables -L
iptables: No chain/target/match by that name.
$ sudo iptables --list
iptables: No chain/target/match by that name.

没有什么。所以我试着查看每个表

# iptables -vL -t filter
iptables: No chain/target/match by that name.
# iptables -vL -t nat
iptables: No chain/target/match by that name.
# iptables -vL -t mangle
iptables: No chain/target/match by that name.
# iptables -vL -t raw
iptables: No chain/target/match by that name.
# iptables -vL -t security
iptables: No chain/target/match by that name.

更没什么,就像实际的桌子本身已经消失了一样。甚至像这样简单的事情

# iptables -P INPUT ACCEPT
iptables: Bad built-in chain name.

不起作用。

有没有人见过这个?有什么办法可以把桌子拿回来吗?

我的系统是带有内核 5.1.8 的 Ubuntu 18.10

更新

我已经将所有 iptables 模块添加到我的/etc/modules并重建了 initramfs。这些模块现在已在启动时加载,但并没有解决问题。

我发现该iptables-save命令没有错误,但它也只打印以下内容:

# Generated by iptables-save v1.6.1 on Tue Jun 11 17:35:52 2019
*nat
COMMIT
# Completed on Tue Jun 11 17:35:52 2019
# Generated by iptables-save v1.6.1 on Tue Jun 11 17:35:52 2019
*mangle
COMMIT
# Completed on Tue Jun 11 17:35:52 2019
# Generated by iptables-save v1.6.1 on Tue Jun 11 17:35:52 2019
*raw
COMMIT
# Completed on Tue Jun 11 17:35:52 2019
# Generated by iptables-save v1.6.1 on Tue Jun 11 17:35:52 2019
*security
COMMIT
# Completed on Tue Jun 11 17:35:52 2019
# Generated by iptables-save v1.6.1 on Tue Jun 11 17:35:52 2019
*filter
COMMIT
# Completed on Tue Jun 11 17:35:52 2019

我还发现 ip6tables 似乎工作正常,它唯一的 iptables 坏了。

接下来我尝试在详细模式下运行一些 iptables 命令。

# iptables -S -vv 
libiptc vlibxtables.so.12. 0 bytes.
Table `filter'
Hooks: pre/in/fwd/out/post = 7f68/9f6085dd/5616/9f60a8e0/5616
Underflows: pre/in/fwd/out/post = 36e4540/7fff/36e48e8/7fff/0
iptables: No chain/target/match by that name.
# iptables -N  DOCKER-ISOLATION-STAGE-1 -vv

在详细模式下,此命令不会完成,输出量很大。我尝试将它转储到一个文件中,但当该文件的大小达到 8.5GB 时我将其杀死。输出是以下模式的所有重复:

libiptc vlibxtables.so.12. 1032595540 bytes.
Table `filter'
Hooks: pre/in/fwd/out/post = 7ffe/92c0b5dd/55a7/92c0d8e0/55a7
Underflows: pre/in/fwd/out/post = 3d8c10f0/7ffe/3d8c1498/7ffe/3d8c2854
Entry 0 (0):
SRC IP: 0.0.0.0/0.0.0.0
DST IP: 0.0.0.0/0.0.0.0
Interface: `'/................to `'/................
Protocol: 0
Flags: 00
Invflags: 00
Counters: 0 packets, 0 bytes
Cache: 00000000
Target name: `' [0]
verdict=0

Entry 0 (0):
SRC IP: 0.0.0.0/0.0.0.0
DST IP: 0.0.0.0/0.0.0.0
Interface: `'/................to `'/................
Protocol: 0
Flags: 00
Invflags: 00
Counters: 0 packets, 0 bytes
Cache: 00000000
Target name: `' [0]
verdict=0

希望这对某人有意义,对我来说毫无意义。

linux networking
  • 3 3 个回答
  • 536 Views

3 个回答

  • Voted
  1. user1039968
    2019-06-12T14:53:51+08:002019-06-12T14:53:51+08:00

    在互联网上搜索我发现可以使用以下命令在 Linux 上恢复 iptables

    iptables-restore < /root/working.iptables.rules

    但是有一些技术指南建议如果使用 kubernetes 代理 iptables 规则在重新启动 iptables+node 后丢失。

    以下文件提供了有关它的有用信息:

    https://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/

    https://github.com/openshift/origin/issues/1922

    https://www.linuxquestions.org/questions/linux-security-4/iptables-no-chain-tarjet-match-by-that-name-941406/

    我希望能有所帮助!

    • 2
  2. johnbchron
    2019-06-13T14:01:03+08:002019-06-13T14:01:03+08:00

    您是否尝试过手动重新安装 iptables?

    ./configure --prefix=/usr      \
                --sbindir=/sbin    \
                --disable-nftables \
                --enable-libipq    \
                --with-xtlibdir=/lib/xtables &&
    make
    make install &&
    ln -sfv ../../sbin/xtables-legacy-multi /usr/bin/iptables-xml &&
    
    for file in ip4tc ip6tc ipq iptc xtables
    do
      mv -v /usr/lib/lib${file}.so.* /lib &&
      ln -sfv ../../lib/$(readlink /usr/lib/lib${file}.so) /usr/lib/lib${file}.so
    done
    make install-iptables
    

    取自这里。

    • 1
  3. Best Answer
    Max Ehrlich
    2019-06-16T11:43:07+08:002019-06-16T11:43:07+08:00

    这原来是一个内核配置问题。通常当我应用我的补丁构建一个新内核时,我从以前的版本复制我使用的配置(事后看来可能是个坏主意)。一旦我将我的配置与最新的 Ubuntu 内核配置合并并重建内核,我的 iptables 输出看起来又正常了。

    • 1

相关问题

  • Win10 1803:如何让移动热点成为专用网络?

  • nc如何识别服务名称

  • 以 root 身份运行 docker 容器

  • 如何在域和 Linux 活动目录中启用指纹传感器

  • 如何在CentOS 7 中将Ctrl+C 永久更改为Ctrl+K?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    Windows 10 服务称为 AarSvc_70f961。它是什么,我该如何禁用它?

    • 2 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Marko Smith

    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1056)

    • 4 个回答
  • Marko Smith

    我如何知道 Windows 安装在哪个驱动器上?

    • 6 个回答
  • Martin Hope
    Albin 支持结束后如何激活 WindowsXP? 2019-11-18 03:50:17 +0800 CST
  • Martin Hope
    fixer1234 “HTTPS Everywhere”仍然相关吗? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    Kagaratsch Windows 10 删除大量小文件的速度非常慢。有什么办法可以加快速度吗? 2019-09-23 06:05:43 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    Inter Sys Ctrl+C 和 Ctrl+V 是如何工作的? 2019-05-15 02:51:21 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve