Server has no local IP address, does not appear in LAN list in router

My YunoHost server

Hardware: Lenovo ThinkCentre M720q
YunoHost version: 11.0.9 (amd64, stable)
I have access to my server : Direct access via keyboard and screen
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

I am having a very similar issue to the one described in this thread.

I have just installed Yunohost on a new server, and when booting up immediately after installation, it takes me to the command-line interface (CLI). So far, so good.
Normally, at this point, I am able to go to yunohost.local via a web browser on a separate machine and log in to the admin portal to complete post-installation. However, at the moment, I cannot do this.

Logging in to the CLI using root and yunohost as username and password, and running hostname -I to find my local IP address returns an empty line:

$ hostname -I

$

Below, I attach the output from the commands as recommended by tituspijean in that other thread. I am typing all of this by hand – there may be typing errors.

First: ip a

$ ip a
1: lo: <LOOPBACK,UP,LOWER,UP> mtu 65586 qdisc moqueue 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: eno1 <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether e8:6a:64:9e:c2:eb brd ff:ff:ff:ff:ff:ff
    altname enp0s31f6
3: wlp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether f4:d1:08:89:b1:88 brd ff:ff:ff:ff:ff:ff

Second: cat /etc/network/interfaces

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

There are no other commented-out sections here – I notice the original poster of the other thread had sections called # The primary network interface and # This is an autoconfigured IPv6 interface. I don’t.


Third: ls /etc/network/interfaces.d

$ ls /etc/network/interfaces.d
$

This matches the output that the other thread’s OP got.


