Re: duplicate routes after switching keepalived nodes

Alexey Litvinenko <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <CAKydpob-iSbK-5SgQYq=9mB5sW9hqB6DTU2H30obcd9XuUYxLQ@mail.gmail.com>
Hello, Quentin

Thanks for your quick answer.

Unfortunately removing masks hasn`t solve the problem. Shared ips still
keep silent.
BTW, firewall is switched off.

In routes there are some changes:
first node (master mode):
~# route -n
Kernel IP routing table
Destination         Gateway         Genmask         Flags Metric Ref    Use
Iface
0.0.0.0             1.2.3.3              0.0.0.0               UG    0
0        0     eth1
1.2.3.0             0.0.0.0              255.255.255.248 U      0
0        0      eth1
192.168.160.0   0.0.0.0             255.255.255.0     U      0
0        0      eth0

second node (backup mode):
~# route -n
Kernel IP routing table
Destination     Gateway         Genmask           Flags Metric Ref    Use
Iface
0.0.0.0             1.2.3.3          0.0.0.0                UG    0
0        0    eth1
1.2.3.0             0.0.0.0          255.255.255.248  U       0
0        0    eth1
192.168.160.0  0.0.0.0           255.255.255.0     U       0
0        0    eth0

Version info:
keepalived -v
Keepalived v1.2.13 (08/17,2015)

Installed from ppa:keepalived/stable

With hope for your further help,
Alexey Litvinenko


--
Best regards,
Alexey Litvinenko,
system administrator,
Exadel Ukraine

www.exadel.com
[email protected]

On Thu, Mar 17, 2016 at 7:47 PM, Quentin Armitage <[email protected]>
wrote:

> Alexey,
>
> The first thing I would suggest is removing the subnet masks from the
> virtual addresses. Initially when I was configuring keepalived I specified
> the virtual addresses with the appropriate subnet mask for the interface
> they were on, and it didn't behave as I wanted. I removed the masks and it
> started working fine. The way to think about it is that we are adding a
> single address, and the subnet is already configured on the underlying
> interface.
>
> So change:
> virtual_ipaddress {
>                 192.168.160.27/24
> }
>
> to
> virtual_ipaddress {
>             192.168.160.27
> }
>
> and change
> virtual_ipaddress{
>     1.2.3.6/29
> }
> to
> virtual_ipaddress {
>     1.2.3.6
> }
>
> Also, if you use the latest version of keepalived from git, then you don't
> need to set the sysctl flags via a script, since keepalived does it itself
> now.
>
> I hope this helps,
>
> Quentin
>
>
> On Thu, 2016-03-17 at 17:49 +0200, Alexey Litvinenko wrote:
>
> Hello.
>
> I've installed two nodes with keepalived under ubuntu 14.04
> There is a pair of network interfaces switching (because it's gate) on
> each of this nodes and "use_vmac" is used.
>
> The problem is that when node switches to the master state and sets shared
> IPs for vrrp.1 and vrrp.2, this IPs are still not available for packaging
> exchange. And there are some routes through vrrp.1 and vrrp.2, which
> exactly duplicate already existing routes through real ethX,  added on the
> Master.
> Here is a keepalived config and output "route -n" of one of the nodes in
> Backup state and after switching to the Master
>
> First node
> 192.168.160.25 - eth0
> 1.2.3.4 - eth1
>
> Second node
> 192.168.160.26 - eth0
> 1.2.3.5 - eth1
>
> Shared IPs
> 192.168.160.27 - shared IP for interface vrrp.1 on eth0
> 1.2.3.6 - shared IP for vrrp.2 on eth1
>
> Keepalived config (the same on both nodes):
>
> global_defs {
>    notification_email {
>      [email protected]
>      [email protected]
>    }
>    notification_email_from [email protected]
>    smtp_server 192.168.160.5
>    smtp_connect_timeout 30
>    router_id LVS_DEVEL
> }
> vrrp_sync_group VG1 {
>         group {
>             VI_INTERNAL
>             VI_PROVIDER
>         }
> }
>
> vrrp_script check_prov_gate {
>         script "/bin/ping -c 1 -w 1 -I eth1 1.2.3.3"
>         interval 5
>         fall 1
> }
>
> vrrp_instance VI_INTERNAL {
>         state BACKUP
>         interface eth0
>         virtual_router_id 1
>         use_vmac
>         vmac_xmit_base
>         priority 100
>         advert_int 1
>         nopreempt
>         authentication {
>             auth_type PASS
>             auth_pass 123456
>         }
>         track_script {
>             check_prov_gate
>         }
>         virtual_ipaddress {
>                 192.168.160.27/24
>         }
>         notify_master "/usr/local/bin/vmac_tweak.sh 1"
> }
>
> vrrp_instance VI_PROVIDER {
>         state BACKUP
>         interface eth1
>         virtual_router_id 2
>         use_vmac
>         vmac_xmit_base
>         priority 100
>         advert_int 1
>         nopreempt
>         authentication {
>             auth_type PASS
>             auth_pass 123456
>         }
>         track_script {
>             check_prov_gate
>         }
>         virtual_ipaddress {
>                 1.2.3.6/29
>         }
>         notify_master "/usr/local/bin/vmac_tweak.sh 2"
> }
>
> virtual_server 192.168.160.27 {
>     delay_loop 5
>     lb_algo wrr
>     lb_kind DR
>     persistence_timeout 50
>     protocol TCP
>
>     real_server 192.168.160.25 {
>         inhibit_on_failure
>         weight 1
>     }
>
>     real_server 192.168.160.26 {
>         inhibit_on_failure
>         weight 11111
>     }
> }
>
> Output "route -n" on first node in Backup state:
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
> 0.0.0.0             1.2.3.3         0.0.0.0                 UG    0
> 0        0 eth1
> 1.2.3.0             0.0.0.0         255.255.255.248   U      0
> 0        0 eth1
> 192.168.160.0   0.0.0.0         255.255.255.0      U      0      0
> 0 eth0
>
>
> And after switching to Master state:
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
> 0.0.0.0            1.2.3.3             0.0.0.0            UG     0
> 0        0 eth1
> 1.2.3.0             0.0.0.0         255.255.255.248 U       0
> 0        0 eth1
> *1.2.3.0             0.0.0.0         255.255.255.248 U       0
> 0        0 vrrp.2*
> 192.168.160.0   0.0.0.0         255.255.255.0    U       0      0        0
> eth0
> *192.168.160.0   0.0.0.0         255.255.255.0    U       0      0
> 0 vrrp.1*
>
>
> All changes to sysctl from NOTE_vrrp_vmac.txt
> <https://github.com/acassen/keepalived/blob/master/doc/NOTE_vrrp_vmac.txt>
> have been made.
>
>
> Have any idea, why it's going on and how to set up it correctly?
>
>
> When i switch off "use_vmac", all works fine.
>
>
> Thanks
>
> --
> Best regards,
> Alexey
>
>
> CONFIDENTIALITY NOTICE: This email and files attached to it are
> confidential. If you are not the intended recipient you are hereby notified
> that using, copying, distributing or taking any action in reliance on the
> contents of this information is strictly prohibited. If you have received
> this email in error please notify the sender and delete this email.
>
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
> _______________________________________________ Keepalived-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/keepalived-devel
>
>
>

-- 


CONFIDENTIALITY NOTICE: This email and files attached to it are 
confidential. If you are not the intended recipient you are hereby notified 
that using, copying, distributing or taking any action in reliance on the 
contents of this information is strictly prohibited. If you have received 
this email in error please notify the sender and delete this email.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140

_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.