After using Networkmanager and Wicd for a few years each I craved for a less complicated networking setup on my laptop. I did some research and found that nothing out there fits my need so I decided just to use the minimal basic setup.
systemd_networkd
I created a simple network file to use systemd to do the DHCP:
[Match]
Name=wlan0
[Network]
DHCP=yes
[DHCP]
RouteMetric=10
The Name tells systemd on which interfaces the config should be applied. _wlp*_ would also be valid The _DHCP_ Parameter should be self explaining. _ipv4_ would also be valid. The _RouteMetric_ tells systemd that any route announced by the DHCP Server should get this specific metric. I use a lower metric for any routes on my wired interfaces to force traffic to go through the cable if possible.
wpa_supplicant
Ofcourse wpa_supplicant is necessary on Linux to use any kind of Wireless network. I use wpa_gui for the lazy hours to create the config for me. Writing/Editing the config manually is still needed sometimes
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=network
update_config=1
ap_scan=1
network={
ssid="karlsruhe.freifunk.net"
key_mgmt=NONE
auth_alg=OPEN
#disabled=1
}
This is as simple as possible. ctrl_interface defines the socket on which wpa_ui or something similar can connect to wpa_supplicant update_config allows wpa_supplicant to overwrite the configfile if necessary. ap_scan tells wpa_supplicant to decide which network to connect to. It would be also possible to let the driver to that (ap_scan=0)
After a while I found out that wpa_gui creates the network config snippet with the disabled=1 parameter by default. This prevents wpa_supplicant from connecting to the network automatically if while by scanning. For most networks I disable this parameter manually.