-
-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VRRP stays in FAULT state after adding a same IP address as VIP on physical interface #2219
Comments
In keepalived_netlink.c: ignore_address_if_ours_or_link_local checks if vrrp owns the new IP address added on the interface, that is the reason why VRRP won't change the state. |
I suppose that leaves the question, If the VRRP instance had been in master state and subsequently transitioned to backup because a higher priority instance appeared, then since 192.168.1.1 is a VIP and the priority is not 255, the address would be deleted when the VRRP instance transitioned to backup, and it would never be able to become master again. This clearly is an unstable situation, and therefore cannot be allowed. Another way of looking at it is that if 192.168.1.1 is configured on the interface, then that system would be the address owner (see RFC5798), and so the priority would have to be 255, whereas you have configured the priority to be 100. Actually the scenario of a VIP missing when the priority is 255 is a big problem. Priority 255 means that that system is the address owner, and that that VRRP instance will be in master state. keepalived can add the VIP when the instance becomes master (which gets around the configuration problem of the keepalived configuration saying the system is the address owner, but the system doesn't have the address). But what if keepalived is stopped on that system. It is still the address owner and so the VIPs will still be configured on the system. However, a backup VRRP instance will now become master and add the VIPs, and then the addresses will be configured on both systems. This is why I never use priority 255, it just isn't safe. It can work on a router, which is what VRRP is designed for, where if VRRP is configured it will always run, and to disable VRRP on the router which is the address owner would be a configuration error. So, having a VIP configured on a system when a VRRP instance is not in master state is a configuration error, and not one that keepalived can handle (other than deleting the address if it sees it being added, which is likely to confuse/annoy the person who added the address). |
OK, thanks for the answer. |
Hello, With this scenario: I wonder if it is possible to make keepalived work as a simple router by deleting the line |
I can't see any way for a VRRP instance with priority 255 to properly handle missing VIPs. Consider a VRRP instance with priority 255 with two VIPs configured, and one of the VIPs is installed on the system but the other is not. Should the VRRP instance be in FAULT state, since one VIP is missing, or should it be in MASTER state advertising that it has the 2 VIPs whereas in fact it doesn't have one? In the former case, then a backup VRRP instance will become master, and the VIP that is installed on the priority 255 system will be duplicated; in the other case the VIP that is not installed will be missing. My view is that if a VRRP instance is configured with priority 255 (i.e. telling keepalived that the VIPs are already configured on the system) but one of the VIPs is not configured on the system, then that is a configuration error. The safest thing for keepalived to do in that situation is to do nothing - it cannot determine what the correct thing to do is when there is a configuration error; hence the VRRP instance goes to fault state. |
Hello, I have tested the case that you described in the previous comment. With two machines A and B.
With this setup, as A is the address owner but the VIP is not present on the system thus, A transit to FAULT state, B becomes master. If I add VIP to the interface used by keepalived on A, it is still in FAULT state. This is the current behavior of keepalived. "since one VIP is missing, or should it be in MASTER state advertising that it has the 2 VIPs whereas in fact it doesn't have one" (I deleted all IP configured on A before processing) I did the same test with multiple VIPs (192.168.1.1/24, 192.168.1.2/24) configured on A, then add the same IP (192.168.1.10/24) to A, keepalived still can transit to MASTER state. This is not working as you described. |
Between, I have made a bit of modification as described in comment 8.
To
This will allow VRRP instance (address owner, priority 255) transit to MASTER state, if VIP is missing at startup. |
Hello, I have opened a pull request: #2229 |
Describe the bug
Hello,
I am in a Qemu virtual machine and compiled the newest keepalived version.
I started keepalived with a VIP 192.168.1.1/24 and the physical interface has no IP addresses yet.
It is normal for VRRP entering FAULT state as no IPv4 address is configured on the interface.
Then, I add 192.168.1.1/24 (same as the VIP) on the physical interface, VRRP is still in FAULT state.
However, either if I add another IP address different than the VIP or before starting keepalived, configure the interface with a IP address (whatever the address) , VRRP works successfully.
To Reproduce
Expected behavior
The transition from FAULT state to BACKUP then from BACKUP state to MASTER state.
Keepalived version
Distro (please complete the following information):
Details of any containerisation or hosted service (e.g. AWS)
Qemu virtual machine
Configuration file:
System Log entries
Additional context
It seems that keepalived won't catch the IP assignment when the IP is the same as VIP. I wonder if it is intentional.
The text was updated successfully, but these errors were encountered: