I want to set up a Raspberry Pi wireless AP. I downloaded the Ubuntu image for Raspberry Pi (server), wrote the image to a microSD card, then put it into my Pi 3B+. Ubuntu boots up just fine, so far so good, except...
$ ip link
1: lo: ...
....
2: eth0: ...
....
3: wlan0: ...
....
I found it strange because I thought Ubuntu adopted predictable network interface names a long time ago. I want to use predictable names, because I don't want any software (especially hostapd-related) to break due to the interface name change (which is likelier because I plan to add the USB Ethernet adapter later).
After some search and then a friend's help, I found out that
$ cat /proc/cmdline
... net.ifnames=0 ...
... was the problem, but couldn't find what software/configuration exactly was setting that value. It's usually the GRUB config, but Ubuntu for Raspberry Pi doesn't use GRUB.
So I simply searched the entire filesystem for net\.ifnames
and figured it was /boot/firmware/cmdline.txt
:
net.ifnames=0 dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc
So it seems this is preventing the kernel to adopt the modern concept. I changed it to net.ifnames=1
and rebooted. Now, this is what I get:
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 …
link/loopback …
2: enx************: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 …
link/ether …
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 …
link/ether …
… which leaves me two questions:
- The wired interface name is "
enx************
" where ************
is the network interface MAC address. This would surely be predictable, but not helpful at all. It's too long and nearly impossible to memorize. Can I change it to the form of "enp5s0"?
- "wlan0" is still "wlan0." Can I fix this?
I tried adding biosdevname=1
next to net.ifnames=1
but it had no effect.