Re: Start keepalived without IP on interface?
Quentin Armitage <[email protected]> Fri, 29 Jun 2018 12:10:39 +0100
| Newsgroups | gmane.linux.keepalived.devel |
|---|---|
| Organization | The Armitage family |
| Message-ID | <[email protected]> |
--===============6577347691379280347==
Content-Type: multipart/alternative; boundary="=-yiqoIeqJ/4+LmgQgBbdF"
--=-yiqoIeqJ/4+LmgQgBbdF
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Can you try keepalived v2.0.5. The version 2.0.x series supports
"dynamic" interfaces, in other words using an interface that doesn't
exist when keepalived starts, but is subsequently created. You might
need to add the keyword "dynamic_interfaces" in the global_defs section
of your configuration.
To be honest, I'm not sure if it will work, since I have never thought
about this situation. If it doesn't work, then I think keepalived
should be modified so that the vrrp instance is in fault state until
the underlying interface has an address.
Quentin Armitage
On Fri, 2018-06-29 at 11:02 +0100, Paul Gildea wrote:
> I'm new to keepalived. I want to use keepalived on an interface that
> will get an IP at some point but will not have one initially, can I
> set this up somehow in the config? If I try to start it now
> keepalived errors out as keepalived doesn't know what source IP
> address to use when sending VRRP packets. If this is not possible I
> presume I could set up a dummy IP and remove it after keepalived
> starts or script keepalived to start after the interface gets a valid
> IP, just wondering is it possible to start without said IP and I just
> can't find out how to do it.
>
> Conf:
>
> ! Configuration File for keepalived
>
> vrrp_instance VI_1 {
> state MASTER
> interface eth0
> virtual_router_id 51
> priority 150
> advert_int 1
> authentication {
> auth_type PASS
> auth_pass pwd
> }
> virtual_ipaddress {
> 192.168.0.13
> }
> notify /etc/state_change.py
> }
>
> Log:
>
> keepalived -f /etc/keepalived.conf --log-console --dont-fork
> Thu Jun 28 11:25:53 2018: Starting Keepalived v1.4.4 (05/08,2018)
>
> Thu Jun 28 11:25:53 2018: Running on Linux 4.7.8 #9 SMP Wed Jun
> 27 17:25:18 IST
> 2018 (built for Linux 4.7.8)
>
> Thu Jun 28 11:25:53 2018: Opening file '/etc/keepalived.conf'.
>
> Thu Jun 28 11:25:53 2018: Starting Healthcheck child process,
> pid=18886
> Thu Jun 28 11:25:53 2018: Starting VRRP child process, pid=18887
>
> Thu Jun 28 11:25:53 2018: Opening file '/etc/keepalived.conf'.
>
> Thu Jun 28 11:25:53 2018: Registering Kernel netlink reflector
>
> Thu Jun 28 11:25:53 2018: Registering Kernel netlink command
> channel
> Thu Jun 28 11:25:53 2018: Registering gratuitous ARP shared
> channel
> Thu Jun 28 11:25:53 2018: Opening file '/etc/keepalived.conf'.
>
> Thu Jun 28 11:25:53 2018: WARNING - default user
> 'keepalived_script' for script
> execution does not exist - please create.
>
> Thu Jun 28 11:25:53 2018: (VI_1): Cannot find an IP address to
> use for interface
> eth0
>
> Thu Jun 28 11:25:54 2018: Stopped
>
> Thu Jun 28 11:25:54 2018: Keepalived_vrrp exited with permanent
> error CONFIG. Te
> rminating
>
> Thu Jun 28 11:25:54 2018: Stopping
>
> Thu Jun 28 11:25:54 2018: Stopped
>
> Thanks,
>
> --
> Paul
>
> -------------------------------------------------------------------
> -----------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot__________
> _____________________________________
> Keepalived-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/keepalived-devel
--=-yiqoIeqJ/4+LmgQgBbdF
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>Can you try keepalived v2.0.5. The version 2.0.x=
series supports "dynamic" interfaces, in other words using an interface th=
at doesn't exist when keepalived starts, but is subsequently created. You m=
ight need to add the keyword "dynamic_interfaces" in the global_defs sectio=
n of your configuration.</div><div><br></div><div>To be honest, I'm not sur=
e if it will work, since I have never thought about this situation. If it d=
oesn't work, then I think keepalived should be modified so that the vrrp in=
stance is in fault state until the underlying interface has an address.</di=
v><div><br></div><div>Quentin Armitage</div><div><br></div><div>On Fri, 201=
8-06-29 at 11:02 +0100, Paul Gildea wrote:</div><blockquote type=3D"cite" s=
tyle=3D"margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">=
<div dir=3D"ltr"><div>I'm new to keepalived. I want to use keepalived on an=
interface that will get an IP at some point but will not have one initiall=
y, can I set this up somehow in the config? If I try to start it now keepal=
ived errors out as keepalived doesn't know what source IP address to use wh=
en sending VRRP packets. If this is not possible I presume I could set up a=
dummy IP and remove it after keepalived starts or script keepalived to sta=
rt after the interface gets a valid IP, just wondering is it possible to st=
art without said IP and I just can't find out how to do it. </div><div=
><br></div><div>Conf:</div><div><br></div><div>! Configuration File for kee=
palived</div><div><br></div><div> vrrp_instance VI_1 {</div><d=
iv> state MASTER</div><div> =
interface eth0</div><div> virtual_router_=
id 51</div><div> priority 150</div><div> &=
nbsp; advert_int 1</div><div> auth=
entication {</div><div> auth_type =
PASS</div><div> auth_pass pwd</div=
><div> }</div><div> v=
irtual_ipaddress {</div><div> 192.1=
68.0.13</div><div> }</div><div> &nb=
sp; notify /etc/state_change.py</div><div> }</div><div>=
<br></div><div>Log:</div><div><br></div><div> keepalived -f /e=
tc/keepalived.conf --log-console --dont-fork </div><div> =
Thu Jun 28 11:25:53 2018: Starting Keepalived v1.4.4 (05/08,2018) &=
nbsp; </div><div> Thu =
Jun 28 11:25:53 2018: Running on Linux 4.7.8 #9 SMP Wed Jun 27 17:25:18 IST=
</div><div> 2018 (built for Linux 4.7.8) &=
nbsp; =
&nbs=
p; </div><div> Thu Jun 28 11:25:53 2018: Opening =
file '/etc/keepalived.conf'. &nbs=
p; </div><div> Thu Jun 28 11:25:53 2018: Starting=
Healthcheck child process, pid=3D18886 </=
div><div> Thu Jun 28 11:25:53 2018: Starting VRRP child proces=
s, pid=3D18887 </div=
><div> Thu Jun 28 11:25:53 2018: Opening file '/etc/keepalived=
.conf'. </div=
><div> Thu Jun 28 11:25:53 2018: Registering Kernel netlink re=
flector </div=
><div> Thu Jun 28 11:25:53 2018: Registering Kernel netlink co=
mmand channel </div><div> &n=
bsp; Thu Jun 28 11:25:53 2018: Registering gratuitous ARP shared channel &n=
bsp; </div><div> Thu J=
un 28 11:25:53 2018: Opening file '/etc/keepalived.conf'. &nb=
sp; </div><div> Thu J=
un 28 11:25:53 2018: WARNING - default user 'keepalived_script' for script&=
nbsp;</div><div> execution does not exist - please create. &nb=
sp; &=
nbsp; </div><div>&nbs=
p; Thu Jun 28 11:25:53 2018: (VI_1): Cannot find an IP address to us=
e for interface</div><div> eth0 &nb=
sp; &=
nbsp; =
&nbs=
p; </div><div> Thu Jun 28 11:25:54 2018: Stopped &=
nbsp; =
&nbs=
p; </div><div> Thu Jun 28 11:25:54 2018: Keepalive=
d_vrrp exited with permanent error CONFIG. Te</div><div> rmina=
ting =
 =
; &nb=
sp; </div><div> Thu Jun 28 11:25:54 =
2018: Stopping &nbs=
p; &n=
bsp; </div><div> Thu Jun 28 11:25:54 2018:=
Stopped </div><div><br></div><div>Thanks,</div><div><br></div><div>--=
</div><div>Paul</div></div>
<pre>----------------------------------------------------------------------=
--------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! <a href=3D"http://sdm.link/slashdot">htt=
p://sdm.link/slashdot</a></pre><pre>_______________________________________=
________
Keepalived-devel mailing list
<a href=3D"mailto:[email protected]">Keepalived-devel@=
lists.sourceforge.net</a>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/keepalived-devel">h=
ttps://lists.sourceforge.net/lists/listinfo/keepalived-devel</a>
</pre></blockquote></body></html>
--=-yiqoIeqJ/4+LmgQgBbdF--
--===============6577347691379280347==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--===============6577347691379280347==
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
--===============6577347691379280347==--