Skip to content
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

Issue with interface ip and vip subnet #2432

Open
subhajit-cdot opened this issue Jun 13, 2024 · 4 comments
Open

Issue with interface ip and vip subnet #2432

subhajit-cdot opened this issue Jun 13, 2024 · 4 comments

Comments

@subhajit-cdot
Copy link

Hi,
I am getting an issue with keepalived version 1.2.24. I have configured interface with an /24 ip address. Then I have configured vip of that interface with another /24 ip address, configuration was fine in keepalived.conf. But in the kernel vip is getting configured with /32 ip address for the vip. I am getting same behavior if interface gets ip address from dhcp ( that means if I configure dhcp in the interface not static ip).

The issue does not arise if I configure vip first and then assign ip address to the interface. Is there any dependency with the sequence of programming ip address to interface?

Thanks
Subhajit

@pqarmitage
Copy link
Collaborator

Please provide a full copy of your keepalived configuration file so that we can test it.

@subhajit-cdot
Copy link
Author

Hi,
I might be wrong with the statement of sequence dependency, but /32 and /24 issue is there and below are the configurations.

`
global_defs {
enable_traps
enable_dbus
snmp_socket tcp:localhost:705:1
enable_snmp_keepalived
enable_snmp_rfc
}
vrrp_sync_group VGW {
group {
enp2s1-1
dp0p8s0.2001-3
dp0p9s0.2002-4
dp0p10s0.2003-5
}
}

vrrp_instance enp2s1-1 {
state BACKUP
interface enp2s1
virtual_router_id 1
version 2
start_delay 0
priority 100
advert_int 1
virtual_ipaddress {
192.168.237.90/24
}
}
vrrp_instance dp0p8s0.2001-3 {
state BACKUP
interface dp0p8s0.2001
virtual_router_id 3
version 2
start_delay 0
priority 100
advert_int 1
virtual_ipaddress {
16.2.101.1/16
}
notify {
/opt/sbin/notify-system-switchover
}
}
vrrp_instance dp0p9s0.2002-4 {
state BACKUP
interface dp0p9s0.2002
virtual_router_id 4
version 2
start_delay 0
priority 100
advert_int 1
virtual_ipaddress {
40.40.40.40/32
}
notify {
/opt/sbin/notify-system-switchover
}
}
vrrp_instance dp0p10s0.2003-5 {
state BACKUP
interface dp0p10s0.2003
virtual_router_id 5
version 2
start_delay 0
priority 200
advert_int 1
virtual_ipaddress {
20.20.1.1/16
}
notify {
/opt/sbin/notify-system-switchover
}
}
`

It is giving issue with enp2s1, for other interfaces it is aligned with the configuration, enp2s1 has got 192.168.237.95/24 from DHCP.

#ip l l

2: enp2s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 4000
link/ether 52:54:00:55:b4:d0 brd ff:ff:ff:ff:ff:ff
inet 192.168.237.95/24 scope global enp2s1
valid_lft forever preferred_lft forever
inet 192.168.237.90/32 scope global enp2s1
valid_lft forever preferred_lft forever
inet6 2407:9a00:1:1ed:5054:ff:fe55:b4d0/64 scope global dynamic mngtmpaddr
valid_lft 2591850sec preferred_lft 604650sec
inet6 fe80::5054:ff:fe55:b4d0/64 scope link
valid_lft forever preferred_lft forever
11: dp0p8s0.2001@dp0p8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 36:05:c1:0a:33:b3 brd ff:ff:ff:ff:ff:ff
inet 15.35.14.20/24 scope global dp0p8s0.2001
valid_lft forever preferred_lft forever
inet 16.2.101.1/16 scope global dp0p8s0.2001
valid_lft forever preferred_lft forever
inet6 fe80::3405:c1ff:fe0a:33b3/64 scope link
valid_lft forever preferred_lft forever
12: dp0p10s0.2003@dp0p10s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:c0:a8:6f:1b:10 brd ff:ff:ff:ff:ff:ff
inet 15.35.13.20/24 scope global dp0p10s0.2003
valid_lft forever preferred_lft forever
inet 20.20.1.1/16 scope global dp0p10s0.2003
valid_lft forever preferred_lft forever
inet6 fe80::2c0:a8ff:fe6f:1b10/64 scope link
valid_lft forever preferred_lft forever
13: dp0p9s0.2002@dp0p9s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 0a:70:59:33:cc:a5 brd ff:ff:ff:ff:ff:ff
inet 15.35.12.20/24 scope global dp0p9s0.2002
valid_lft forever preferred_lft forever
inet 40.40.40.40/32 scope global dp0p9s0.2002
valid_lft forever preferred_lft forever
inet6 fe80::870:59ff:fe33:cca5/64 scope link
valid_lft forever preferred_lft forever

@pqarmitage
Copy link
Collaborator

I am a bit surprised by your configuration since you have configured enable_dbus and start_delay but they are not supported in v1.2.24 and so that suggests you are normally running with a more recent version of keepalived. Does that version add the VIP with the wrong subnet mask?

I have tried your configuration with v1.2.24 and I do not see the problem, i.e. 192.168.237.90 has a /24 subnet mask.

You state that the problem does not exist with the VIPs on the other interfaces. I note that the VIPs either already have a /32 subnet mask, or have a /16 subnet mask which is shorted that the /24 address configured on the interface.

Could you please run kill -USR1 PID_OF_KEEPALIVED_PARENT_PROCESS. This should produce a file /tmp/keepalived.data, and if you post that here, I might be able to work out what is happening.

@pqarmitage
Copy link
Collaborator

Also the full logs of keepalived since it started would help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants