keepalived on CentOS - UDP port question

Thomas Spiessens <[email protected]> Thu, 24 Nov 2016 10:38:57 +0000
Newsgroups gmane.linux.keepalived.announce
Message-ID <CANNv_rapbh2nkWBGJPWQ=yo3rLq9O3n7ezDowiuFG13BKQuDjw@mail.gmail.com>
--===============1241092998790787883==
Content-Type: multipart/alternative; boundary=e89a8ff1ce6e79dcd40542099d2b

--e89a8ff1ce6e79dcd40542099d2b
Content-Type: text/plain; charset=UTF-8

Hi,
I have a problem with keepalived not allowing UDP communication to continue
longer than about 20-30 seconds. I have two servers on which keepalived is
running (version 1.2.13-7.el7 on CentOS 7.1) and for which keepalived is
managing a virtual IP address. Below is the keepalived.conf for one server
(10.65.101.3) which checks that port 1026 is available. This port will only
be available on one of the two servers, hence that server will get the
virtual IP address. With this configuration, UDP communication on port 1025
seems to be failing shortly after restarting the keepalived service. This
can be seen by the tshark trace from that server. IP 10.65.101.194 should
be sending an UDP packet every second to 10.65.101.204:1025. After about 22
packets (in this case), it stops. I have also added an additional section
to the configuration file which can also be seen below, but this did not
help. Anyone have an idea why this is happening ?

Kind regards,
Thomas.

*keepalived.conf*
    vrrp_script chk_flux_scada_1 {
        script "</dev/tcp/10.65.101.3/1026"
        interval 5
        weight 2
        }

        vrrp_instance flux_scada_1 {
        state BACKUP
        interface enp16s0f0
        virtual_router_id 2
        priority 100
        advert_int 1
        garp_master_delay 1
        authentication {
        auth_type PASS
        auth_pass flux_scada_1
        }
        virtual_ipaddress {
            10.65.101.204/24
        }
        notify_master "/opt/tmsflux/bin/tmsflux.sh vipchg 10.65.101.204"
        dont_track_primary
        track_interface {
            enp16s0f0 weight 2
        }
        track_script {
        chk_flux_scada_1
        }
        }

*tshark trace*
[root@nec03 tmsflux]# tshark -i enp16s0f0 | grep 10.65.101.194
Running as user "root" and group "root". This could be dangerous.
Capturing on 'enp16s0f0'
209 675 0.603264894 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
855 877 1.603166155 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
1631 1750 2.603071785 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
1920 1921 3.602926368 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
2804 2802 4.602978992 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
3049 3028 5.602730339 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
3930 3919 6.602575707 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
4006 4125 7.602456663 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
4420 5013 8.602439187 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
5096 5182 9.602249722 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
5597 6053 10.602128231 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
6245 6245 11.602052556 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
7047 7036 12.601950789 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
7121 7206 13.601855779 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
7440 8014 14.601632708 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
8168 8268 15.601568155 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
8498 9035 16.601527362 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
9235 9328 17.601420998 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
9607 10085 18.601245518 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
10269 10353 19.601174646 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
10651 11123 20.601081274 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
11334 11419 21.600983814 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
11730 12165 22.600841343 10.65.101.194 -> 10.65.101.204 UDP 71 Source port:
blackjack  Destination port: blackjack
27749

*keepalived.conf - additional section*
virtual_server 10.65.101.204 1025 {
protocol UDP

real_server 10.65.101.2 {
TCP_CHECK {
connect_port 1026
}
}

real_server 10.65.101.3 {
TCP_CHECK {
connect_port 1026
}
}
}

--e89a8ff1ce6e79dcd40542099d2b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div>I have a problem with keepalived not allowing UDP =
communication to continue longer than about 20-30 seconds. I have two serve=
rs on which keepalived is running (version 1.2.13-7.el7 on CentOS 7.1) and =
for which keepalived is managing a virtual IP address. Below is the keepali=
ved.conf for one server (10.65.101.3) which checks that port 1026 is availa=
ble. This port will only be available on one of the two servers, hence that=
 server will get the virtual IP address. With this configuration, UDP commu=
