[PATCH netifd] bridge: rename "ifname" attribute to "ports"

Rafał Miłecki zajec5 at gmail.com
Sun May 16 03:06:11 PDT 2021

On 15.05.2021 22:39, Perry wrote:
> On 5/15/21 7:18 PM, Rafał Miłecki wrote:
>> On 15.05.2021 11:09, Paul Oranje wrote:
>>> Op 14 mei 2021, om 15:27 heeft Rafał Miłecki <zajec5 at gmail.com> het
>>> volgende geschreven:
>>>> From: Rafał Miłecki <rafal at milecki.pl>
>>>> Bridge aggregates multiple ports so use a more accurate name ("ports").
>>> Confusing that a logical network "interface" references something
>>> physical like a "port".
>>> One would expect that at least a level is modelled in between and that
>>> a bridge in a "interface" config section can bridge several devices
>>> (like plain devices/L2 bridges/VLANs/tunnel devices/...).
>>> Assuming I fail to understand the model, what am I missing ?
>>>> For backward compatibility add a temporary config translation.
>>>> Config example:
>>>> config interface 'lan'
>>>>          option type 'bridge'
>>>>          list ports 'lan1'
>>>>          list ports 'lan2'>
>> You're most likely confused by the old way of defining bridges that
>> OpenWrt happens to use by default. It's the UCI "interface" section
>> type that defines L2 and L3 at the same time.
>> That said it's not something this patch is trying to address. What gets
>> you confused I'm planning to rework during next days. The first step
>> was:
>> [PATCH] base-files: use "ports" array in board.json network for bridges
>> https://patchwork.ozlabs.org/project/openwrt/patch/20210514092147.30666-1-zajec5@gmail.com/
>> The new way of defining L2 in L3 /etc/config/netowrk uses "device" and
>> "interface" sections. So that would be actually something like:
>> config device
>>      option name 'lan'
>>      option type 'bridge'
>>      list ports 'lan1'
>>      list ports 'lan2'
>> On top of that you could then have L3 specified, e.g.:
>> config interface 'home'
>>      option ifname 'lan'
>>      option proto 'static'
>>      option ipaddr ''
>>      option netmask ''
>> ("home" being logical name)
> In this example, would a wireless wifi-iface have
> 	option network 'lan' # bridge device name?
> or
> 	option network 'home' # logical name?
> Since the wifi-iface is added as another port on a bride, then I would
> say 'lan'.  But on the other hand, a wifi-iface does not have to be
> bridged to any physical ports.  In this case, I would say 'home' is correct.

You need to use logical name ("home" in above example) in the "network" option.

Please note this is not something this patch affects at all. So what
you're discussing there is out of the scope.

As for the "network" option of wifi-iface I'm planning to rework it
after cleaning up /etc/config/network . Right now it's unpredictable,
see also Jo's comment:

[2021-05-06] [16:24:11 CEST] <jow> and not some "just use wireless.wifi-iface.network" crap which does different things depending on how the destination network is defined
[2021-05-06] [16:25:07 CEST] <jow> (is it a bridge? then bridge it. is it a vlan? maybe a vlan on top of a bridge, then bridge it too? is it a netdev? then just inherit ip settings. is it a netdev already in use by something else? then overwrite random ip settings or simply do nothing, depending on the phase of the moon)

More information about the openwrt-devel mailing list