The combination of option type 'bridge' and option ifname 'eth.X' seems to still work (at least the bridge is being created) with versions 21.02 and 22.03.
This statement is only valid if option device is (wrongly) used instead of option ifname.
Sorry for misleading you.
@pavelgl - please correct me if I'm wrong about any of this...
@pavelgl - So is it still considered valid to use ifname? I thought the new syntax used ports like this:
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0.1'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
One thing that I think should also be clarified is that the old syntax used to allow the bridge to be defined inside the network interface stanza... this is no longer valid as bridges must now be created as a device:
# this is an INVALID configuration because of the use of the bridge inside the interface stana
config interface 'lan'
option device 'eth0.1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
# This is also INVALID due to the ifname in this stanza here (with or without the bridge in the stanza):
config interface 'lan'
option ifname 'eth0.1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
Valid or not, it still works in versions 21.02.5 and 22.03.3.
I just had to correct my adamant opinion that this would never work because it simply isn't true.
config interface 'net4'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.4.1'
option netmask '255.255.255.0'
I should modify it to look like this, to be future proof :
config interface 'net4'
option type 'br-net4'
option proto 'static'
option ipaddr '192.168.4.1'
option netmask '255.255.255.0'
config device
option name 'br-net4'
option type 'bridge'
list ports 'eth1.3'
Is that correct?
Also, I would like to make sure that I understand precisely what a bridge is, in this context.
Is the bridge here what allows me to combine a physical ethernet port to a wifi network, and treat it as 1 logical network ?
If that is correct, then say I have a network interface that is only used for wifi, not ethernet, should I configure it this way:
There really isn’t a way to truly future proof. The best action is to use the correct syntax for the current version. Wherever possible, there will be a migration path in subsequent versions of OpenWrt. (Usually just one major version at a time).
A bridge is the same idea as a switch, but in software rather than hardware. It allows you to connect multiple physical interfaces to a network - for example, WiFi + Ethernet or multiple WiFi radios. Without the bridge, you can only associate a single physical interface.
Your bridge names in the example are a bit unusual, but they will work.
ipq806x is still pending its migration from swconfig to dsa, which should happen at some point in the future (it's already fully functional, but can't quite meet swconfig's performance figures, which is the only reason for this having been held back so far, at some point a decision will have to be made about this), which precludes any form of migration or forward compatibility.