My motherboard has builtin wifi that I use to connect to the internet. I also have a usb wifi card and I want to write a custom program that manages this wifi card (create hotspot, list hotspots, connect to a hotspot, make http requests using that hotspot). How do I do that?

  • 2
    what do you mean by "program"? an interface over the standard command-line programs for accomplishing those tasks? what's wrong with the standard terminal or gui tools?
    – Esther
    Commented Oct 25, 2022 at 3:32
  • @Esther How do I connect to a hotspot using the second card and make an http request without disturbing the connection established on the first card? (using any method)
    – thewolf
    Commented Oct 25, 2022 at 4:47

1 Answer 1


NetworkManager is the daemon that manages such things, and it's quite flexible.

There's many ways of interacting with it. On the command line, there's nmcli, and for every serious scripting and programming language, you just directly access its RPC API through its dbus interface.

Documentation for it can be found on https://networkmanager.dev/

If your Linux distro is not using NetworkManager, it might be worth trying one of the less exotic distros, as while many people have strong opinions on systemd/NM and then go and roll their own distros, this is really the use case where the service architecture makes a lot of sense.

Making http requests through that hotspot

You just use whatever way you'd normally use to make them. Only that you set up routes before so that the request goes through the desired interface.

Linux network namespace make that easy - you can define your own routing tables for different processes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .