Re: Keepalived v2.0.11 sometimes route to VIP isn't being deleted

Quentin Armitage <[email protected]> Tue, 14 May 2019 14:13:27 +0100
Newsgroups gmane.linux.keepalived.devel
Organization The Armitage family
Message-ID <[email protected]>
--===============0828390686798232441==
Content-Type: multipart/alternative; boundary="=-Z77PW9JoHTWNSPv+E2eW"


--=-Z77PW9JoHTWNSPv+E2eW
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Responses inline below:

On Tue, 2019-05-14 at 14:56 +0300, Yossi Boaron wrote:
> Hi all,
> 
> Sometimes after keepalived set & move a VIP in the system the route for the VIP IP isn't being deleted.
> The VIP (192.168.111.5) should be set to 'eth1' by keepalived as secondary IP address.
> 
> This is the relevant part of both 'ip a' and 'ip route' before keepalived starts to run:
> $ip a:
> -----
> eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
>     inet 192.168.111.21/24 brd 192.168.111.255 scope global dynamic noprefixroute eth1
>        valid_lft 2889sec preferred_lft 2889sec
> 
> $ ip r 
> default via 192.168.111.1 dev eth1 proto dhcp metric 101 
> 10.128.0.0/14 dev tun0 scope link 
> 172.22.0.0/24 dev eth0 proto kernel scope link src 172.22.0.75 metric 100 
> 172.30.0.0/16 dev tun0 
> 192.168.111.0/24 dev eth1 proto kernel scope link src 192.168.111.21 metric 101 
> 
> The Keepalived.conf file :
> -----------------------------------
> vrrp_instance ostest_API {
>     state BACKUP
>     interface eth1
>     virtual_router_id 169
>     priority 40
>     advert_int 1
>     authentication {
>         auth_type PASS
>         auth_pass ostest_api_vip
>     }
>     virtual_ipaddress {
>         192.168.123.5
>     }
>     track_script {
>         some_chk_script
>     }
> }

Should the virtual_ipaddress be 192.168.111.5?

> Sometimes after keepalived set&move the VIP (192.168.111.5) from this node, I can still see the route to the VIP.

When you say "set&move" the VIP, do you mean that the vrrp_instance becomes master, and then becomes backup again. If not,
could you please explain what is happening.
> ip r:-----$ ip r 
> default via 192.168.111.1 dev eth1 proto dhcp metric 101 
> 10.128.0.0/14 dev tun0 scope link 
> 172.22.0.0/24 dev eth0 proto kernel scope link src 172.22.0.75 metric 100 
> 172.30.0.0/16 dev tun0 
> 192.168.111.0/24 dev eth1 proto kernel scope link src 192.168.111.21 metric 101 
> 192.168.111.5 dev eth1 proto kernel scope link src 192.168.111.5 metric 101 
> $ 
With the keepalived configuration above (assuming the VIP is 192.168.111.5) keepalived doesn't do anything with routes (it
will only add or delete routes if there are static_routes or virtual_routes statements). Note also that the highlighted
route states 'proto kernel' which implies that the kernel added the route.

When the ip -r output shows the above, what does ip -a show? This looks like the route the kernel installs when an address
with a subnet mask of /32 is added, and so suggests that the address is still configured.

It would be helpful if you could include what the keepalived logs show, and also the output of keepalived -v.
> OS details$ uname -mrs
> Linux 4.18.0-80.el8.x86_64 x86_64
> $
It looks like you are running on RHEL 8, but the version of keepalived on RHEL 8 is 2.0.10. Have you built your own version
of keepalived; if so is there a reason why you haven't used 2.0.15 or 2.0.16?
> As a result of that, it's impossible to to communicate with the VIP from this node (e.g: ping 192.168.111.5) I'm getting
> 'connect: Invalid argument' error (due to 'src 192.168.111.5').
> 
> 
> I tried to search for similar bug in keepalived bug list - but no luck, is it a known issue in V2.0.11?
> 
> 
Quentin Armitage
--=-Z77PW9JoHTWNSPv+E2eW
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<html><head></head><body bgcolor=3D"#ffffff" text=3D"#2e3436" link=3D"#2a76=
c6" vlink=3D"#2e3436"><div>Responses inline below:</div><div><br></div><div=
>On Tue, 2019-05-14 at 14:56 +0300, Yossi Boaron wrote:</div><blockquote ty=
pe=3D"cite" style=3D"margin:0 0 0 .8ex; border-left:2px #729fcf solid;paddi=
ng-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr">Hi all,</div><div dir=3D"ltr=
"><br></div><div dir=3D"ltr"><div dir=3D"ltr">Sometimes after keepalived se=
t &amp; move a VIP in the system the route for the VIP IP isn't being delet=
ed.</div><div>The VIP (192.168.111.5) should be set to 'eth1' by keepalived=
 as secondary IP address.</div><div><br></div><div>This is the relevant par=
