#2427 PR merged: Add DHCP auto-configuration for Network Manager (Ubuntu 20.04 Desktop)

Labels: enhancement, fixed / solved / done

OliverO2 opened issue at 2020-06-16 08:40:

Pull Request Details:
  • Type: Enhancement

  • Impact: High
    Personally I ( @jsmeix ) consider such kind of additional auto-detection
    functionality in ReaR as Low impact - provided there is a config variable
    where the user can specify what he wants and ReaR obeys.

  • How was this pull request tested? On Ubuntu 20.04 LTS Desktop,
    cf. https://github.com/rear/rear/issues/2368#issuecomment-644663685

  • Brief description of the changes in this pull request:

While ReaR already does DHCP auto-detection during mkrescue for a number of configurations, the Network Manager flavor on Ubuntu 20.04 Desktop is not supported. This leads to DHCP not being auto-enabled and usually a rescue system which is not accessible remotely.

This patch adds the required Network Manager auto-detection:

2020-06-16 10:18:24.532781411 Including prep/GNU/Linux/210_include_dhclient.sh
2020-06-16 10:18:24.572542776 Detected an active Network Manager connection 'Wired connection 1' set up via DHCPv4
2020-06-16 10:18:24.573677590 Auto-enabling DHCP on the rescue system

It is an isolated section which has been tested on two different Ubuntu 20.04 bare-metal installations, one of them on a notebook with wireless and wired interfaces.

OliverO2 commented at 2020-06-16 08:48:

As I was wondering why this issue did not come up on Ubuntu 18.04 Desktop, which also uses Network Manager, I looked up a ReaR log file on 18.04:

2020-04-30 21:02:36.477033150 Including prep/GNU/Linux/210_include_dhclient.sh
2020-04-30 21:02:36.490915411 Detected an active DHCP client process
2020-04-30 21:02:36.492331285 Auto-enabling DHCP on the rescue system

Interestingly, /etc/netplan looks identical on 18.04 and 20.04:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

gozora commented at 2020-06-16 08:53:

@gdha @jsmeix since we've agreed on change freeze (except bugs), I'm not sure about what milestone to set here ...

V.

jsmeix commented at 2020-06-16 10:24:

For now I set ReaR 2.6 milestone and
added @gdha so he could also have a look.

Personally I would "just merge" it into ReaR 2.6 because
as far as I see it is separated additional code that behaves fail safe
and it is only about additional DHCP autodetection functionality
so when that additional code does not work
there is no regression - again: only as far as I see.

jsmeix commented at 2020-06-16 10:39:

@gdha
I would like to merge it tomorrow morning
if there are no objections.

jsmeix commented at 2020-06-16 10:45:

@OliverO2
as long as this one is not merged I cannot add your
https://github.com/rear/rear/issues/2368#issuecomment-644663685
to https://github.com/rear/rear/wiki/Test-Matrix-rear-2.6

If and only if you have time for it could you test the same as in
https://github.com/rear/rear/issues/2368#issuecomment-644663685
but without the additional code here (i.e. with current plain master code)
and instead specify USE_DHCLIENT="yes" in local.conf?

OliverO2 commented at 2020-06-16 11:14:

Did a quick test of master fb23c5d711af9ee505a9b03ea7324a098f90891d:

Without USE_DHCLIENT="yes":

2020-06-16 13:01:29.885796061 Including prep/GNU/Linux/210_include_dhclient.sh
2020-06-16 13:01:29.904263879 Including prep/GNU/Linux/220_include_lvm_tools.sh

With USE_DHCLIENT="yes":

2020-06-16 13:05:42.945151029 Including prep/GNU/Linux/210_include_dhclient.sh
2020-06-16 13:05:42.946588136 Enabling DHCP on the rescue system (USE_DHCLIENT='yes')
[...]/usr/share/rear/lib/_input-output-functions.sh: line 476: type: dhcpcd: not found
2020-06-16 13:05:42.951037123 Including prep/GNU/Linux/220_include_lvm_tools.sh

As expected, the second version did start dhclient and an IP address was assigned correctly.

jsmeix commented at 2020-06-16 11:40:

@OliverO2
thank you so much for your prompt test
that verifies USE_DHCLIENT="yes" works as expected.

gdha commented at 2020-06-16 11:57:

@OliverO2 @jsmeix merging allowed for 2.6

jsmeix commented at 2020-06-16 12:11:

@gdha thank you for your review and your explicit comment
that merging for ReaR 2.6. is ok for you.

Therefore I will merge it in about 30 minutes
unless there are objections.

jsmeix commented at 2020-06-16 12:49:

@OliverO2 @gozora @gdha
thank you all for getting this issue solved for ReaR 2.6.


[Export of Github issue for rear/rear.]