ubuntu 24.04, GUI activated hotspot works, nmcli activated doesn't
https://askubuntu.com/questions/1564808/ubuntu-24-04-gui-activated-hotspot-works-nmcli-activated-doesnt
I currently have my laptop (ubuntu 24.04) plugged into an ethernet connection.
In Settings/Wi-Fi, I have it set NOT to auto connect to my local wi-fi.
If I click "Turn on Wi-Fi Hotspot", the hotspot comes up, the dialog shows a QR code for connecting, and the hotspot has a name which matches my machine name (lets call that my-sys).
If I look at my phone, I see a connection for my-sys and can connect to it.
I can turn that connection on and off from the command line using:
nmcli con up Hotspot
nmcli con down Hotspot
If I try
nmcli con up my-sys
it says "unknown connection my-sys"
ok so far, although a bit confusing.
If I try to set up a separate wi-fi connection name:
nmcli con add type wifi ifname "wlp170s0" con-name "my-hotspot" autoconnect no ssid "my-hotspot"
nmcli con modify "my-hotspot" 802-11-wireless.mode ap ipv4.method shared
nmcli con modify "my-hotspot" wifi-sec-key-mgmt wpa-psk
nmcli con modify "my-hotspot" wifi-sec.psk "my-pw"
nmcli con up "my-hotspot"
The connection appears to come up:
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/35)
If the Settings/Wi-Fi window is showing, the hotspot active QR code shows with the disconnect button, and "my-hotspot" shows as the network name, etc.
However, there is no signal (no bars on my phone), and my phone does not see the network.
If I do "nmcli con show my-hotspot" and compare that with the results of the default Hotspot started from the Settings screen, there are two main differences. First, the default Hotspot has 3 sets of parameters listed, while my-hotspot has only one set. Second, the only thing that stands out are these three lines:
my-hotspot Hotspot
802-11-wireliss-security.proto: -- rsn
802-11-wireliss-security.pairwise: -- ccmp
802-11-wireliss-security.group: -- ccmp
I tried setting those and it made no difference.
Here's the output of nmcli con show my-hotspot:
connection.id: my-hotspot
connection.uuid: bbacbcd1-48eb-4d9a-a42e-79ce308fc0dc
connection.stable-id: --
connection.type: 802-11-wireless
connection.interface-name: wlp170s0
connection.autoconnect: no
connection.autoconnect-priority: 0
connection.autoconnect-retries: -1 (default)
connection.multi-connect: 0 (default)
connection.auth-retries: -1
connection.timestamp: 1773465934
connection.permissions: --
connection.zone: --
connection.controller: --
connection.master: --
connection.slave-type: --
connection.port-type: --
connection.autoconnect-slaves: -1 (default)
connection.autoconnect-ports: -1 (default)
connection.secondaries: --
connection.gateway-ping-timeout: 0
connection.metered: unknown
connection.lldp: default
connection.mdns: -1 (default)
connection.llmnr: -1 (default)
connection.dns-over-tls: -1 (default)
connection.mptcp-flags: 0x0 (default)
connection.wait-device-timeout: -1
connection.wait-activation-delay: -1
802-11-wireless.ssid: my-hotspot
802-11-wireless.mode: ap
802-11-wireless.band: --
802-11-wireless.channel: 0
802-11-wireless.bssid: --
802-11-wireless.mac-address: --
802-11-wireless.cloned-mac-address: --
802-11-wireless.generate-mac-address-mask:--
802-11-wireless.mac-address-blacklist: --
802-11-wireless.mac-address-randomization:default
802-11-wireless.mtu: auto
802-11-wireless.seen-bssids: 4C:77:CB:1E:68:E2
802-11-wireless.hidden: no
802-11-wireless.powersave: 0 (default)
802-11-wireless.wake-on-wlan: 0x1 (default)
802-11-wireless.ap-isolation: -1 (default)
802-11-wireless-security.key-mgmt: wpa-psk
802-11-wireless-security.wep-tx-keyidx: 0
802-11-wireless-security.auth-alg: --
802-11-wireless-security.proto: rsn
802-11-wireless-security.pairwise: ccmp
802-11-wireless-security.group: ccmp
802-11-wireless-security.pmf: 0 (default)
802-11-wireless-security.leap-username: --
802-11-wireless-security.wep-key0: <hidden>
802-11-wireless-security.wep-key1: <hidden>
802-11-wireless-security.wep-key2: <hidden>
802-11-wireless-security.wep-key3: <hidden>
802-11-wireless-security.wep-key-flags: 0 (none)
802-11-wireless-security.wep-key-type: unknown
802-11-wireless-security.psk: <hidden>
802-11-wireless-security.psk-flags: 0 (none)
802-11-wireless-security.leap-password: <hidden>
802-11-wireless-security.leap-password-flags:0 (none)
802-11-wireless-security.wps-method: 0x0 (default)
802-11-wireless-security.fils: 0 (default)
ipv4.method: shared
ipv4.dns: --
ipv4.dns-search: --
ipv4.dns-options: --
ipv4.dns-priority: 0
ipv4.addresses: --
ipv4.gateway: --
ipv4.routes: --
ipv4.route-metric: -1
ipv4.route-table: 0 (unspec)
ipv4.routing-rules: --
ipv4.replace-local-rule: -1 (default)
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-iaid: --
ipv4.dhcp-dscp: --
ipv4.dhcp-timeout: 0 (default)
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.dhcp-hostname-flags: 0x0 (none)
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.required-timeout: -1 (default)
ipv4.dad-timeout: -1 (default)
ipv4.dhcp-vendor-class-identifier: --
ipv4.link-local: 0 (default)
ipv4.dhcp-reject-servers: --
ipv4.auto-route-ext-gw: -1 (default)
ipv6.method: auto
ipv6.dns: --
ipv6.dns-search: --
ipv6.dns-options: --
ipv6.dns-priority: 0
ipv6.addresses: --
ipv6.gateway: --
ipv6.routes: --
ipv6.route-metric: -1
ipv6.route-table: 0 (unspec)
ipv6.routing-rules: --
ipv6.replace-local-rule: -1 (default)
ipv6.ignore-auto-routes: no
ipv6.ignore-auto-dns: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.required-timeout: -1 (default)
ipv6.ip6-privacy: -1 (unknown)
ipv6.addr-gen-mode: default
ipv6.ra-timeout: 0 (default)
ipv6.mtu: auto
ipv6.dhcp-pd-hint: --
ipv6.dhcp-duid: --
ipv6.dhcp-iaid: --
ipv6.dhcp-timeout: 0 (default)
ipv6.dhcp-send-hostname: yes
ipv6.dhcp-hostname: --
ipv6.dhcp-hostname-flags: 0x0 (none)
ipv6.auto-route-ext-gw: -1 (default)
ipv6.token: --
proxy.method: none
proxy.browser-only: no
proxy.pac-url: --
proxy.pac-script: --
GENERAL.NAME: my-hotspot
GENERAL.UUID: bbacbcd1-48eb-4d9a-a42e-79ce308fc0dc
GENERAL.DEVICES: wlp170s0
GENERAL.IP-IFACE: wlp170s0
GENERAL.STATE: activated
GENERAL.DEFAULT: no
GENERAL.DEFAULT6: no
GENERAL.SPEC-OBJECT: /org/freedesktop/NetworkManager/AccessPoint/77
GENERAL.VPN: no
GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnection/42
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/Settings/38
GENERAL.ZONE: --
GENERAL.MASTER-PATH: --
IP4.ADDRESS[1]: 10.42.0.1/24
IP4.GATEWAY: --
IP4.ROUTE[1]: dst = 10.42.0.0/24, nh = 0.0.0.0, mt = 600
IP6.ADDRESS[1]: fe80::bb85:5d09:86af:2468/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 1024
So, why isn't the named hotspot broadcasting?