Remote access VPN users are disconnected on every LB, ACL, port forward or firewall change (xl2tpd restarted on every iptables pass)
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- linux, python
- 领域
- networking
调研方向
从 systemvm/debian/opt/cloud/bin/configure.py 第 1277 行附近的 configure_l2tpIpsec() 开始,那里在重新添加 PSK 之前调用了 secret.empty(),然后阅读 systemvm/debian/opt/cloud/bin/cs/CsFile.py(第 42-56 行)中的 empty()、is_changed() 和 repopulate()。完成标准是:无关的规则变更不再重启 xl2tpd,而已更改的 PSK 仍会触发重启。在这种情况下,请检查 cloud.log 中的重启日志行已经消失。
由索引模型根据 Issue 内容生成。
描述
problem
Since 4.22.1.0, every remote access VPN (L2TP/IPsec) client on a router is disconnected whenever an unrelated rule
changes on that router: creating or deleting an LB rule, an ACL rule, a port forward, a firewall rule, a static NAT or
a site-to-site VPN. The client has to reconnect each time. Some clients (macOS) don't reconnect on their own.
cloud.log on the router shows xl2tpd being restarted on every one of those passes, although none of the L2TP files
changed except the secrets file, which was rewritten with the same content:
Nothing to commit. The /etc/ipsec.d/l2tp.conf file did not change
Wrote edited file /etc/ipsec.d/ipsec.any.secrets
Nothing to commit. The /etc/xl2tpd/xl2tpd.conf file did not change
Nothing to commit. The /etc/ppp/options.xl2tpd file did not change
Executing: ipsec update
Executing: systemctl restart xl2tpd
Executing: ipsec rereadsecrets
Root cause, line numbers from the 4.22 branch (56306ab52c), same code in 4.23.0.0 and main:
systemvm/debian/opt/cloud/bin/configure.py:1277, inconfigure_l2tpIpsec():secret.empty()before
secret.addeq(": PSK ...")andsecret.commit().systemvm/debian/opt/cloud/bin/cs/CsFile.py:51-53:empty()clears bothconfig(the copy read from disk) and
new_config.is_changed()(CsFile.py:42-46) compares the two, so afterempty()the file always reads as
changed andcommit()always returns True.configure.py:1247-1250: since #12422 (the fix for #12195), a changed config meanssystemctl restart xl2tpd
instead ofsystemctl start xl2tpd. Restarting xl2tpd kills every pppd session.CsRemoteAccessVpn.process()runs fromIpTablesExecutor.process()(configure.py:1615-1616), which runs for every
data bag withprocess_iptables: True(configure.py:1673-1690), not only for VPN changes.
Before #12422 the same pass ran systemctl start xl2tpd, a no-op on a running service, so the always-changed secrets
file did no harm.
Impact: on 4.22.1.0 and later, any router with a remote access VPN drops all its VPN users on any rule change in the
network or VPC. With CKS, the cloud controller manager's LB and ACL reconciles trigger it too.
versions
4.22.1.0, 4.22.1.1 and 4.23.0.0 (any version containing #12422). Seen on 4.23.0.0 with KVM, VPC with redundant
routers, advanced networking. Not specific to the hypervisor.
The steps to reproduce the bug
- Create a VPC, enable remote access VPN on its source NAT IP and add a VPN user.
- Connect an L2TP/IPsec client and keep a ping running to a VM in a tier.
- Create (or delete) an LB rule, or add an ACL rule, in that VPC.
- The client's session drops.
cloud.logon the router shows "Wrote edited file /etc/ipsec.d/ipsec.any.secrets"
followed bysystemctl restart xl2tpd.
What to do about it?
Use secret.repopulate() instead of secret.empty() in configure_l2tpIpsec(). repopulate() (CsFile.py:55-56)
clears only new_config and keeps the copy loaded from disk, so an unchanged PSK compares equal and xl2tpd is only
restarted when something really changed, which is what #12422 intended. A changed PSK still restarts it. PR to follow.
- 主要语言
- Java
- 星标
- 3.1k
- 派生
- 1.4k
- 平均合并
- 10 天 9 小时
- 30 天内合并 PR
- 20
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/cloudstack 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
apache/cloudstack#14530 · 1 条评论 ·
维护者通常 1 天内回复
-
bug status:has-work-around
难度 2/5 1-3 小时 新手友好度 78/100
apache/cloudstack#14465 · 1 条评论 ·
维护者通常 1 天内回复
-
4.23.0.0: restartVPC cleanup=true with public IPs on two VLANs fails with UnsupportedOperationException and leaves the VPC without a backup router可能已有人在做 @bernardodemarco 于 5 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
apache/cloudstack#14430 · 4 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 77/100
apache/cloudstack#14427 · 1 条评论 ·
维护者通常 1 天内回复
-
[UI] "canceled - Unable to reach the management server" notification when switching from project to default view on Instances page (4.20.3)可能已有人在做 @Damans227 于 20 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 65/100
apache/cloudstack#14381 · 1 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
查看 apache/cloudstack 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
A proxy that fails to start logs a RejectedExecutionException stack trace from its shutdown hook未关闭follow-up
难度 2/5 1-3 小时 新手友好度 62/100
Sanne/incus-spawn#1953 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 66/100
Shweit/EtherealPortals#30 ·
-
难度 1/5 1 小时以内 新手友好度 70/100
checkstyle/checkstyle#22398 · 1 条评论 ·
维护者通常 1 天内回复
-
Typo in jakartaee-bom 12.0.0-SNAPSHOT with cdi可能已有人在做 @ElectLive 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 80/100
jakartaee/jakartaee-api#205 · 1 条评论 ·