#1574 PR merged: New network script generator (60-network-devices.sh)

Labels: enhancement, documentation, cleanup, fixed / solved / done

rmetrich opened issue at 2017-11-14 14:42:

This work is a solution for Issue #1561.

It consists in a full rewrite of the 310_network_devices.sh script generating network interfaces for use during the ReaR recovery early boot.
It also handles corner cases/odd setups that can be found from time to time, typically when the administrator uses bonding + bridges + vlans as well as teaming.
With that new code, adding new configurations will be very easy in the future.

I also added interface mapping code to the corresponding 350_routing.sh script generating routes.

In the tests/ directory, you will 2 setups that I used to verify the network generation code. It covers quite a lot of setups found.

jsmeix commented at 2017-11-15 13:38:

many thanks for your substantial work!

According to
I set it to "ReaR 2.4"

@gdha @gozora
I dared to set you as reviewers here. I would very much
appreciate it if you could have a look if there are perhaps
immediately visible possible issues with the new code.
Many thanks in advance!

gdha commented at 2017-11-15 13:59:

The only thing that bothers me are the Unit Tests - nice to have but do they belong in the code? There are pros and contras for it. We can leave it here for the moment

jsmeix commented at 2017-11-15 14:01:

does your approval mean that from your current point of view
we could even merge it into ReaR 2.3 or should we wait in any
case and merge it directly after ReaR 2.3 was released (to get
it tested by ReaR users until ReaR 2.4 will be released).

gdha commented at 2017-11-15 14:06:

@jsmeix I would prefer that we release 2.3 first and then do the merge as then we will have plenty of time to test the code base.

rmetrich commented at 2017-11-15 14:13:

@gdha I put the unit tests here just for reference.
Since network configurations can be very tricky, I believe having unit tests may help in the future, making sure nothing breaks.

jsmeix commented at 2017-11-15 14:13:

I also prefer to release ReaR 2.3 first to stay on the safe side.

gozora commented at 2017-11-15 16:51:

@rmetrich I can't tell nothing less then IMPRESSIVE! ;-)

As i'm not much of a "code reader", I'd need to test this directly by clone and run ...
I will do that over this weekend and you guys know how it went ...


rmetrich commented at 2017-11-18 13:25:

"Sufficiently", did you find issues?


Sent from my phone.

Le 18 nov. 2017 2:05 PM, "Vladimir Gozora" notifications@github.com a
écrit :

@gozora approved this pull request.

I've run several tests, and for me this PR works sufficiently well.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rear/rear/pull/1574#pullrequestreview-77615723, or mute
the thread

gozora commented at 2017-11-18 13:32:

:-), no but I never actually used all those fancy ReaRs networking options and if my network is not up properly, I just configure it manually ;-).
I've found some problems with 320_migrate_network_configuration_files.sh where I got following error:

2017-11-18 11:21:39.162298984 SED_SCRIPT: ';s/08:00:27:2a:4f:0a/08:00:27:76:fa:e7/g;s/eth0/eth0
sed: -e expression #1, char 52: unterminated `s' command

I'm pretty sure that this is not related to your work though.

I've tested your PR in vlan over bonded device and it worked well, and as I did not had time to test it much further I've choose word "Sufficiently" hope you don't mind ;-)


hpannenb commented at 2017-11-27 18:30:

@rmetrich At a RHEL6.5 server with several bridges and bonding interfaces here the ip link command mentions an

bridge: unkown command "stp_state"?

The version in use is "ip utility, iproute2-ss091226".
During recovery the created script /etc/scripts/system-setup.d/60-network-devices.sh thus will not create the bridges here.

rmetrich commented at 2017-11-27 19:17:

@hpannenb Thanks for reporting. I'll test on RHEL6 and adjust.

rmetrich commented at 2017-11-29 10:55:

@hpannenb Please try the latest code.
I reworked many things for "ancient" releases.

hpannenb commented at 2017-11-30 15:04:

@rmetrich I tested with Your pull request #1605 and on the RHEL6 Server the interfaces, bonding and bridges were created as supposed to. Thanks for Your coding effort.

rmetrich commented at 2017-11-30 15:18:

@hpannenb Thanks for feedback. I initially didn't test on RHEL6 because we (Red Hat) do not ship ReaR 2.x on RHEL6 ...

gdha commented at 2018-01-09 10:06:

@rmetrich Could you fix the conflicts then we are able to merge it without issues?

rmetrich commented at 2018-01-09 10:50:

@gdha Done!

gdha commented at 2018-01-16 16:45:

@jsmeix can we merge it?

jsmeix commented at 2018-01-17 08:03:

yes, we can merge it.

jsmeix commented at 2018-01-17 08:09:

many thanks for your substantial contribution to ReaR!

[Export of Github issue for rear/rear.]