1 issue and 1 question related to Wi-Fi

  1. Issue.
    After laptop boot I use NetworkManager to enable wi-fi hotspot (LAN cable plugged in). Using smartphone to connect.
    The phone says that network is without internet access, which is true from it’s side, but internet access on laptop is completely ok.
    Re-enabling wi-fi, re-plugging cable, restarting NetworkManager - all have no effect. Firewall (ufw) is inactive.
    I found only few workarounds to make it work. Which I don’t like at all, but they may lead to the source of issue.
    • Setting hotspot connection to auto-connect with priority -999 and system must boot with this config. It will connect automatically on start and will work.
    • Activate and de-activate firewall - magically internet connection appears on the phone in few seconds and works until system rebootWhat’s going on and how to fix it?
    • Using SysVinit, but it causes issues described here
  2. Question.
    Currently my system is suspending when lid is closed which I am completely ok with.
    But is there a way to exlcude NetworkManager(and all stack required for cable connection + hotspot wi-fi to work) from suspending, so when I enable wi-fi hotspot it will live regardless of system suspend?
    For now network dies completely on suspend, and wi-fi powersave (as some goo) option has no effect (for both TLP and NetworkManager in default-wifi-powersave-on.conf).
    If it’s completely impossible - then is there any other way to do such? (Suspended system + wi-fi hotspot).

Thanks for your attention.

Some system info:

HP EliteBook 655 15.6 inch G10
Kernel: 6.6.11-amd64 [6.6.11-1~mx23ahs] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
Desktop: GNOME v: 43.9 wm: gnome-shell dm: GDM3 v: 43.0 Distro: MX-23.3_ahs_x64 Libretto July 31 2023 base: Debian GNU/Linux 12 (bookworm)

Network:
Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard
driver: r8169
Device-2: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter vendor: Foxconn driver: mt7921e

Hotspot works fine in Fedora with firewalld, so it looks like a distro-specific problem.
This means you need to solve it with the developers of your distribution, or try to change the firewall appliance, or use a different distribution where hotspot just works, etc.

Suspending cannot be selective, so you need to make it ignore the relevant events:

sudo tee /etc/dconf/db/local.d/00-local << EOF > /dev/null
[org/gnome/settings-daemon/plugins/power]
sleep-inactive-ac-type='nothing'
EOF
sudo dconf update
sudo tee /etc/systemd/logind.conf << EOF > /dev/null
[Login]
HandleLidSwitch=ignore
EOF
sudo systemctl restart systemd-logind.service

Is that possible disabled firewall may cause anything? Btw completely removing firewall had no effect on the issue. More likely that some side effects of “enable-disable” sequence (immidiately start to work on disable action) are the answer.
Will try to reproduce on clean distro anyway.

So that means just disabling suspend on lid closed?
Then are there any other (additional to what for example TLP can do) ways to save power when lid closed or screen blank?