How can I find a list of wifi interfaces that could be used by hostapd?
This doesn't work - I don't see my wifi interfaces listed:
☀ cat /etc/network/interfaces NewMod master
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopbackThis kind of works - but I can't see which are wireless (except they start with wl)
☀ ifconfig NewMod master
enp2s0f1 Link encap:Ethernet HWaddr 80:fa:5b:47:d3:a2 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
enx803f5d0cfb18 Link encap:Ethernet HWaddr 80:3f:5d:0c:fb:18 inet6 addr: fe80::c00b:310a:534f:34ea/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1038940 errors:0 dropped:0 overruns:0 frame:0 TX packets:733216 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1257594637 (1.2 GB) TX bytes:78531977 (78.5 MB)
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:237623 errors:0 dropped:0 overruns:0 frame:0 TX packets:237623 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:20683739 (20.6 MB) TX bytes:20683739 (20.6 MB)
wlp3s0 Link encap:Ethernet HWaddr b0:35:9f:2d:42:27 inet addr:192.168.0.18 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::6b44:ffcf:8889:7f3d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:8681955 errors:0 dropped:0 overruns:0 frame:0 TX packets:4304922 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:10401603438 (10.4 GB) TX bytes:598603222 (598.6 MB)
wlxc4e984116e78 Link encap:Ethernet HWaddr c4:e9:84:11:6e:78 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)Is there a better way than assuming interfaces starting with "wl" are wifi?
Bonus points for a quick explanation of why they don't show up in /etc/network/interfaces. For these extra interfaces, do they have reliable names between reboots?
Basically I want to provide a list of interfaces so someone can choose which to hostapd with.
Thanks!
Mike
12 Answers
You can use iwconfig but iwconfig is depricated.
Now way is this:
iw dev | grep -Po '^\sInterface\s\K.*$' 1 Look at inet address. Only device here that might be working wireless is wlp3s0. Others do not have external ipv4 address.
Also look the hardware address . Compare with output from other system descriptors like lspci.