On Tue, Nov 22, 2022 at 09:25:08AM +0000, Stuart Henderson wrote:
> Need to query (and set $if, which might be used in route commands etc) I 
> think.
> 

I would prefer if people took a step back from configuring interfaces by
MAC address. It feels like a overly specific hack is introduced for
a case that should be handled in a different way.

Not all interfaces have MAC addresses. E.g. umb(4) would need a
different identifier (most probably the IMEI). Some interfaces inherit
the MAC address from an other interface (vlan, trunk).

This requires the use of interface groups to 'rename' these interfaces
e.g. as 'green' and 'blue' or 'in' and 'out'. So that you can use these
handles in pf.conf and other commands (rad comes to mind). Not all
commands work with interface groups. route(8) is such an example but there
are more commands needing this.

Btw. a lot of this can be done already now by using '!' in hostname.if
It wont be pretty but it is also not a common use case.
-- 
:wq Claudio

> On 22 November 2022 08:37:05 Florian Obser <flor...@openbsd.org> wrote:
> 
> > On 2022-11-22 18:06 +10, David Gwynne <da...@gwynne.id.au> wrote:
> > > 
> > > There are a few things to keep in mind if we're going to use lladdrs like 
> > > this.
> > > 
> > > vlan interfaces start with their lladdr as 00:00:00:00:00:00 and
> > > then assume the lladdr of the parent interface when that is
> > > configured.
> > > 
> > > Clonable devices (eg, egre, vport, aggr, etc) tend to generate random
> > > lladdrs when they're created. If you want a consistent lladdr for
> > > these you configure that in /etc/hostname.vportX or whatever you're
> > > using.
> > 
> > ifconfig(8) already knows about these (see -C option). Which made me
> > think, it might be easier to just ask ifconfig(8).
> > 
> > $ ifconfig -Q 00:80:41:7b:f3:c3
> > vio0
> > 
> > Would that be helpful?
> > 
> > Or would you need
> > 
> > # ifconfig 00:80:41:7b:f3:c3 inet 192.0.2.2/24
> > 
> > to work?
> > 
> > I think you want to query,no?
> > 
> > > 
> > > "Platform deficient" systems like arm SBCs don't always do a good job
> > > of providing lladdrs for their ethernet interfaces. I'm working on one
> > > now that has rge(4) and it comes up with an lladdr of
> > > 00:00:00:00:00:00. I have another one where the drivers fall back to
> > > randomly generating an lladdr if none is set by u-boot/edk/etc.
> > > 
> > > I don't think any of these are showstoppers, but do need to be considered.
> > > 
> > 
> > --
> > I'm not entirely sure you are real.
> 

Reply via email to