Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-05 Thread Tom Gundersen
On Fri, Dec 5, 2014 at 2:21 PM, Lennart Poettering
 wrote:
> On Fri, 05.12.14 10:07, Marcel Holtmann (mar...@holtmann.org) wrote:
>
>> Hi Lennart,
>>
>>  Moreover, if we
>>  give people this feature I'm pretty sure we'll get lots of people
>>  expecting it to work also for any other sort of name and getting
>>  confused when it doesn't.
>> >>>
>> >>> Well, this is something we can fix by documentation, no?
>> >>>
>> >>> Or maybe name the match option differently, maybe OriginalName= or
>> >>> KernelName= or so, and then only matching interfaces where you know
>> >>> that the name was selected by userspace in the first place?
>> >>
>> >> I like the idea of OriginalName, much less likely to get people
>> >> confused. I now implemented that, with the restriction that we cannot
>> >> match on renamed names. For now I left it open to match on ethX style
>> >> names, as people in principle could do sensible things like
>> >> "OriginalName=eth*" or even "OriginalName=eth0" when we know there is
>> >> only one interface.
>> >>
>> >> One thing to consider would be to disallow renaming from a .link file
>> >> where the OriginalName was used to match. That way we don't have the
>> >> somewhat odd situation that a .link file can only be applied once (we
>> >> do not remember the original name, so cannot match on that the second
>> >> time around, as that would be a mess)...
>> >
>> > Maybe we should even store the original name in a udev property, so
>> > that we can make this fully idempotent simply because we can always
>> > check this new property for the original name passed down from the
>> > kernel?
>>
>> you do realize that once the kernel renamed the name, it is free to
>> reuse that name again. So eth0 as OriginalName can then be present
>> multiple times.
>>
>> I think that you can only have OriginalName matching if a renaming
>> has never occurred. Otherwise this is really not
>> deterministic. Since foo0 (renamed from eth0) and and bar0 (renamed
>> from eth0) will both match OriginalName=eth0. The difference is only
>> timing and that is inhering racy of course.
>
> Well, sure, if you use OriginalName= for such names, it's your own
> fault. I think using OriginalName= is primarily useful for things like
> veth links where the names are chosen by userspace anyway.
>
> Hmm, now that the naming policy is exposed by the kernel, can we
> detect the cases where naming happens like "eth0", "eth1", and print a
> nice warning or so, if people then match against that?

I added some warnings to git now. Still need to push some more kernel
patches to get more stuff tagged correctly, but at least the systemd
side is now good.

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-05 Thread Lennart Poettering
On Fri, 05.12.14 10:07, Marcel Holtmann (mar...@holtmann.org) wrote:

> Hi Lennart,
> 
>  Moreover, if we
>  give people this feature I'm pretty sure we'll get lots of people
>  expecting it to work also for any other sort of name and getting
>  confused when it doesn't.
> >>> 
> >>> Well, this is something we can fix by documentation, no?
> >>> 
> >>> Or maybe name the match option differently, maybe OriginalName= or
> >>> KernelName= or so, and then only matching interfaces where you know
> >>> that the name was selected by userspace in the first place?
> >> 
> >> I like the idea of OriginalName, much less likely to get people
> >> confused. I now implemented that, with the restriction that we cannot
> >> match on renamed names. For now I left it open to match on ethX style
> >> names, as people in principle could do sensible things like
> >> "OriginalName=eth*" or even "OriginalName=eth0" when we know there is
> >> only one interface.
> >> 
> >> One thing to consider would be to disallow renaming from a .link file
> >> where the OriginalName was used to match. That way we don't have the
> >> somewhat odd situation that a .link file can only be applied once (we
> >> do not remember the original name, so cannot match on that the second
> >> time around, as that would be a mess)...
> > 
> > Maybe we should even store the original name in a udev property, so
> > that we can make this fully idempotent simply because we can always
> > check this new property for the original name passed down from the
> > kernel?
> 
> you do realize that once the kernel renamed the name, it is free to
> reuse that name again. So eth0 as OriginalName can then be present
> multiple times.
> 
> I think that you can only have OriginalName matching if a renaming
> has never occurred. Otherwise this is really not
> deterministic. Since foo0 (renamed from eth0) and and bar0 (renamed
> from eth0) will both match OriginalName=eth0. The difference is only
> timing and that is inhering racy of course.