Fourth: cat /etc/network/interfaces.d/*

$ cat /etc/network/interfaces.d/*
cat: '/etc/network/interfaces.d/*': No such file or directory

This matches the output that the other thread’s OP got.


Tituspijean recommended that the OP edit /etc/network/interfaces so that it contained the ethernet network that was appearing in their result of ip a, replacing another one that was in there by mistake.
However, I am really unfamiliar with how this config file works, and I want mine to run on the Wifi rather than an ethernet cable. Without knowing how the other thread’s OP’s instances file looked when it corrected the issue, I am really unsure about how mine should look.

Can anyone shed some light, please?

Both interfaces are “down”

Maybe you need to “up” them but honestly network is configured automagically on any new recent system when it’s available and personally i would just double-check that your network cable is correctly plugged and that the network cable is not faulty in any way

The installation happened entirely over Wifi – no network cables (between the router and the server) were involved. Despite having an internet connection during installation, the server has no LAN IP address and the router can’t “see” it.
I have tried turning my server off, connecting it to the router via an ethernet cable, and booting it back up again, but the issue remains.

Hmokay but then how did you configure WiFi in the first place …?

The graphical installation asked me to supply the ESSID and password for my wifi, and it did the rest. The server has a wifi card built in.

I am trying some of the commands here (namely ip link set wlp1s0 up) to see if I can bring the wifi interface up, but no matter how many times I reboot or restart the network interface, it’s still stuck on “DOWN”.

I have tried adding wlps10 to my /etc/network/interfaces so it looks like this (below), but I have absolutely no idea if this is right:

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug wlp1s0
iface inet dhcp wlp1s0
# This is an autoconfigured IPv6 interface
iface inet6 auto wlp1s0

Here I have added by hand everything from # The primary network interface downwards. I’ve done it like this to match what I saw in that other thread.

Did you try to connect with Wifi via terminal? Maybe try some commands like here or here

Agree that the best way to investigate would be to get to a terminal and see what messages you are getting. Maybe first thing first, double check that the wifi device is handled by kernel with something like
sudo lshw -C network | grep -B 1 -A 12 'Wireless interface'

After that, rfkill is the first one to check that wifi is not blocked in any way. Then tools like iw or iwconfig to check what’s going on with the wifi, then nmcli to check the status, connectivity etc.
these commands provide feedback / error messages.

Debian used not to include WiFi firmware in their installer, offering to add it during install via an USB stick or other removable media.

I remember a while back the installer started to come with the somewhat free-ish distributable firmwares included.

I guess the Lenovo machine has an Intel card built in. The firmwares themselves are in the non-free repository though, and without having non-free enabled, the firmware that was available in the installation session, is not installed by default.

With Yunohost running on Free software, non-free is not enabled by default. Hardly anyone would notice, as people are not encouraged to run their servers on a wireless connection. Yes, it works, but it also complicates troubleshooting (as evident in this thread :stuck_out_tongue: )

  • My first suggestion would be to check whether a firmware has (quietly) been installed, and whether your Linux asks about a firmware during boot:
$ dmesg | grep irmware

(My grepping is limited, and I’m not sure whether it’ll list Firmware or firmware)

  • secondly, in case the firmware is indeed missing, check whether the non-free repository is enabled:
$ cat /etc/apt/sources.list |grep non
  • thirdly, in addition to cocoyuno’s suggestions or even before that: connect the machine via ethernet cable to verify that networking comes up in the first place. I can’t imagine it does not, but it is an easy way to verify that not the whole network stack got corrupted.

Good luck!

edit: is this the same machine / continuation of your post IP address requested when installing, configuring network yesterday, where you did not get an IP during install?

1 Like

Thank you all for you replies.

Firstly, in response to @cichy1173 and @cocoyuno, I tried these commands on their own (with no arguments) and they all returned the “command not found” error message:
lshw
rfkill
iw
iwconfig
nmcli

@wbk: dmesg was found, and when the results were passed through grep irmware it returned results for iwlwifi among others:

[2.829740] iwlwifi 0000:01:00.0: firmware: direct loading firmware iwlwifi-8265-36.ucode
[2.890268] iwlwifi 0000:01:00.0: loaded firmware version 36.ad812ee0.0 8265-36.ucode op_mode iwlmvm
[2.830283] iwlwifi 0000:01:00.0: firmware: failed to load iwl-debug-yoyo.bin

I’m starting to wonder whether reinstalling while attached to the router via ethernet cable would be better, but I tried this previously and had issues with the installer requiring me to tell it what private IP address to use, then not being able to locate (or connect to the internet to locate) the Debian repositories when installing apt. This may have been due to my router’s DNS settings, as I had custom primary and secondary DNS addresses set up. These were taken out and restored to defaults before I tried it over wifi, so it may be worth another try.

Yes, it is – that was while attempting to install over ethernet cable but with custom DNS addresses recorded in my router. They were taken out and may have been why the installation over wifi was smoother… perhaps.

That’s actually normal in Debian, because Debian has pretty minimal set of tools. Try this: take your phone and connect it to computer with USB and turn on hotspot and USB tethering in smartphone. Your computer should gain access to internet thanks to smartphone acting like a internet modem. Then install these tools (with sudo apt install <package>) and then connect it to WiFi using installed tools just like in linked tutorials.

Edit: If smartphone tethering will not work, connect computer to Ethernet in router, install these tools and then connect via WiFi.

Well, I have tried both – with an Ethernet cable and via mobile tethering – and in both cases, apt cannot “find” the repo sources because the server isn’t connecting to the internet.

I don’t know if this is due to my router or something going on (or not) in the server. I also don’t know if reinstalling the whole thing would solve anything, especially if it’s my router that’s at fault.

But Did you switch to mobile data on smartphone when you turned on tethering?

Also check this: Ethernet not working on cloned Debian 11 with Yunohost - #6 by cichy1173

Success! I knew that editing /etc/network/interfaces was important but I just couldn’t find an explanation anywhere that clarified the file’s syntax or what each of the short “words” in it meant. Then I found this page on the Debian wiki (specifically step 4, ‘Using DHCP to automatically configure the interface’) and that helped a great deal.

I knew from ls /sys/class/net that my available network interfaces were
eno1 lo wlp1s0
…where eno1 is the ethernet. (I did all of this with an ethernet cable plugged in.)

So I opened /etc/network/interfaces in nano, and edited it both to look like step 4 on the Debian wiki but replaced their example eth0 with my eno1:

$ nano /etc/network/interfaces    # Some text removed to show the important bits
auto eno1
allow-hotplug eno1
iface eno1 inet dhcp
iface eno1 inet6 auto

If I remember correctly, inet is IPv4, so I put dhcp on the end of that line to allow it to allocate a private IP address for my server by itself.
I included inet6 (IPv6) and auto for good measure, I doubt I’m going to use anything on IPv6.

Now, when I type hostname -I I get an IP address!

$ hostname -I
192.168.0.112

I cannot view the admin login page via yunohost.local on a separate device, but I can view it when I type 192.168.0.112 into the browser instead, so I consider that success. :slight_smile: I have rebooted several times, and it all persists across sessions, so that’s good.
I did not need to install lshw rfkill iw or any of those other programs after all, but trying to do so indicated to me that the internet connection was working.

I’m going to keep it connected to the router via ethernet cable, as it seems that’s what Yunohost “prefers” instead of wi-fi.

Thank you everyone for your help. :slight_smile:

2 Likes

Great :slight_smile:

Thanks for posting how the solution to your problem works!

For the record: any network connection that is stable, will work. In practice, that almost always means that a cable is preferable over wireless for any server (with 2.4 GHz WiFi your server could be offline everyday before dinner without any way to find out the cause, until you speak with your neighbours and hear that they use their microwave for cooking every day since they read that it uses much less energy than a gas stove, as a long-winded example :stuck_out_tongue: )

Have fun with your server!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.