#2468 Issue closed: Migrate network config files when more than 1 IP address is configured on same interface

Labels: enhancement, needs sponsorship, no-issue-activity

geksi opened issue at 2020-08-04 10:29:

Relax-and-Recover (ReaR) Issue Template

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • ReaR version ("/usr/sbin/rear -V"):
    Relax-and-Recover 2.4 / Git

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
    RHEL 7.7

  • Description of the issue (ideally so that others can reproduce it):
    ReaR fails to patch network config file if more than 1 IP adress is configured on same interface.

System has one NIC, but two IP's configured:

[root@xxxxzzzz network-scripts]# cat ifcfg-eth0
# Generated by dracut initrd
NAME="eth0"
HWADDR=00:50:89:89:e0:ee
ONBOOT="yes"
NETBOOT="yes"
UUID="ee36f051-aa5c-40b4-9375-1edf0c5cdc21"
IPV6INIT="no"
BOOTPROTO="none"
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
IPADDR="10.34.75.11"
IPADDR2="10.34.75.124"
PREFIX="25"
PREFIX2="25"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"

Using IP mapping for migration purposes. Mapping file:

[root@xxxxzzzz mappings]# vi ip_addresses
eth0 10.34.75.21/25
eth0 10.34.75.125/25

Booting ReaR ISO and checking network config. Seems to be OK:

RESCUE xxxxzzzz:~ # ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:89:89:05:78 brd ff:ff:ff:ff:ff:ff
    inet 10.34.75.21/25 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.34.75.125/25 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe45::240:56ff:fe89:593/64 scope link
       valid_lft forever preferred_lft forever

Running "rear recover":

.....
User confirmed restored files
Not patching dead link 'etc/sysconfig/grub' -> '/mnt/local/mnt/local/etc/default/grub'
Not patching dead link 'etc/mtab' -> '/mnt/local/proc/5774/mounts'
Patching file ifcfg-eth0
Patching file ifcfg-eth0
Running mkinitrd...
Updated initrd with new drivers for kernel 3.10.0-1127.13.1.el7.x86_64.
Running mkinitrd...
Updated initrd with new drivers for kernel 3.10.0-1127.8.2.el7.x86_64.
Skip installing GRUB Legacy boot loader because GRUB 2 is installed (grub-probe or grub2-probe exist).
Installing GRUB2 boot loader
.....

Now checking patched ifcfg-eth0 file. IPADDR2 was not patched, but IPADDR patched 2 times:

# Generated by dracut initrd
NAME="eth0"
HWADDR=00:50:89:89:05:78
ONBOOT="yes"
NETBOOT="yes"
UUID="ee36f051-aa5c-40b4-9375-1edf0c5cdc21"
IPV6INIT="no"
BOOTPROTO='static'
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
IPADDR='10.34.75.125'
IPADDR2="10.34.75.124"
PREFIX="25"
PREFIX2="25"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"

jsmeix commented at 2020-08-04 11:36:

As far as I know migrating things like more than one IP per interface
were never supported by ReaR so this issue is an enhancement request.

We have already
https://github.com/rear/rear/issues/2312
which had emerged from
https://github.com/rear/rear/issues/2310
and
https://github.com/rear/rear/pull/2313

According to
https://github.com/rear/rear/issues/2312
such enhancement requests will not be implemented by ReaR upstream
on a voluntary base "just for free" but need substantial sponsorship, cf.
http://relax-and-recover.org/development/

jsmeix commented at 2020-08-04 11:39:

@rmetrich
only FYI (this issue is about ReaR 2.4 on RHEL 7)

geksi commented at 2020-08-04 11:47:

I'm wondering the rescue environment has the correct configuration...

eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:89:89:05:78 brd ff:ff:ff:ff:ff:ff
    inet 10.34.75.21/25 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.34.75.125/25 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe45::240:56ff:fe89:593/64 scope link
       valid_lft forever preferred_lft forever

github-actions commented at 2020-10-04 01:43:

Stale issue message


[Export of Github issue for rear/rear.]