Disable predictable network interface names

custom_board

#1

Hello folks,

Hardware: 6309 SBC.
OS: Linaro

I want to be able to set the ethernet port between a static ip or dhcp. To do this, I presume I would need the interface name. The tricky part is this is intended to be a part of an image that will be written to multiple boards.
I don’t want to manually tweak something on each install.

Before predictable naming, I could address interface ‘eth0’ and that would stay constant on all boards, but now with predictable naming, I believe it is depends on the hardware and can be different between boards.

I had some questions:

  1. On regular amd64 distribution of debian, there are ways to do this using GRUB flags etc. Is there an equivalent on Linaro?
  1. Since this is such a common use case, is there a recommended way of finding/using the name for network interfaces on systems using predictable network interfaces? Perhaps I don’t even need to know the name?

  2. If I dd the same image onto multiple boards, will the ethernet portname stay the same on all the boards, or will Linaro rename them on boot. This doesn’t sound right but just throwing it out there in case someone could comment on it.

  3. On a single system, I would do this by finding the hwid/interface name manually, and perhaps modifying a udev rule. But if I want this to be done on multiple machines, without manually trying to find each id, what options do I have?

  4. Is there a udev rule that I can write that let’s linaro fall back to the old naming scheme (by forcing it to use scheme 5 as mentioned in the previous link.)

Apologies if I’m missing something obvious.

Would really appreciate any help!

Thank you.


#2

“Linaro” is not an OS. The OS is still Debian. What you have is a Debian image with a BSP for Dragonboard 410C pre-integrated by the Qualcomm Landing Team at Linaro.

All the Debian techniques w.r.t. to predictable naming should work as normal however, since all our images include Network Manager, I’d suggest you interact at that level. You can either get users to interact with nm-applet as normal or, if you are developing a custom UI, your code can interact directly with nmcli: https://developer.gnome.org/NetworkManager/stable/nmcli.html .


#3

Thank you @danielt.

I’ll take a closer look at nmcli.

If I wanted to disable the predictable naming , one of the recommended options mentions editing boot flags in grub config. Do you know if there is an equivalent way for Linaro?

I tried linking udev rules to dev/null but that didn’t seem to help.

While booting, I can see the line renaming this: smsc75xx 1-1.3:1.0 en99999999: renamed from eth0.


#4

nmcli seems promising.

I’m wondering if its better to write out my network preferences to /etc/network/interfaces at all, or just use nmcli to set them.

EDIT: Unless I’m misunderstanding, writing out an /etc/network/interfaces file while disable that interface from being controlled by nmcli. Please do correct me if I’m wrong.

EDIT2: Looks like editing the /etc/network/interfaces file takes away the control from the network manager (as mentioned in the docs), but nmcli STILL does report information about it (albeit with an ‘unmanaged’ tag). I was curious because the help description on nmcli mention d[evice] devices managed by NetworkManager.


#5

Hey @danielt, looks like I can achieve what I need by using nmcli.

As an aside, could you or someone more familiar with nmcli than me comment on whether it is possible to query for the ip address of the ethernet port using nmcli? Or should I just grab the response and parse it out in my application?

Example:

nmcli -f ip4.address,general.type device show shows me a table of all ipv4 addresses and the types of the interfaces.

Can I query nmcli, something like
nmcli -f ip4.address device show (where general.type=='ethernet')

Thanks.


#6

Glad you can work with nmcli.

I don’t know if there is a better way to do it but I’d probably just
parse the output of your first example command.


#7

It’s still not “Linaro”, and especially so for the way DB410C handles the kernel command line. Our images tend use whatever the bootloader gives us!

If you look in the partition table there is a partition called boot. It is abootimg format (Android boot image) and includes the kernel command line. It can be updated using the Android tools… just give them the boot partition as a filename.

Daniel.


#8

Thanks for your help Daniel.