title: why my program showing ""pyroute2.netlink.exceptions.NetlinkError: (1, 'Operation not permitted') while disconnecting the wifi
body: <p>Hi I am trying to disconnect a open wifi whose SSID is &quot;Umar&quot; (open network). After running with &quot;sudo python3 disconnect.py wlp3s0&quot; i am getting the error like &quot;(-1 Operation not permitted)&quot;
  please help to solve this issue</p>
  <pre><code>import sys
  #import logging
  from pyroute2 import IPRoute
  from pyroute2.iwutil import IW
  from pyroute2.netlink import NLM_F_ACK
  from pyroute2.netlink import NLM_F_REQUEST
  from pyroute2.netlink import NLM_F_DUMP
  from pyroute2.netlink.nl80211 import nl80211cmd
  from pyroute2.netlink.nl80211 import NL80211_NAMES
  
  ifname = sys.argv[1]
  
  iw = IW()
  
  ip = IPRoute()
  ifindex = ip.link_lookup(ifname=ifname)[0]
  ip.close()
  ssid = b&quot;Umar&quot;
  
  msg = nl80211cmd()
  msg['cmd'] = NL80211_NAMES['NL80211_CMD_DISCONNECT']
  msg['attrs'] = [['NL80211_ATTR_IFINDEX', ifindex]]
  dump = iw.nlm_request(msg,msg_type=iw.prid,msg_flags=NLM_F_REQUEST | NLM_F_ACK)
  print (&quot;disconnect {}&quot;.format(dump))   
  iw.close()
  </code></pre>
  <p>Thanks in advance</p>