Well, sure, if you use OriginalName= for such names, it's your own
fault. I think using OriginalName= is primarily useful for things like
veth links where the names are chosen by userspace anyway. 

Hmm, now that the naming policy is exposed by the kernel, can we
detect the cases where naming happens like "eth0", "eth1", and print a
nice warning or so, if people then match against that?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-05 Thread Tom Gundersen
On 5 Dec 2014 10:07, "Marcel Holtmann"  wrote:
>
> Hi Lennart,
>
>  Moreover, if we
>  give people this feature I'm pretty sure we'll get lots of people
>  expecting it to work also for any other sort of name and getting
>  confused when it doesn't.
> >>>
> >>> Well, this is something we can fix by documentation, no?
> >>>
> >>> Or maybe name the match option differently, maybe OriginalName= or
> >>> KernelName= or so, and then only matching interfaces where you know
> >>> that the name was selected by userspace in the first place?
> >>
> >> I like the idea of OriginalName, much less likely to get people
> >> confused. I now implemented that, with the restriction that we cannot
> >> match on renamed names. For now I left it open to match on ethX style
> >> names, as people in principle could do sensible things like
> >> "OriginalName=eth*" or even "OriginalName=eth0" when we know there is
> >> only one interface.
> >>
> >> One thing to consider would be to disallow renaming from a .link file
> >> where the OriginalName was used to match. That way we don't have the
> >> somewhat odd situation that a .link file can only be applied once (we
> >> do not remember the original name, so cannot match on that the second
> >> time around, as that would be a mess)...
> >
> > Maybe we should even store the original name in a udev property, so
> > that we can make this fully idempotent simply because we can always
> > check this new property for the original name passed down from the
> > kernel?
>
> you do realize that once the kernel renamed the name, it is free to reuse
that name again. So eth0 as OriginalName can then be present multiple times.
>
> I think that you can only have OriginalName matching if a renaming has
never occurred. Otherwise this is really not deterministic. Since foo0
(renamed from eth0) and and bar0 (renamed from eth0) will both match
OriginalName=eth0. The difference is only timing and that is inhering racy
of course.

Well, matching on kernel names is not sane, and I put a warning in the
manpage.

The reason I left it in was that you could match on eth0 of you know it is
the only ethX device on your system, or you could match on eth* which would
also be  deterministic.

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-05 Thread Marcel Holtmann
Hi Lennart,

 Moreover, if we
 give people this feature I'm pretty sure we'll get lots of people
 expecting it to work also for any other sort of name and getting
 confused when it doesn't.
>>> 
>>> Well, this is something we can fix by documentation, no?
>>> 
>>> Or maybe name the match option differently, maybe OriginalName= or
>>> KernelName= or so, and then only matching interfaces where you know
>>> that the name was selected by userspace in the first place?
>> 
>> I like the idea of OriginalName, much less likely to get people
>> confused. I now implemented that, with the restriction that we cannot
>> match on renamed names. For now I left it open to match on ethX style
>> names, as people in principle could do sensible things like
>> "OriginalName=eth*" or even "OriginalName=eth0" when we know there is
>> only one interface.
>> 
>> One thing to consider would be to disallow renaming from a .link file
>> where the OriginalName was used to match. That way we don't have the
>> somewhat odd situation that a .link file can only be applied once (we
>> do not remember the original name, so cannot match on that the second
>> time around, as that would be a mess)...
> 
> Maybe we should even store the original name in a udev property, so
> that we can make this fully idempotent simply because we can always
> check this new property for the original name passed down from the
> kernel?

you do realize that once the kernel renamed the name, it is free to reuse that 
name again. So eth0 as OriginalName can then be present multiple times.

I think that you can only have OriginalName matching if a renaming has never 
occurred. Otherwise this is really not deterministic. Since foo0 (renamed from 
eth0) and and bar0 (renamed from eth0) will both match OriginalName=eth0. The 
difference is only timing and that is inhering racy of course.

Regards