t of both 'ip a' and 'ip route' before keepalived starts to run:</div><div>=
$ip a:</div><div>-----</div><div dir=3D"ltr">eth1: &lt;BROADCAST,MULTICAST,=
UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000</d=
iv><div dir=3D"ltr">&nbsp; &nbsp; inet&nbsp;<a href=3D"http://192.168.111.2=
1/24" target=3D"_blank">192.168.111.21/24</a>&nbsp;brd 192.168.111.255 scop=
e global dynamic noprefixroute eth1</div><div dir=3D"ltr">&nbsp; &nbsp; &nb=
sp; &nbsp;valid_lft 2889sec preferred_lft 2889sec</div><div dir=3D"ltr"><br=
></div><div dir=3D"ltr"><div dir=3D"ltr">$ ip r&nbsp;</div><div dir=3D"ltr"=
>default via 192.168.111.1 dev eth1 proto dhcp metric 101&nbsp;</div><div d=
ir=3D"ltr"><a href=3D"http://10.128.0.0/14" target=3D"_blank">10.128.0.0/14=
</a>&nbsp;dev tun0 scope link&nbsp;</div><div dir=3D"ltr"><a href=3D"http:/=
/172.22.0.0/24" target=3D"_blank">172.22.0.0/24</a>&nbsp;dev eth0 proto ker=
nel scope link src 172.22.0.75 metric 100&nbsp;</div><div dir=3D"ltr"><a hr=
ef=3D"http://172.30.0.0/16" target=3D"_blank">172.30.0.0/16</a>&nbsp;dev tu=
n0&nbsp;</div><div dir=3D"ltr"><a href=3D"http://192.168.111.0/24" target=
=3D"_blank">192.168.111.0/24</a>&nbsp;dev eth1 proto kernel scope link src =
192.168.111.21 metric 101&nbsp;</div><div dir=3D"ltr"><br></div><div dir=3D=
"ltr"><div dir=3D"ltr">The Keepalived.conf file :</div><div dir=3D"ltr">---=
--------------------------------</div><div dir=3D"ltr">vrrp_instance ostest=
_API {</div><div dir=3D"ltr">&nbsp; &nbsp; state BACKUP</div><div dir=3D"lt=
r">&nbsp; &nbsp; interface eth1</div><div dir=3D"ltr">&nbsp; &nbsp; virtual=
_router_id 169</div><div dir=3D"ltr">&nbsp; &nbsp; priority 40</div><div di=
r=3D"ltr">&nbsp; &nbsp; advert_int 1</div><div dir=3D"ltr">&nbsp; &nbsp; au=
thentication {</div><div dir=3D"ltr">&nbsp; &nbsp; &nbsp; &nbsp; auth_type =
PASS</div><div dir=3D"ltr">&nbsp; &nbsp; &nbsp; &nbsp; auth_pass ostest_api=
_vip</div><div dir=3D"ltr">&nbsp; &nbsp; }</div><div dir=3D"ltr">&nbsp; &nb=
sp; virtual_ipaddress {</div><div dir=3D"ltr">&nbsp; &nbsp; &nbsp; &nbsp; 1=
92.168.123.5</div><div dir=3D"ltr">&nbsp; &nbsp; }</div><div dir=3D"ltr">&n=
bsp; &nbsp; track_script {</div><div dir=3D"ltr">&nbsp; &nbsp; &nbsp; &nbsp=
; some_chk_script</div><div dir=3D"ltr">&nbsp; &nbsp; }</div><div dir=3D"lt=
r">}</div></div></div></div></div></blockquote><div><br></div><div>Should t=
he virtual_ipaddress be 192.168.111.5?</div><div><br></div><blockquote type=
=3D"cite" style=3D"margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding=
-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"l=
tr"><br class=3D"gmail-m_627745697021074346gmail-Apple-interchange-newline"=
></div><div>Sometimes after keepalived set&amp;move the VIP (192.168.111.5)=
 from this node, I can still see the route to the VIP.</div></div></div></d=
iv></blockquote><div><br></div><div>When you say "set&amp;move" the VIP, do=
 you mean that the vrrp_instance becomes master, and then becomes backup ag=
ain. If not, could you please explain what is happening.</div><blockquote t=
ype=3D"cite" style=3D"margin:0 0 0 .8ex; border-left:2px #729fcf solid;padd=
ing-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div>ip r:=
</div><div>-----</div><div><pre class=3D"gmail-m_627745697021074346gmail-bz=
_comment_text" id=3D"gmail-m_627745697021074346gmail-comment_text_2" style=
=3D"white-space:pre-wrap;margin:1em;padding-bottom:1em;width:50em"><font co=
lor=3D"#000000">$ ip r=20
default via 192.168.111.1 dev eth1 proto dhcp metric 101=20
<a href=3D"http://10.128.0.0/14" target=3D"_blank">10.128.0.0/14</a> dev tu=
n0 scope link=20
<a href=3D"http://172.22.0.0/24" target=3D"_blank">172.22.0.0/24</a> dev et=
h0 proto kernel scope link src 172.22.0.75 metric 100=20
<a href=3D"http://172.30.0.0/16" target=3D"_blank">172.30.0.0/16</a> dev tu=
n0=20
<a href=3D"http://192.168.111.0/24" target=3D"_blank">192.168.111.0/24</a> =
dev eth1 proto kernel scope link src 192.168.111.21 metric 101=20
</font><b><font color=3D"#ff0000">192.168.111.5 dev eth1 proto kernel scope=
 link src 192.168.111.5 metric 101</font></b><font color=3D"#000000">=20
$ </font></pre></div><div></div></div></div></div></blockquote><div>With th=
e keepalived configuration above (assuming the VIP is 192.168.111.5) keepal=
ived doesn't do anything with routes (it will only add or delete routes if =
there are static_routes or virtual_routes statements). Note also that the h=
ighlighted route states 'proto kernel' which implies that the kernel added =
the route.</div><div><br></div><div>When the ip -r output shows the above, =
what does ip -a show? This looks like the route the kernel installs when an=
 address with a subnet mask of /32 is added, and so suggests that the addre=
