0

I have an inbuilt network card and a Wi-Fi dongle.

I use wpa_supplicant, hostapd and the likes to operate them.

The trouble is that sometimes the dongle is wlan0, and sometimes it is wlan1 (likewise for the inbuilt network card of course): so I never know whether "wlan0" is the dongle or the inbuilt card. The association wlanX <-> hardware appears completely random to me.

What is the command line to see, for a specific interface (wlan0 for instance), what hardware it corresponds to?

Alternatively, how to make sure a specific hardware (the dongle say) is always designated by a same interface (wlan0 say)?

Not being able to discriminate between these two hardware is a real problem because my dongle does not support the AP mode for instance.

hartmut
  • 101
  • This solved it for me (on Raspbian Stretch): https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=198946. More tricky that it seems. – hartmut Dec 03 '18 at 10:57

1 Answers1

1

The device names are "unstable" since the numbers are assigned on boot based on whichever device answers first during enumeration. As you observed, depending on the hardware set-up, this may be random.

You should consider enabling systemd's persistent network interfaces. Alternatively, you can manually configure udev to assign a custom device name via 70-persistent-net.rules

As for configuring the network itself, using netplan may (in case you use Ubuntu 17.04 or newer) applicable, too. The access point's interface is usually either part of a bridge (network level 2) or statically configured (network level 3, client's data needs to be routed). According to the examples, a static configuration with netplan looks like this:

network:
  version: 2
  renderer: networkd
  wifis:
    wlp2s0b1:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.1.1/24]
Hermann
  • 6,148