Come on Giacomo, we know you have nothing to do!
Can do this
what about an defensive (a bit dirty) improvement: (add || $end =~ 'dynamic'
)
if ($dhclient_running || $dynamic =~ 'dynamic' || $end =~ 'dynamic' ) {
$props{'bootproto'} = 'dhcp';
$props{'gateway'} = '';
} else {
$props{'bootproto'} = 'none';
}
can confirm this solves it on my Centos VM, before system-init edited
# cat /etc/e-smith/events/actions/nethserver-base-initialize-db | grep -5 'dynamic'
# Note: command returns empty output if interface is DOWN:
open(ADDR, '-|', "ip -o -4 address show dev $ifname");
while(<ADDR>) {
chomp;
my($id, $dev, $family, $cidr, $brd_family, $brd_address, $scope_lbl, $scope, $dynamic, $end) = split(/\s+/, $_, 10);
my $dhclient_running = (system("ps -A -o cmd | grep -E '(/| )dhclient .' | grep -q $ifname") == 0);
if ($dhclient_running || $dynamic =~ 'dynamic' || $end =~ 'dynamic') {
$props{'bootproto'} = 'dhcp';
$props{'gateway'} = '';
} else {
$props{'bootproto'} = 'none';
}
Have a dhcp setup after system-init
# db networks show
eth0=ethernet
bootproto=dhcp
gateway=
ipaddr=10.0.0.158
netmask=255.255.255.0
role=green
ppp0=xdsl-disabled
AuthType=auto
FwInBandwidth=
FwOutBandwidth=
Password=
name=PPPoE
provider=xDSL provider
role=red
user=
EDIT:
It does not break if network is brought up without NM and noprefixroute is not added to the interface:
# ip -o -4 address show dev eth0
2: eth0 inet 10.0.0.158/24 brd 10.0.0.255 scope global dynamic eth0\ valid_lft 86067sec preferred_lft 86067sec
# db networks show
eth0=ethernet
bootproto=dhcp
gateway=
ipaddr=10.0.0.158
netmask=255.255.255.0
role=green
ppp0=xdsl-disabled
AuthType=auto
FwInBandwidth=
FwOutBandwidth=
Password=
name=PPPoE
provider=xDSL provider
role=red
user=
ROTFL
another test in the Centos VM;
without NM fixed IP:
ip -o -4 address show dev eth0
2: eth0 inet 10.0.0.158/24 brd 10.0.0.255 scope global eth0\ valid_lft forever preferred_lft forever
# db networks show
eth0=ethernet
bootproto=none
gateway=10.0.0.100
ipaddr=10.0.0.158
netmask=255.255.255.0
role=green
ppp0=xdsl-disabled
AuthType=auto
FwInBandwidth=
FwOutBandwidth=
Password=
name=PPPoE
provider=xDSL provider
role=red
user=
Results in a correct FIXED IP configuration.
IMO it is pretty safe to say adding || $end =~ 'dynamic'
mitigates NM/DHCP behavior and does not break other network configurations.
Thank you for the effort, the patch has been merged!
Now it comes the hardest part: testing
We also need to build a new iso to check for regressions.
Tip for those who want to help with testing,
before running nethserver-install on your CentOS test-setup edit
/etc/yum.repos.d/NethServer.repo
enable nethserver-testing (enabled=1
) only for nethserver-base (includepkgs=nethserver-base*
):
...
[nethserver-testing]
name=NethServer-$releasever - Testing
mirrorlist=http://mirrorlist.nethserver.org/?release=$releasever&repo=testing&arch=$basearch&nsrelease=$nsrelease
#baseurl=http://mirror.nethserver.org/nethserver/$releasever/testing/$basearch/
gpgcheck=1
repo_gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-NethServer-$releasever
enabled=1
enablegroups=0
includepkgs=nethserver-base*
…
This is the ISO for testing: http://packages.nethserver.org/6422/nethserver-7.9.2009_issue6422-x86_64.iso
Thank you! I did a quick test with unattended install and everything seems good
Just downloaded Centos 7.9.2009 ISO from CERN - in my NAS I still had 7.8.2003…
The NethServer ISO is supposed to be installed on top of Centos 7.9.2009, isn’t it?
have a look at issue tracker, you will find different test cases,
Regarding the ISO for testing you’ll need to use the special-testing one @giacomo linked above…
For you guys - sure :). But I don’t think I can use an ISO, I would just use the install script.
Thank You in advance @djx
Yes, this is what we are looking for;
do as you used to do except before running nethserver-install
edit /etc/yum.repos.d/NethServer.repo
as I tried to explain above
This will install a (testing) nethserver-base
package which should address the network issue you experienced lately.
If you have questions, just ask !
Hi Giacomo
I can confirm that the CD / ISO works as expected in a DHCP environment doing minimal settings at setup. Only Keyboard and root password were set…
All working as expected with Test-ISO
My 2 Cents
Andy
IP showed on DHCP server (OPNsense) after installation:
Login works
Console also shows IP:
After login to cockpit:
All as expected!
Now to install Centos7 and install Neth over that from (special) repo …
Install went just fine on Hetzner with the steps listed above.
Thank you (@djx) for testing and the confirmation.
Your post triggered me to dig in to this.
Experienced issues with creation of (Raspberry PI) arm-images for nethserver,
thought it was specific to arm. Turns out not to be so…
Thank you all, I think we verified all test cases!
Great team work and very good fix Mark