bisdn / bisdn-linux

Other
9 stars 1 forks source link

Add automated option to create a simple L2 learning switch #101

Open jklare opened 4 months ago

jklare commented 4 months ago

To allow users to easily test the default switch functionality directly after installing the switch via ONIE and without the hassle of manually adding any configuration files, it might be useful to build in a simple option to make the switch a simple L2 learning one. To keep the amount of configuration small and easy for later removal (in case the user decides to go with something handmade and more complicated), we should probably only genrate a minimal bridge configuration (.netdev and .network) and only one wildcard matching port configuration (.network with Name=port*) to bring all ports up and attach them to the bridge. To clearly mark all files as autogenerated, we could use a specifc pre- or suffix for all files (e.g. *_bisdn-autogen*), which could also be used later to remove them in a scripted way. The easiest way to add this functionality i can think of right now, would be to write a simple script (e.g. bisdn-init-l2-learning-config), make it executable and add it to the same folder as our other scripts (onie-bisdn-upgrade and so on). To allow easy cleanup, we could add an option to the script (e.g. --clean) to remove the files. To show the user which files are generated before they are actually placed in the folder, another option like --dry-run might be useful as well.

hwoesner commented 4 months ago

I enthusiastically agree. We discussed this about 8 years ago, but somehow never did it, probably because it felt too easy. But it is useful for any new user that just wants the thing 'to work'.

rubensfig commented 1 week ago

Associated PR in https://github.com/bisdn/meta-switch/pull/220.