:: Re: [DNG] My Qemu LAN-peer document…
Top Pagina
Delete this message
Reply to this message
Auteur: Ralph Ronnquist
Datum:  
Aan: dng
Onderwerp: Re: [DNG] My Qemu LAN-peer documentation is now in its first draft
Of course the code was wrong; I've corrected it below...

On 03/03 19:24, Ralph Ronnquist wrote:
> On 03/03 01:06, Steve Litt wrote:
> >
> > Am I hearing correctly when I think you two are saying I can make
> > multiple network devices have determinate names (even if I don't select
> > those names) by doing something with their MAC addresses? If so, how do
> > I do it?
>
> Since you do networking setup via a script you can do this at the top
> of that script before the interfaces are configured. Something like
> the following:
> --------------------
> for IF in $(ls /sys/class/net) ; do
>     case "$(ip link show $IF | awk '$1=="link/ether" {print $2;}')" in
>         4a:4a:8d:dc:d4:bf)

         ip link set $IF name somewhatspecial

>         ;;
>     06:22:66:ff:5a:e2)

         ip link set $IF name veryspecial

>         ;;
>     esac
> done
> --------------------
> where you choose your own MAC addresses as case patterns and your own
> names instead of the ${blah}special .. anything unused less than 16
> 7-bit ascii is fine.

>
> That loop only works for unconfigured, "down" interfaces. In
> particular, when interfaces are configured during boot, then the
> renaming should occur before that configuration.
>
> If configuration is via hotplug handling than the hotplug handling
> would provide the enumeration, and one only need have to define the
> recognition-to-action "rules" and make sure they are used before
> confguration.
>
> Ralph.