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

Rafał Miłecki zajec5 at gmail.com
Sat May 15 10:18:54 PDT 2021

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
[PATCH] base-files: use "ports" array in board.json network for bridges

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)

More information about the openwrt-devel mailing list