How to Disconnect Wi-Fi and Ethernet Interfaces

I want to be able to disconnect all available interfaces on a device running macOS 11 and above.

For Wi-Fi interfaces I see that this is possible using the CoreWLAN framework. https://developer.apple.com/documentation/corewlan/cwinterface/1426422-disassociate

However, how can I do something similar for an ethernet interface? I want to be able to reconnect the interface eventually as well.

The reason I want to be able to do this is that I want to drop all existing connections on the device right after I start my content filter or when my filter rules have changed and my filter has already allowed the flow perviously.

This sounds pretty disruptive to the system just to make this work with the Content Filter APIs. What about using an API that continuously get flows like NETransparentProxyProvider?

How to Disconnect Wi-Fi and Ethernet Interfaces
 
 
Q