nication on port 1025 seems to be failing shortly after restarting the keep=
alived service. This can be seen by the tshark trace from that server. IP 1=
0.65.101.194 should be sending an UDP packet every second to <a href=3D"htt=
p://10.65.101.204:1025">10.65.101.204:1025</a>. After about 22 packets (in =
this case), it stops. I have also added an additional section to the config=
uration file which can also be seen below, but this did not help. Anyone ha=
ve an idea why this is happening ?</div><div><br></div><div>Kind regards,</=
div><div>Thomas.</div><div><br></div><div><div><b>keepalived.conf</b></div>=
<div>=C2=A0 =C2=A0 vrrp_script chk_flux_scada_1 {</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 script &quot;&lt;/dev/tcp/<a href=3D"http://10.65.101.3/1026"=
>10.65.101.3/1026</a>&quot;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 interval =
5</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 weight 2</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 }</div><div><br></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 vrrp_i=
nstance flux_scada_1 {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 state BACKUP</=
div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 interface enp16s0f0</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 virtual_router_id 2</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 priority 100</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 advert_int 1</div><d=
iv>=C2=A0 =C2=A0 =C2=A0 =C2=A0 garp_master_delay 1</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 authentication {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 auth_t=
ype PASS</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 auth_pass flux_scada_1</div>=
<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 vi=
rtual_ipaddress {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <a hr=
ef=3D"http://10.65.101.204/24">10.65.101.204/24</a></div><div>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 }</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 notify_master &quot;=
/opt/tmsflux/bin/tmsflux.sh vipchg 10.65.101.204&quot;</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 dont_track_primary</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
track_interface {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 enp16=
s0f0 weight 2</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 track_script {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 chk_=
flux_scada_1</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 }</div></div><div><br></div><div><b>tshark trace</b></div=
><div><div>[root@nec03 tmsflux]# tshark -i enp16s0f0 | grep 10.65.101.194</=
div><div>Running as user &quot;root&quot; and group &quot;root&quot;. This =
could be dangerous.</div><div>Capturing on &#39;enp16s0f0&#39;</div><div>20=
9 675 0.603264894 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source port: bla=
ckjack =C2=A0Destination port: blackjack</div><div>855 877 1.603166155 10.6=
5.101.194 -&gt; 10.65.101.204 UDP 71 Source port: blackjack =C2=A0Destinati=
on port: blackjack</div><div>1631 1750 2.603071785 10.65.101.194 -&gt; 10.6=
5.101.204 UDP 71 Source port: blackjack =C2=A0Destination port: blackjack</=
div><div>1920 1921 3.602926368 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Sou=
rce port: blackjack =C2=A0Destination port: blackjack</div><div>2804 2802 4=
.602978992 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source port: blackjack =
=C2=A0Destination port: blackjack</div><div>3049 3028 5.602730339 10.65.101=
.194 -&gt; 10.65.101.204 UDP 71 Source port: blackjack =C2=A0Destination po=
rt: blackjack</div><div>3930 3919 6.602575707 10.65.101.194 -&gt; 10.65.101=
.204 UDP 71 Source port: blackjack =C2=A0Destination port: blackjack</div><=
div>4006 4125 7.602456663 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source p=
ort: blackjack =C2=A0Destination port: blackjack</div><div>4420 5013 8.6024=
39187 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source port: blackjack =C2=
=A0Destination port: blackjack</div><div>5096 5182 9.602249722 10.65.101.19=
4 -&gt; 10.65.101.204 UDP 71 Source port: blackjack =C2=A0Destination port:=
 blackjack</div><div>5597 6053 10.602128231 10.65.101.194 -&gt; 10.65.101.2=
04 UDP 71 Source port: blackjack =C2=A0Destination port: blackjack</div><di=
v>6245 6245 11.602052556 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source po=
rt: blackjack =C2=A0Destination port: blackjack</div><div>7047 7036 12.6019=
50789 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source port: blackjack =C2=
=A0Destination port: blackjack</div><div>7121 7206 13.601855779 10.65.101.1=
94 -&gt; 10.65.101.204 UDP 71 Source port: blackjack =C2=A0Destination port=
: blackjack</div><div>7440 8014 14.601632708 10.65.101.194 -&gt; 10.65.101.=
204 UDP 71 Source port: blackjack =C2=A0Destination port: blackjack</div><d=
iv>8168 8268 15.601568155 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source p=
ort: blackjack =C2=A0Destination port: blackjack</div><div>8498 9035 16.601=
527362 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source port: blackjack =C2=
=A0Destination port: blackjack</div><div>9235 9328 17.601420998 10.65.101.1=
94 -&gt; 10.65.101.204 UDP 71 Source port: blackjack =C2=A0Destination port=
: blackjack</div><div>9607 10085 18.601245518 10.65.101.194 -&gt; 10.65.101=
.204 UDP 71 Source port: blackjack =C2=A0Destination port: blackjack</div><=
div>10269 10353 19.601174646 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Sourc=
e port: blackjack =C2=A0Destination port: blackjack</div><div>10651 11123 2=
0.601081274 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source port: blackjack=
 =C2=A0Destination port: blackjack</div><div>11334 11419 21.600983814 10.65=
.101.194 -&gt; 10.65.101.204 UDP 71 Source port: blackjack =C2=A0Destinatio=
n port: blackjack</div><div>11730 12165 22.600841343 10.65.101.194 -&gt; 10=
.65.101.204 UDP 71 Source port: blackjack =C2=A0Destination port: blackjack=
</div><div>27749</div></div><div><br></div><div><b>keepalived.conf - additi=
onal section</b></div><div><div>virtual_server 10.65.101.204 1025 {</div><d=
iv><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>protoco=
l UDP</div><div><br></div><div><span class=3D"Apple-tab-span" style=3D"whit=
e-space:pre">	</span>real_server 10.65.101.2 {</div><div><span class=3D"App=
le-tab-span" style=3D"white-space:pre">		</span>TCP_CHECK {</div><div><span=
 class=3D"Apple-tab-span" style=3D"white-space:pre">			</span>connect_port =
1026</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre">		<=
/span>}</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre">=
	</span>}</div><div><br></div><div><span class=3D"Apple-tab-span" style=3D"=
white-space:pre">	</span>real_server 10.65.101.3 {</div><div><span class=3D=
"Apple-tab-span" style=3D"white-space:pre">		</span>TCP_CHECK {</div><div><=
span class=3D"Apple-tab-span" style=3D"white-space:pre">			</span>connect_p=
ort 1026</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"=
>		</span>}</div><div><span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span>}</div><div>}</div></div><div><br></div><div><br></div><div><di=
v><br></div></div></div>

--e89a8ff1ce6e79dcd40542099d2b--


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

------------------------------------------------------------------------------

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

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

--===============1241092998790787883==--