mirror of
https://github.com/hwdsl2/docker-ipsec-vpn-server.git
synced 2026-04-26 10:05:48 +03:00
[GH-ISSUE #403] centos8以上iptables的问题 #376
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wanghongzhou on GitHub (Oct 9, 2023).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/403
问题描述
我在k8s集群中使用helm安装hwdsl2/ipsec-vpn-server,启动时报错:
我检查了一下宿主机lsmod | grep table,发现确实没有加载iptable_filter,iptable_nat,ip_tables三个内核模块,
因为宿主机是centos9,iptables默认使用的是iptables-nft而不是iptables-legacy。
查看https://gitlab.alpinelinux.org/alpine/aports/-/issues/14058 这个地址后发现3.19版本才切换倒nft,但是上面说debain默认使用nft,于是我把镜像换成了hwdsl2/ipsec-vpn-server:debain然后重启安装。 安装后进入容器发现还是使用的legacy, 这时翻看Dockerfile.debian才发现设置为legacy了,此时宿主机iptable_filter,iptable_nat,ip_tables三个内核模块被加载进来了, k8s的网络也出现了故障,因为calico组件依赖iptables-nft,请问下为何一定要在Dockerfile.debian中设置为legacy?
@hwdsl2 commented on GitHub (Oct 9, 2023):
@wanghongzhou 你好!设置为 legacy 是因为需要与各种常用的宿主机系统兼容,比如 Debian 12 上的 Docker 环境,如果在容器内使用 nft 的话,添加的 IPTables 规则会不工作。对于你的用例,你可以 从源代码构建 修改后的镜像并在 Dockerfile.debian 进行相应的改动。