3G Modem MC8805:qmicli succesfuly connected but no IP after dhclient
Bjørn Mork
bjorn at mork.no
Mon Nov 9 08:02:24 PST 2015
Benoît <benoitne at gmail.com> writes:
> Just a little one do you know if there is any udev rule I can append
> to your command
> (SUBSYSTEM=="usb",ATTR{idVendor}=="413c",ATTR{idProduct}=="81a3",ATTR{bConfigurationValue}=="2"
> ATTR{bConfigurationValue}="1")
> to fix the MAC Address of the interface?
Something like this should do it:
SUBSYSTEM=="net",ACTION=="add",ATTRS{idVendor}=="413c",ATTRS{idProduct}=="81a3",RUN+="/sbin/ip link set %k address 02:00:de:ad:be:ef"
Adjust the path of "ip" if different. And the mac address of course :)
> In fact I figured out that everytime I poweroff my system a new MAC is
> generated randomly :(
Yup, a random mac is generated every time you reload usbnet.ko. This is
used if we can't read a mac from a CDC ether descriptor, which we
usually can't for QMI devices.
> I would love to fix one as soon as the interface is shown to the
> system and I think udev is the right place but I don't have the right
> attribute (I know the one to fix the name but unfortunately it is
> based on MAC..)
The mac address attribute isn't writable, so you have to use netlink to
change it.
Just out of curiousity: Why does the mac address matter to you? It's a
fake address used solely on the USB link between the modem and the
host. It has no meaning outside this link. Or it should not have,
AFAIK.
(except of course if you try to bridge the netdev, but then you probably
have to do some more mangling)
Bjørn
More information about the libqmi-devel
mailing list