1

I use Arch Linux and this is the command I usually use to disconnect from the Internet: sudo wpa_cli -i wlp2s0 -p /var/run/wpa_supplicant\ GROUP\=wheel/ terminate. To connect again, I use: sudo wpa_supplicant -B -i wlp2s0 -c /etc/wpa_supplicant-wlp2s0.conf. That works at my home, but not here at my cousin's house.

I establish some kind of connection since I at least get Wi-Fi's name (iwgetid returns the correct name of wlan). But that's all, there is no connection with the Internet.

I even tried running sudo dhcpcd -b after sudo wpa_supplicant -B -i wlp2s0 -c /etc/wpa_supplicant-wlp2s0.conf but it has no effect.

4
  • Guess: The second time you start wpa_supplicant it has a slightly different configuration than the first time it gets started automatically. Is there any reason you have to terminate wpa_supplicant to disconnect? Why not use whatever way your distro uses (network manager, ifup/ifdown, disconnect with wpa_cli, whatever?)
    – dirkt
    Commented Aug 12, 2018 at 6:50
  • @dirkt "The second time you start wpa_supplicant it has a slightly different configuration than the first time it gets started automatically." Why do you think so? "Is there any reason you have to terminate wpa_supplicant to disconnect? Why not use whatever way your distro uses (network manager, ifup/ifdown, disconnect with wpa_cli, whatever?)" I don't have neither network manager or ifup/ifdown. As for wpa_cli, I don't think that can be done using it. PS: I'm a minimalist.
    – Hanlon
    Commented Aug 12, 2018 at 14:31
  • connect/disconnect via wpa_cli. Still think it can't be done?
    – dirkt
    Commented Aug 12, 2018 at 15:56
  • @dirkt Doesn't work for me.
    – Hanlon
    Commented Aug 12, 2018 at 19:27

1 Answer 1

0

I've found another, better way that does the same thing (and does it right):

To disconnect:

sudo ip link set dev wlp2s0 down && sudo dhclient -r wlp2s0

To connect:

sudo ip link set dev wlp2s0 up && sudo dhclient wlp2s0

2
  • I'm minimalistic myself, but at least I let ifup/ifdown handle DHCP ...
    – dirkt
    Commented Aug 12, 2018 at 15:57
  • Maybe that's a better idea, I'll check it out. :)
    – Hanlon
    Commented Aug 12, 2018 at 19:29

You must log in to answer this question.

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