大网数据广告活动
服务器运维问答

Something deletes my ip rules

· 52CE 我爱测

So I have this server on Ubuntu 22.04 with a few ip rules, and they get overwritten every few minutes. All my rules get deleted pure and simple. example of such rules: ip rule add pref 10 from all fwmark 0x117 lookup 17 An "ip ru…

问题原文

原帖链接 · seb · CC BY-SA 4.0

So I have this server on Ubuntu 22.04 with a few ip rules, and they get overwritten every few minutes. All my rules get deleted pure and simple.

example of such rules: ip rule add pref 10 from all fwmark 0x117 lookup 17

An "ip rule list" show them to me alright, then a few minutes later the same command gives me an almost empty list.

Does anybody know what is causing this? I can't believe I'm the only one who gets this but I can't find anything on google on this matter.

Thanks

已采纳解答

原帖链接 · Greg · CC BY-SA 4.0

It's systemd-networkd that's helping you :-)

I had the same issue after upgrading to 22.04, it seems systemd will remove all ip rules it didn't create on state change. The quick solution is to add "protocol kernel" to your rule as: ip rule add pref 10 from all fwmark 0x117 lookup 17 protocol kernel

more details here systemd-networkd removes fwmark rules

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2023-01-30)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。