[RFC PATCH v2 0/1] Introduce UCI support for configuring DSA VLAN filter rules

Luiz Angelo Daros de Luca luizluca at gmail.com
Thu Jul 23 17:51:16 EDT 2020


> The disadvantage is that the wireless config has to be different if we switch to a default config with no separate LAN bridge, and it becomes potentially more confusing for common use cases.
> I think semantically it fits quite well to just assign a Wifi interface to the lan network and hide some implementation details of what that means.

I think we should try hard to split between L2 and L3 as a goal. Those
convenient shortcuts (interface.type=bridge) make it harder for a
newcomer to understand what is going on. I would try to avoid them.
I had to explain the mixed concepts dozens of times for newbies, even
for those with Linux experience. It's just confusing that linux
network devices, which are also called network interfaces, are not
OpenWrt interfaces. I hope someday I could see the same "names" both
in config and the output from network commands like ip address.
OpenWrt interface name could be a label for an address.

OpenWrt uses multiple names "ifname, iface, device, network,
interface" sometimes for the same and also different concepts. Those
names/references should be standardized. Choose one and stick with it.
Also, there is the problem of how to reference a device/interface. It
should be much easier if the section name could be always used.
However, uci has its limitations, which requires an "option name".
I would use "option name" as "section name" by default, requiring it
to be set explicitly only as a way to overcome the uci section name
limitations.

Wireless defines a network device and maybe wifi-iface should be
declared simply as a type of device with some extra options and a
reference to a radio. BTW, wireless.wifi-device introduces another
confusion with network.device and simply "radio" might be better.

It would be better to have predictable interface names for everything.
If it is not possible, we could introduce a reverse option
"device_for". As both device and interface section can have a device
option, "option device_for" could use both as a valid value.

This is a simple example to illustrate general idea:

config radio 'radio0'
       option type 'mac80211'
       option hwmode '11a'

config device 'wifinet_wan'
       option type wifi
       option ssid 'uplink_wwan'
       option radio 'radio0'
       option mode 'sta'
       option device_for wan # reverse referenced for an interface

config device 'wifinet_OpenWrt' # wifinet_ap will be the linux network
device name
       option type wifi
       option ssid 'OpenWrt'
       option radio 'radio0'
       option mode 'ap'
       option device_for brlan # reverse referenced for a device

config device 'wifinet_OpenWrt2' # wifinet_ap2 will be the linux
network device name
       option type wifi
       option ssid 'OpenWrt2'
       option radio 'radio0'
       option mode 'ap'

config device brlan
       type bridge
       # option name brlan # by default, no need to set
       list device dev1
       list device dev2
       list device dev3
       # list device wifinet_OpenWrt
       list device wifinet_OpenWrt2 # directly referencing

config interface lan
       option device brlan #device instead of ifname
       option proto static

config interface lan6
       option device @lan #the value for lan.device
       option proto static

config interface wan
       # option device wifinet_wan
       option proto dhcp

---
     Luiz Angelo Daros de Luca



More information about the openwrt-devel mailing list