I have configured my computer to be a WiFi Access Point when it boots, with hostapd and isc-dhcp-server. The purpose is to be able to connect it to remote controller, so it does not provide internet connection.
To make it work, I have, among others, added this lines in /etc/network/interfaces:
auto wlo1
iface wlo1 inet static
address 192.168.0.1
netmask 255.255.255.0
broadcast 192.168.0.255
scope link
However, once in a while, I want to connect it to internet, so turn off its Wifi access point to make it become a wifi client, until the next reboot. I am currently writing a script to do this, but I don't know how to make wpa_supplicant (or NetworkManager) take back the control over the interface.
I tried nmcli device set wlo1 managed yes autoconnect yes
, but the interface doesn't react.
I am on Ubuntu Desktop 16.04, if its help.