Re: how to change mac address using udev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 18, 2011 at 16:46, Sasha Alko <alkosasha@xxxxxxxxx> wrote:
> Yes I can change MAC manually using ifconfig or other tools. But I
> would like to change MAC automatically when network device is
> attaching. The problem is that I have two RNDIS device which utilize
> the same MAC address. The NetworkManager in Ubuntu is able to change
> MAC automatically based on original MAC. But it is not the case
> because I need to make some checks, e.g. change mac only if first card
> is already attached and do not make anything if no card with RNDIS
> driver is attached.
>
> Udev is operate with MAC address through ATTRS{address} but I didn't
> find how to rewrite this attribute:

Most attributes are not writable. But that doesn't mean the underlying
stuff can't be changed with other interfaces. If calling /sbin/ip ....
works, just call it from udev.

> It seems to me NetworkManager uses libudev to operate with mac, but I
> can't realize how to operate with mac using udev rules.

No, udev is not involved in any specifics of network device setups, or
any other device classes. It can just gather data, create symlinks,
adjust permissions or rename network device names, and call tools it
is asked for to run.

Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux