Hello Yasin,
What is the Use behind this? Would'nt it be an option that the customer simply enables the L2 access?
Furthermore, have you thought about using the Ressource Manager to isolate a NIC for your application instead of L2? The NIC will be isolated from the Edge Runtime and is in full control of your application.
Ressource Manager Ressources can be configured as optional, which would fulfill your requirement.
Please find further information here:
https://docs.eu1.edge.siemens.cloud/get_started_and_operate/industrial_edge_device/operation/settings/resource_manager.html