Article 6R6DN eth0: [ERROR] Set device name: No such device

eth0: [ERROR] Set device name: No such device

by
inkmin
from LinuxQuestions.org on (#6R6DN)
I cannot change the MAC address in my Kali VM with this Python code:
Quote:
interface = input("interface > ")
new_mac = input("new MAC > ")
subprocess.call(["ifconfig", interface, "down"])
subprocess.call(["sudo", "-S", "macchanger", "--mac=", new_mac, "", interface])
subprocess.call(["ifconfig", interface, "up"])
but I could change it with these commands:
Quote:
interface = input("interface > ")
new_mac = input("new MAC > ")
subprocess.call("ifconfig " + interface + " down" , shell=True)
subprocess.call("sudo -S macchanger --mac=" + new_mac + " " + interface, shell=True)
subprocess.call("ifconfig " + interface + " up", shell=True)
Here are the input commands and the error:
Quote:
interface > eth0
new MAC > 00:11:11:11:11:11
[+] Changing MAC address for eth0 to 00:11:11:11:11:11
SIOCSIFFLAGS: Operation not permitted
[ERROR] Set device name: No such device
SIOCSIFFLAGS: Operation not permitted
I also always get the Quote:
SIOCSIFFLAGS: Operation not permitted
error, I would like to fix that too.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments