The ipvsadm table can be configured and the configuration information can be cleared and restored when the service is restarted, but the table information is not restored when the OS is restarted.
Is there any way to maintain the configuration after the OS reboot?
#cat/etc/redhat-release
Rocky Linux release 8.7 (Green Obsidian)
# yum list installed | grep ipvsadm
ipvsadm.x86_641.31-1.el8@appstream
# yum list installed | grep kept
kept.x86_642.1.5-9.el8@appstream
#systemctl status ipvsadm
● ipvsadm.service - Initialize the Linux Virtual Server
Loaded: loaded (/usr/lib/systemd/system/ipvsadm.service; enabled; vendor preset: disabled)
Active:active (exited) since Tue 2022-12-13 11:18:36 JST; 2h 38minago
#less/usr/lib/systemd/system/ipvsadm.service
Unit
Description= Initialize the Linux Virtual Server
After=syslog.targetnetwork.target
Service
Type = one shot
ExecStart=/bin/bash-c "exec/sbin/ipvsadm-restore</etc/sysconfig/ipvsadm"
ExecStop=/bin/bash-c "exec/sbin/ipvsadm-save-n>/etc/sysconfig/ipvsadm"
ExecStop=/sbin/ipvsadm-C
RemainAfterExit=yes
Install
WantedBy=multi-user.target
#ipvsadm-L
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
->RemoteAddress: Port Forward Weight ActiveConn InActConn
TCP 192.168.100.100:http sh
->192.168.100.101: http Route 100
->192.168.100.102: http Route 100
->192.168.100.103: http Route 100
->192.168.100.104—http Route 100
TCP 192.168.100.100:httpssh
->192.168.100.101:https Route 100
->192.168.100.102—https Route 100
->192.168.100.103—https Route 100
->192.168.100.104—https Route 100
#systemctl stop ipvsadm
# ipvsadm-L
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
->RemoteAddress: Port Forward Weight ActiveConn InActConn
#systemctl start ipvsadm
# ipvsadm-L
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
->RemoteAddress: Port Forward Weight ActiveConn InActConn
TCP 192.168.100.100:http sh
->192.168.100.101: http Route 100
->192.168.100.102: http Route 100
->192.168.100.103: http Route 100
->192.168.100.104—http Route 100
TCP 192.168.100.100:httpssh
->192.168.100.101:https Route 100
->192.168.100.102—https Route 100
->192.168.100.103—https Route 100
->192.168.100.104—https Route 100
#ipvsadm-L
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
->RemoteAddress: Port Forward Weight ActiveConn InActConn
There seems to be a way to change the service startup order, but the cause cannot be determined.
I would appreciate it if you could let me know.
It seems that the kept stopped after ipvsadm started, so the process of removing all entries from the IPVS virtual server table was carried out.
The problem with this question is that kept has stopped, so I will close the question.
© 2024 OneMinuteCode. All rights reserved.