ss is still configured.</div><div><br></div><div>It would be helpful if you=
 could include what the keepalived logs show, and also the output of keepal=
ived -v.</div><blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex; border-=
left:2px #729fcf solid;padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr">=
<div dir=3D"ltr"><div><pre class=3D"gmail-bz_comment_text" id=3D"gmail-comm=
ent_text_0" style=3D"white-space:pre-wrap;margin:1em;padding-bottom:1em;wid=
th:50em;color:rgb(0,0,0)">OS details</pre><pre class=3D"gmail-bz_comment_te=
xt" id=3D"gmail-comment_text_0" style=3D"white-space:pre-wrap;margin:1em;pa=
dding-bottom:1em;width:50em;color:rgb(0,0,0)">$ uname -mrs
Linux 4.18.0-80.el8.x86_64 x86_64
$</pre></div></div></div></div></blockquote><div>It looks like you are runn=
ing on RHEL 8, but the version of keepalived on RHEL 8 is 2.0.10. Have you =
built your own version of keepalived; if so is there a reason why you haven=
't used 2.0.15 or 2.0.16?</div><blockquote type=3D"cite" style=3D"margin:0 =
0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir=3D"ltr">=
<div dir=3D"ltr"><div dir=3D"ltr"><div>As a result of that, it's impossible=
 to to communicate with the VIP from this node (e.g: ping 192.168.111.5) I'=
m getting 'connect: Invalid argument' error (due to 'src 192.168.111.5').</=
div><div><br></div><div><br></div><div><br></div><div>I tried to search for=
 similar bug in keepalived bug list - but no luck, is it a known issue in V=
2.0.11?</div><div><br></div><div></div></div></div></div><pre>
</pre></blockquote><div>Quentin Armitage</div></body></html>
--=-Z77PW9JoHTWNSPv+E2eW--



--===============0828390686798232441==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============0828390686798232441==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel

--===============0828390686798232441==--