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.

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]
  • Thanks! Could you explicit the last paragraph please? – hartmut Dec 3 '18 at 8:34
  • @hartmut Yes. I extended the answer. Please note that I did not test this exact configuration myself. – Hermann Dec 4 '18 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.