No DHCP after installing NS on top of Centos

Come on Giacomo, we know you have nothing to do! :stuck_out_tongue:

Can do this :grinning:

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';
    }
1 Like

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 :yum:

# 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=
1 Like

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.

2 Likes

3 posts were split to a new topic: Chat about Perl fun

Thank you for the effort, the patch has been merged!

Now it comes the hardest part: testing :slight_smile:
We also need to build a new iso to check for regressions.

1 Like

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*  

2 Likes

This is the ISO for testing: http://packages.nethserver.org/6422/nethserver-7.9.2009_issue6422-x86_64.iso

3 Likes

@giacomo

Hi Giacomo

Will try early evening on a VM…

My 2 cents
Andy

1 Like

Thank you! I did a quick test with unattended install and everything seems good :wink:

1 Like

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?

:slight_smile:

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…

1 Like

@djx are you in the position to run a test on a Hetzner VPS?

For you guys - sure :). But I don’t think I can use an ISO, I would just use the install script.

2 Likes

Thank You in advance @djx :+1:

Yes, this is what we are looking for; :grinning:
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 !

@giacomo

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! :slight_smile:

Now to install Centos7 and install Neth over that from (special) repo …

3 Likes

Install went just fine on Hetzner with the steps listed above. :slight_smile:

3 Likes

Thank you (@djx) for testing and the confirmation. :+1:

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… :slight_smile:

2 Likes

Thank you all, I think we verified all test cases!

Great team work and very good fix Mark :clap:

3 Likes