I'm trying to set up a mesh network, and to do so, I'm configuring the network when the device is starting. This is the startup script of a service which is enabled to load during boot:

/sbin/ifconfig wlan0 down &>> /var/log/meshnet
/sbin/ip link set down dev wlan0 &>> /var/log/meshnet
/sbin/iwconfig wlan0 mode ad-hoc &>> /var/log/meshnet
/sbin/iwconfig wlan0 channel 7 &>> /var/log/meshnet
/sbin/iwconfig wlan0 essid mesh2 &>> /var/log/meshnet
/sbin/ifconfig wlan0 up &>> /var/log/meshnet
/sbin/ip link set up dev wlan0 &>> /var/log/meshnet
/sbin/ip addr add dev wlan0 &>> /var/log/meshnet
/sbin/ip route add default via &>> /var/log/meshnet

However, I'm getting the following errors (in the log file):

Error for wireless request "Set Mode" (8B06) : SET failed on device wlan0 ; Operation not permitted.   
Error for wireless request "Set ESSID" (8B1A) : SET failed on device wlan0 ; Operation not permitted.

When I run the script using sudo it works just fine.

Is there anything I can do to make this work?

Running on a chip (getchip.com)

chip@chip:~$ cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION="8 (jessie)"
  • Where (in the filesystem) is this startup script? – JigglyNaga Jan 16 '17 at 10:29
  • Try usermod -a -G netdev your_username – GAD3R Jan 16 '17 at 10:45

Add user to netdev group:

usermod -a -G netdev USERNAME

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.