Lars,
      as I do not want to set up an initial "system" IP on the device,
setting 'net.ipv4.conf.all.promote_secondaries=1' is the way to go for
me ... and it appears to work perfectly - MANY THANKS!

For completeness, I am including an example showing what happens with
...promote_secondaries set to both 0 and 1, using 'ip', rather than
'ifconfig' (but as I said in my original post (and as also indicated
by Lars), be aware that the same problem exists whether you are using
'ip'/IPaddr2 or 'ifconfig'/IPaddr) ...

=== ** WITHOUT ** net.ipv4.conf.all.promote_secondaries set to 1 ===

    server# sysctl -w net.ipv4.conf.all.promote_secondaries=0
    net.ipv4.conf.all.promote_secondaries = 0

    server# ip -f inet addr add AAA.AAA.AAA.164/22 brd bbb.bbb.bbb.255 dev 
eth0.666 label eth0.666:0
    server# ip -f inet addr add AAA.AAA.AAA.163/22 brd bbb.bbb.bbb.255 dev 
eth0.666 label eth0.666:1
    server# ip -f inet addr add AAA.AAA.AAA.162/22 brd bbb.bbb.bbb.255 dev 
eth0.666 label eth0.666:2
    server# ip addr show
    ...
    6: eth0....@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
        link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
        inet AAA.AAA.AAA.164/22 brd bbb.bbb.bbb.255 scope global eth0.666:0
        inet AAA.AAA.AAA.163/22 brd bbb.bbb.bbb.255 scope global secondary 
eth0.666:1
        inet AAA.AAA.AAA.162/22 brd bbb.bbb.bbb.255 scope global secondary 
eth0.666:2
        inet6 ...
        ...

[ All OK. Remove the first IP (labeled 'eth0.666:0') ]

    server# ip -f inet addr delete AAA.AAA.AAA.164/22 dev eth0.666
    server# ip addr show
    ...
    6: eth0....@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
        link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
        inet6 ...
        ...

[ *** Ugh *** The other two addresses (labels 'eth0.666:1' and
              'eth0.666:2') where removed along with 'eth0.666:0' ]

[ Note that it is not the 'first' device by the *labeling* - if you created
  'eth0.666:2' first and then the other two, then deleting 'eth0.666:2'
  will delete the other two as well. ]

=== ** With ** net.ipv4.conf.all.promote_secondaries set to 1 ===

    server# sysctl -w net.ipv4.conf.all.promote_secondaries=1
    net.ipv4.conf.all.promote_secondaries = 1

    server# ip -f inet addr add AAA.AAA.AAA.164/22 brd bbb.bbb.bbb.255 dev 
eth0.666 label eth0.666:0
    server# ip -f inet addr add AAA.AAA.AAA.163/22 brd bbb.bbb.bbb.255 dev 
eth0.666 label eth0.666:1
    server# ip -f inet addr add AAA.AAA.AAA.162/22 brd bbb.bbb.bbb.255 dev 
eth0.666 label eth0.666:2
    server# ip addr show
    ...
    6: eth0....@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
        link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
        inet AAA.AAA.AAA.164/22 brd bbb.bbb.bbb.255 scope global eth0.666:0
        inet AAA.AAA.AAA.163/22 brd bbb.bbb.bbb.255 scope global secondary 
eth0.666:1
        inet AAA.AAA.AAA.162/22 brd bbb.bbb.bbb.255 scope global secondary 
eth0.666:2
        inet6 ...
        ...

[ All OK. Remove the first IP (labeled 'eth0.666:0') ]

    server# ip -f inet addr delete AAA.AAA.AAA.164/22 dev eth0.666
    server# ip addr show
    ...
    6: eth0....@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
        link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
        inet AAA.AAA.AAA.163/22 brd bbb.bbb.bbb.255 scope global eth0.666:1
        inet AAA.AAA.AAA.162/22 brd bbb.bbb.bbb.255 scope global secondary 
eth0.666:2
        inet6 ...
        ...

[ Yippee! The second IP (labeled 'eth0.666:1') has been promoted.
  Delete the new primary ... ]

    server# ip -f inet addr delete AAA.AAA.AAA.163/22 dev eth0.666
    server# ip addr show
    ...
    6: eth0....@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
        link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
        inet AAA.AAA.AAA.162/22 brd bbb.bbb.bbb.255 scope global eth0.666:2
        inet6 ...
        ...

[ Again, that works too. Delete the last one ... ]

    server# ip -f inet addr delete AAA.AAA.AAA.162/22 dev eth0.666
    server# ip addr show
    ...
    6: eth0....@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
        link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
        inet6 ...
        ...

[ Perfect ]

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to