Marcel

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-04 Thread Tom Gundersen
Thanks for the links William. Looks like most of that should be
covered by networkd. I now also added support for MTU and MACAddress
to be set in the .network files. The intention here is that if you
ever disable a network at runtime, we will revert to the default
(.link-defined) settings. However, runtime configuration is not yet
implemented, so for now the only distinction between setting this in a
.link and a .network is that you can now match on the real ifname.

HTH,

Tom

On Thu, Dec 4, 2014 at 9:07 PM, William Kennington
 wrote:
> In regards to the OS and syntax, this is NixOS. NixOS uses its own
> expression language to configure the entire system, including the network
> stack. If a user wanted to configure their system's networking stack, they
> would modify the networking.* set of options in their
> /etc/nixos/configuration.nix. Currently this is done with a set of generated
> scripts run as systemd services with device based dependencies. Ideally this
> would be directly translated to networkd syntax.
>
> For example, a user might have this snippet as part of their config for
> statically configuring one of their ethernet interfaces:
>
> networking.interfaces."enp4s0" = {
>   macAddress = "de:ad:be:eef:ca:fe";
>   mtu = 9000;
>   ip4 = [
> { address = "10.0.0.2"; prefixLength = 24; }
> { address = "10.0.0.3"; prefixLength = 24; }
>   ];
> };
>
> For link configuration, we are currently generating a
> network-link-.service which sets the mac address and mtu using
> iproute2:
> https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix#L691-L713
>
> The networking options are all defined in:
> https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix
>
> Our current translator to networkd is:
> https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces-systemd.nix
>
>
> Of course, the problem with just using kernel names is that our use case
> assumes that the interface was already renamed by udev. Therefore, our
> matching must be based on the post-udev name if it is to be backward
> compatible. Ultimately it might be best to continue using our set of scripts
> coupled with udev generated systemd device units, given our use cases.
>
> On Thu, Dec 4, 2014 at 9:53 AM, Tom Gundersen  wrote:
>>
>> On Thu, Dec 4, 2014 at 4:11 PM, Lennart Poettering
>>  wrote:
>> > On Thu, 04.12.14 11:20, Tom Gundersen (t...@jklm.no) wrote:
>> >
>> >> > I mean, most of the times .link files are
>> >> > used to choose the name depending on other fields, but I think in all
>> >> > cases where the name is chosen at creation time of an interface (like
>> >> > for example for veth links), it should be Ok to match links based on
>> >> > the name they already have?
>> >>
>> >> So this we could do (i.e., allow name matches if and only if the name
>> >> is set at creation time). Though, if the name is set at creation time,
>> >> shouldn't also all the other properties have been?
>> >
>> > In nspawn we create veth links, and I *really* *really* don't want to
>> > add tons of options there to set the MTU or suchlike. Setting these
>> > properties really should be done within networkd I think.
>> >
>> > I think it would be really useful if we could match on the container's
>> > veth links by name, so that a .link file for it could be equally
>> > expressive as the .network file already is.
>> >
>> >> Moreover, if we
>> >> give people this feature I'm pretty sure we'll get lots of people
>> >> expecting it to work also for any other sort of name and getting
>> >> confused when it doesn't.
>> >
>> > Well, this is something we can fix by documentation, no?
>> >
>> > Or maybe name the match option differently, maybe OriginalName= or
>> > KernelName= or so, and then only matching interfaces where you know
>> > that the name was selected by userspace in the first place?
>>
>> I like the idea of OriginalName, much less likely to get people
>> confused. I now implemented that, with the restriction that we cannot
>> match on renamed names. For now I left it open to match on ethX style
>> names, as people in principle could do sensible things like
>> "OriginalName=eth*" or even "OriginalName=eth0" when we know there is
>> only one interface.
>>
>> One thing to consider would be to disallow renaming from a .link file
>> where the OriginalName was used to match. That way we don't have the
>> somewhat odd situation that a .link file can only be applied once (we
>> do not remember the original name, so cannot match on that the second
>> time around, as that would be a mess)...
>>
>> Testing and feedback welcome. Does this solve your problem William?
>>
>> Cheers,
>>
>> Tom
>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-04 Thread William Kennington
In regards to the OS and syntax, this is NixOS. NixOS uses its own
expression language to configure the entire system, including the network
stack. If a user wanted to configure their system's networking stack, they
would modify the networking.* set of options in their
/etc/nixos/configuration.nix. Currently this is done with a set of
generated scripts run as systemd services with device based dependencies.
Ideally this would be directly translated to networkd syntax.

