Ifconfig wlan0 does not show the SSID anymore

Hello,
Since one of the lasts updates the ifconfig wlan0 does not show the Wifi values, esp. noch the SSID:

purism@pureos:~$ uname -a
Linux pureos 6.6.0-1-librem5 #1 SMP PREEMPT Tue Mar 19 03:54:14 EDT 2024 aarch64 GNU/Linux
purism@pureos:~$ ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.178.59  netmask 255.255.255.0  broadcast 192.168.178.255
        inet6 fe80::5da9:724e:cbf8:4428  prefixlen 64  scopeid 0x20<link>
        inet6 fd00::a115:cadc:30b8:4a98  prefixlen 64  scopeid 0x0<global>
        inet6 2001:a61:3437:f901:8d5:6f2:cd75:ae02  prefixlen 64  scopeid 0x0<global>
        ether 00:0e:8e:b1:b7:3c  txqueuelen 1000  (Ethernet)
        RX packets 5929  bytes 469626 (458.6 KiB)
        RX errors 0  dropped 4181  overruns 0  frame 0
        TX packets 822  bytes 114356 (111.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Why is this?

2 Likes

To be honest, I hadn’t noticed that it did but nmcli conn show | grep wlan0 may do the trick

1 Like

Thanks for the workaround, This shows:

purism@pureos:~$ nmcli conn show | grep wlan0
XXXXvisitor                       826000af-5ea7-4b9b-af90-bf5ab51adaba  wifi      wlan0
purism@pureos:~$ ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.49.211.235  netmask 255.255.255.0  broadcast 10.49.211.255
        inet6 fe80::13c8:6d93:a944:3de3  prefixlen 64  scopeid 0x20<link>
        ether 88:da:1a:7c:30:1c  txqueuelen 1000  (Ethernet)
        RX packets 12102  bytes 1831630 (1.7 MiB)
        RX errors 0  dropped 8153  overruns 0  frame 0
        TX packets 1028  bytes 115259 (112.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

But, I would count this a bug in ifconfig. I’ve never seen for years (since Wifi exists in FreeBSD and Linux) an ifconfig not showing the Wifi SSID, etc.

1 Like

That’s odd. For me it is the exact opposite.

For what it’s worth, with the computer I’m sitting on at the moment (not a Librem 5 and not running PureOS and hasn’t had a major version change in 2 years) … ifconfig does not show the SSID. So this is not unique to the Librem 5 or to PureOS.

Maybe there is some option that you enable and I don’t.

1 Like

This is from my FreeBSD laptop:

[guru@c720-1400094 ~]$ uname -a
FreeBSD c720-1400094 14.0-CURRENT FreeBSD 14.0-CURRENT amd64 1400094 #2 main-n264568-1d7ffb373c9d-dirty: Wed Sep  6
07:13:22 CEST 2023     guru@jet:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
[guru@c720-1400094 ~]$ ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=0
        ether 9c:d2:1e:85:72:79
        inet 10.49.211.143 netmask 0xffffff00 broadcast 10.49.211.255
        inet6 fe80::9ed2:1eff:fe85:7279%wlan0 prefixlen 64 scopeid 0x2
        groups: wlan
        ssid XXXXvisitor channel 44 (5220 MHz 11a ht/40+) bssid a2:46:8d:32:bd:cf
        regdomain 108 indoor ecm authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 mcastrate 6
        mgmtrate 6 scanvalid 60 ampdulimit 64k ampdudensity 2 shortgi -uapsd
        wme burst roaming MANUAL
        parent interface: ath0
        media: IEEE 802.11 Wireless Ethernet MCS mode 11na
        status: associated
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

I search a while my mails/posts, but can’t find an example from the L5. I will check at home a recent Ubuntu.

2 Likes

Ubuntu 22.02 shows this:

amjojo@iamjojo:~$ uname -a
Linux iamjojo 6.5.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr  4 14:39:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
iamjojo@iamjojo:~$ ifconfig wlp3s0
wlp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.178.61  netmask 255.255.255.0  broadcast 192.168.178.255
        inet6 2001:a61:3437:f901:77df:fd4a:cd3d:a082  prefixlen 64  scopeid 0x0<global>
        inet6 2001:a61:3437:f901:94ee:b48d:69ad:25ef  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::490d:9fc0:ccb9:67b4  prefixlen 64  scopeid 0x20<link>
        inet6 fd00::1925:1b79:5d42:f482  prefixlen 64  scopeid 0x0<global>
        inet6 fd00::8791:70f0:634a:834f  prefixlen 64  scopeid 0x0<global>
        ether 44:e5:17:04:e3:9a  txqueuelen 1000  (Ethernet)
        RX packets 18224926  bytes 27247300891 (27.2 GB)
        RX errors 0  dropped 9759  overruns 0  frame 0
        TX packets 7453687  bytes 812296970 (812.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
1 Like

Indeed. Ubuntu doesn’t (last few years at least). Raspbian doesn’t (ditto). Apparently PureOS doesn’t. Maybe it’s specific to FreeBSD.

1 Like

I thought ifconfig has been deprecated for years for most Linux distros in favor of the ip command (part of the iproute2 package).

I thought for wlan’s one was supposed to use iwgetid or iwgetid -r instead of grepping an inconsistent/undefined content (and interface names) from other commands.

1 Like

You are right. However the OP asked, so I tried to investigate whether it has really changed.

As far as random grepping goes, a better version of the above command suggested by me would be

nmcli -g 802-11-wireless.ssid conn show $uuid

It depends whether the OP just wanted to see the information (confirm what SSID the device is associated with) or wanted to use it reliably in a script.

Interface names should now be predictable - for those distros that have enabled that option and not overridden it for the given interface. However the problem that this was designed to solve is unlikely to occur on a Librem 5.

2 Likes
purism@pureos:~$ nmcli -g 802-11-wireless.ssid conn show $uuid
Error: invalid field '802-11-wireless.ssid'; allowed fields: NAME,UUID,TYPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,AUTOCONNECT-PRIORITY,READONLY,DBUS-PATH,ACTIVE,DEVICE,STATE,ACTIVE-PATH,SLAVE,FILENAME.

I don’t know if I’d call ifconfig deprecated. It is in any case more easy to use ifconfig wlan0 or if one does not know the name of the interface, just ifconfig -a to verify SSID and IP addr.

1 Like

Sorry, I meant that you have to replace $uuid by the actual UUID (shown with nmcli conn show) or actually set uuid to be that value. e.g.

uuid=`nmcli --fields uuid,type conn show --active | grep wifi | cut -d ' ' -f 1`

assuming that your computer will only have one active WiFi interface at any one time (or one WiFi interface full stop).

2 Likes

Hmm.

purism@pureos:~$ nmcli --fields uuid,type conn show --active | grep wifi
826000af-5ea7-4b9b-af90-bf5ab51adaba  wifi
purism@pureos:~$ nmcli --fields uuid,type conn show --active | grep wifi | cut -d ' ' -f 3
wifi

There are two blanks before wifi :slight_smile:
I stay with the opinion that ifconfig -a (on FreeBSD) is far simpler.

1 Like

Doesn’t matter. The cut command is grabbing field 1, which is why I put the field, uuid, first, so it doesn’t matter how many spaces there are after the UUID. Of course, since a UUID always has the same length, you can just cut the right number of characters if you prefer.

Looks that way - but not if it doesn’t work. :slight_smile:

1 Like

I believe that ifconfig (from net-tools) is no longer installed by default on Debian (Debian 10 and later). Here is an article about 6 deprecated commands: 6 Deprecated Linux Commands and Alternative Tools for Linux . I was surprised to note that scp was in that list. I wasn’t surprised to see arp and route in there (also both replaced by the ip command with “ip neighbor” and “ip route”).

Also … did you fail to note that while ifconfig seems to be giving the SSID on BSD, it isn’t working that way on the Librem 5. That’s part of the problem.

2 Likes

No, I didn’t failed on this. I was sure (I am still sure even if I can’t proof it) that it showed SSID on L5 too in the past.

And, I’d not call the fact that it does so on BSD “part of the problem”, more “part of a solution”.

1 Like

Non-standard output, behavior, and returned error codes is why net-tools like “ipconfig” and “route” became deprecated. They were hard to reliably script.

I don’t know if ifconfig on linux ever produced the SSID — maybe “ifconfig wlan up scan” would have a better chance.

1 Like

Conceptually there may be merit in limiting a tool to one layer in the network stack. In other words, if a tool is mainly concerned with sorting out IP (layer 3 i.e. IP addressing and routing) it should not be concerned with the details of layer 2 (including in the case of WiFi: BSSID, SSID, keys, authentication, encryption, …), never mind about layer 1 (in the case of WiFi: OTA protocol, frequency, transmit power).

So perhaps there is a conflict between purity and convenience.

Is it just me or could this perhaps have been less painfully named? :rofl:

1 Like