0

I want to let everyone on the system to be able to change the ip address of a network interface. I have wrote a rule in /etc/udev/rules.d like this:

SUBSYSTEM=="net", ATTR{address}="00:0c:26:c6:70:93", NAME="nic", MODE="0666"

The rule matches and my interface is named nic in ifconfig output. the problem is that, when i log in with a regular user, he still couldn't change the ip address of this interface by using ifconfig. Trying this by regular user returns this error message:

SIOCSIFADDR: Operation not permitted
SIOCSIFFLAGS: Operation not permitted

What is the problem ?

1 Answer 1

1

Network interfaces usually do not appear in /dev at all. Their configuration is not done with accesses to device files but with accesses to the NETLINK socket. I don't think that you can give access to this socket to an ordinary user.

You need a suitable sudo rule (and maybe a wrapper script) so that the user can call ip addr.

1
  • Sry, i make a mistake by saying that the device file is created in dev directory. I meant that it appears in ifconfig output. Thank you for your answer.
    – Shnd
    Jan 22, 2016 at 6:58

You must log in to answer this question.

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