For example, a user might have this snippet as part of their config for
statically configuring one of their ethernet interfaces:

networking.interfaces."enp4s0" = {
  macAddress = "de:ad:be:eef:ca:fe";
  mtu = 9000;
  ip4 = [
{ address = "10.0.0.2"; prefixLength = 24; }
{ address = "10.0.0.3"; prefixLength = 24; }
  ];
};

For link configuration, we are currently generating a
network-link-.service which sets the mac address and mtu using
iproute2:
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix#L691-L713

The networking options are all defined in:
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

Our current translator to networkd is:
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces-systemd.nix


Of course, the problem with just using kernel names is that our use case
assumes that the interface was already renamed by udev. Therefore, our
matching must be based on the post-udev name if it is to be backward
compatible. Ultimately it might be best to continue using our set of
scripts coupled with udev generated systemd device units, given our use
cases.

On Thu, Dec 4, 2014 at 9:53 AM, Tom Gundersen  wrote:

> On Thu, Dec 4, 2014 at 4:11 PM, Lennart Poettering
>  wrote:
> > On Thu, 04.12.14 11:20, Tom Gundersen (t...@jklm.no) wrote:
> >
> >> > I mean, most of the times .link files are
> >> > used to choose the name depending on other fields, but I think in all
> >> > cases where the name is chosen at creation time of an interface (like
> >> > for example for veth links), it should be Ok to match links based on
> >> > the name they already have?
> >>
> >> So this we could do (i.e., allow name matches if and only if the name
> >> is set at creation time). Though, if the name is set at creation time,
> >> shouldn't also all the other properties have been?
> >
> > In nspawn we create veth links, and I *really* *really* don't want to
> > add tons of options there to set the MTU or suchlike. Setting these
> > properties really should be done within networkd I think.
> >
> > I think it would be really useful if we could match on the container's
> > veth links by name, so that a .link file for it could be equally
> > expressive as the .network file already is.
> >
> >> Moreover, if we
> >> give people this feature I'm pretty sure we'll get lots of people
> >> expecting it to work also for any other sort of name and getting
> >> confused when it doesn't.
> >
> > Well, this is something we can fix by documentation, no?
> >
> > Or maybe name the match option differently, maybe OriginalName= or
> > KernelName= or so, and then only matching interfaces where you know
> > that the name was selected by userspace in the first place?
>
> I like the idea of OriginalName, much less likely to get people
> confused. I now implemented that, with the restriction that we cannot
> match on renamed names. For now I left it open to match on ethX style
> names, as people in principle could do sensible things like
> "OriginalName=eth*" or even "OriginalName=eth0" when we know there is
> only one interface.
>
> One thing to consider would be to disallow renaming from a .link file
> where the OriginalName was used to match. That way we don't have the
> somewhat odd situation that a .link file can only be applied once (we
> do not remember the original name, so cannot match on that the second
> time around, as that would be a mess)...
>
> Testing and feedback welcome. Does this solve your problem William?
>
> Cheers,
>
> Tom
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-04 Thread Tom Gundersen
On Thu, Dec 4, 2014 at 8:08 PM, Lennart Poettering
 wrote:
> On Thu, 04.12.14 18:53, Tom Gundersen (t...@jklm.no) wrote:
>
>> >> Moreover, if we
>> >> give people this feature I'm pretty sure we'll get lots of people
>> >> expecting it to work also for any other sort of name and getting
>> >> confused when it doesn't.
>> >
>> > Well, this is something we can fix by documentation, no?
>> >
>> > Or maybe name the match option differently, maybe OriginalName= or
>> > KernelName= or so, and then only matching interfaces where you know
>> > that the name was selected by userspace in the first place?
>>
>> I like the idea of OriginalName, much less likely to get people
>> confused. I now implemented that, with the restriction that we cannot
>> match on renamed names. For now I left it open to match on ethX style
>> names, as people in principle could do sensible things like
>> "OriginalName=eth*" or even "OriginalName=eth0" when we know there is
>> only one interface.
>>
>> One thing to consider would be to disallow renaming from a .link file
>> where the OriginalName was used to match. That way we don't have the
>> somewhat odd situation that a .link file can only be applied once (we
>> do not remember the original name, so cannot match on that the second
>> time around, as that would be a mess)...
>
> Maybe we should even store the original name in a udev property, so
> that we can make this fully idempotent simply because we can always
> check this new property for the original name passed down from the
> kernel?

We got into lots of issues in the past with trying to track the
renaming from userspace (which is why NET_NAME_RENAMED and friends now
are exposed from the kernel), so I'd rather not get back into that
game. The issue is that processes can (and do) rename interfaces
outside of udev's control (possibly before udev is running), and we'll
then be left with knowing that a device was renamed (as the kernel
tells us that much), but not from what. I'd really prefer to keep this
dead simple and either say (as now) that the config is only applied
once if you rename the device, or say that the name-matching config
cannot rename.

-t
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-04 Thread Lennart Poettering
On Thu, 04.12.14 18:53, Tom Gundersen (t...@jklm.no) wrote:

> >> Moreover, if we
> >> give people this feature I'm pretty sure we'll get lots of people
> >> expecting it to work also for any other sort of name and getting
> >> confused when it doesn't.
> >
> > Well, this is something we can fix by documentation, no?
> >
> > Or maybe name the match option differently, maybe OriginalName= or
> > KernelName= or so, and then only matching interfaces where you know
> > that the name was selected by userspace in the first place?
> 
> I like the idea of OriginalName, much less likely to get people
> confused. I now implemented that, with the restriction that we cannot
> match on renamed names. For now I left it open to match on ethX style
> names, as people in principle could do sensible things like
> "OriginalName=eth*" or even "OriginalName=eth0" when we know there is
> only one interface.
> 
> One thing to consider would be to disallow renaming from a .link file
> where the OriginalName was used to match. That way we don't have the
> somewhat odd situation that a .link file can only be applied once (we
> do not remember the original name, so cannot match on that the second
> time around, as that would be a mess)...

Maybe we should even store the original name in a udev property, so
that we can make this fully idempotent simply because we can always
check this new property for the original name passed down from the
kernel?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-04 Thread Tom Gundersen
On Thu, Dec 4, 2014 at 4:11 PM, Lennart Poettering
 wrote:
> On Thu, 04.12.14 11:20, Tom Gundersen (t...@jklm.no) wrote:
>
>> > I mean, most of the times .link files are
>> > used to choose the name depending on other fields, but I think in all
>> > cases where the name is chosen at creation time of an interface (like
>> > for example for veth links), it should be Ok to match links based on
>> > the name they already have?
>>
>> So this we could do (i.e., allow name matches if and only if the name
>> is set at creation time). Though, if the name is set at creation time,
>> shouldn't also all the other properties have been?
>
> In nspawn we create veth links, and I *really* *really* don't want to
> add tons of options there to set the MTU or suchlike. Setting these
> properties really should be done within networkd I think.
>
> I think it would be really useful if we could match on the container's
> veth links by name, so that a .link file for it could be equally
> expressive as the .network file already is.
>
>> Moreover, if we
>> give people this feature I'm pretty sure we'll get lots of people
>> expecting it to work also for any other sort of name and getting
>> confused when it doesn't.
>
> Well, this is something we can fix by documentation, no?
>
> Or maybe name the match option differently, maybe OriginalName= or
> KernelName= or so, and then only matching interfaces where you know
> that the name was selected by userspace in the first place?

I like the idea of OriginalName, much less likely to get people
confused. I now implemented that, with the restriction that we cannot
match on renamed names. For now I left it open to match on ethX style
names, as people in principle could do sensible things like
"OriginalName=eth*" or even "OriginalName=eth0" when we know there is
only one interface.

One thing to consider would be to disallow renaming from a .link file
where the OriginalName was used to match. That way we don't have the
somewhat odd situation that a .link file can only be applied once (we
do not remember the original name, so cannot match on that the second
time around, as that would be a mess)...

Testing and feedback welcome. Does this solve your problem William?

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-04 Thread Lennart Poettering
On Thu, 04.12.14 11:20, Tom Gundersen (t...@jklm.no) wrote:

> > I mean, most of the times .link files are
> > used to choose the name depending on other fields, but I think in all
> > cases where the name is chosen at creation time of an interface (like
> > for example for veth links), it should be Ok to match links based on
> > the name they already have?
> 
> So this we could do (i.e., allow name matches if and only if the name
> is set at creation time). Though, if the name is set at creation time,
> shouldn't also all the other properties have been? 

In nspawn we create veth links, and I *really* *really* don't want to
add tons of options there to set the MTU or suchlike. Setting these
properties really should be done within networkd I think.

I think it would be really useful if we could match on the container's
veth links by name, so that a .link file for it could be equally
expressive as the .network file already is.

> Moreover, if we
> give people this feature I'm pretty sure we'll get lots of people
> expecting it to work also for any other sort of name and getting
> confused when it doesn't.

Well, this is something we can fix by documentation, no?

Or maybe name the match option differently, maybe OriginalName= or
KernelName= or so, and then only matching interfaces where you know
that the name was selected by userspace in the first place?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-04 Thread Tom Gundersen
On Thu, Dec 4, 2014 at 3:50 AM, Lennart Poettering
 wrote:
> Tom, I think it would make sense to allow Name= matches in the [Match]
> section of .link files, no?

Hm, so far I hesitated, as the most common scenarios is the one that
William has, namely to want to match on the name set by udev and not
the one set by the kernel. This we cannot really do in .link files as
it would be confusing for admins to figure out exactly what is being
matched on, and it could obviously become undecidable/nonterminating
depending on how we try to implement it.

> I mean, most of the times .link files are
> used to choose the name depending on other fields, but I think in all
> cases where the name is chosen at creation time of an interface (like
> for example for veth links), it should be Ok to match links based on
> the name they already have?

So this we could do (i.e., allow name matches if and only if the name
is set at creation time). Though, if the name is set at creation time,
shouldn't also all the other properties have been? Moreover, if we
give people this feature I'm pretty sure we'll get lots of people
expecting it to work also for any other sort of name and getting
confused when it doesn't.

So overall, not really convinced, but if there is a usecase for
matching on such limited types of names, I'm not very strongly against
it.

-t
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-03 Thread Lennart Poettering
On Mon, 24.11.14 11:46, William Kennington (will...@wkennington.com) wrote:

> I'd like to be able to set the MAC Address and MTU of interfaces, with just
> the interface name alone. The current method for matching links seems to be
> heavily tied to udev ATTRs and I understand given the nature of
> systemd.link that it might not make sense to Match based on name. However,
> I need this functionality to support mapping the current OS defined network
> configuration syntax to networkd. Is there any chance this could be
> supported in systemd.network instead of systemd.link?

Tom, I think it would make sense to allow Name= matches in the [Match]
section of .link files, no? I mean, most of the times .link files are
used to choose the name depending on other fields, but I think in all
cases where the name is chosen at creation time of an interface (like
for example for veth links), it should be Ok to match links based on
the name they already have?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-12-03 Thread Tom Gundersen
Yes, we could support a [Link] section in .network files applying such
settings per network. Though that this should really be about overriding
the link  specific settings, so not sure it fits your usecase precisely...
On 24 Nov 2014 20:46, "William Kennington"  wrote:

> I'd like to be able to set the MAC Address and MTU of interfaces, with
> just the interface name alone. The current method for matching links seems
> to be heavily tied to udev ATTRs and I understand given the nature of
> systemd.link that it might not make sense to Match based on name. However,
> I need this functionality to support mapping the current OS defined network
> configuration syntax to networkd. Is there any chance this could be
> supported in systemd.network instead of systemd.link?
>
> Regards,
> William
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] networkd: Support setting mtu / mac address by interface name

2014-11-24 Thread William Kennington
I'd like to be able to set the MAC Address and MTU of interfaces, with just
the interface name alone. The current method for matching links seems to be
heavily tied to udev ATTRs and I understand given the nature of
systemd.link that it might not make sense to Match based on name. However,
I need this functionality to support mapping the current OS defined network
configuration syntax to networkd. Is there any chance this could be
supported in systemd.network instead of systemd.link?

Regards,
William
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel