LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2018, 08:03 AM   #1
penguen1
LQ Newbie
 
Registered: Jul 2017
Posts: 6

Rep: Reputation: Disabled
Macchanger-Can't change MAC address on every boot


Using Debian testing on XFCE. During the install of the package I approved changing mac address automatically every boot but even with macchanger -r wlp3s0 command it gives me the following error, what can I do to change mac automatically?

[ERROR] Could not change MAC: interface up or insufficient permissions: Operation not permitted

Even if I turn down the network interface with ip command, the problem persists. Maybe I should execute macchanger -r command before network interface is loaded, but do not know how to do it. Can someone help?
 
Old 09-09-2018, 01:13 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
there isn't too much information in your post, which might be a reason why no-one answered so far.

i know little of these things and held my tongue, so far.

but i know how to troubleshoot a problem, and provide useful information.
https://wiki.archlinux.org/index.php/Troubleshooting

often it helps to do a web search for the error messge.
the first result (kali forums) looks promising.
 
1 members found this post helpful.
Old 09-09-2018, 05:07 AM   #3
penguen1
LQ Newbie
 
Registered: Jul 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
Well, I managed to change the MAC address at every boot but here came another problem:

After writing the below script, putting it into /etc/init.d, I entered following commands to terminal:

sudo chmod +x /etc/init.d/macchanger.sh
sudo chown root:root /etc/init.d/macchanger.sh
sudo update-rc.d macchanger.sh defaults
sudo update-rc.d macchanger.sh enable

However now when I shutdown it gives two errors: "A stop job is running for LSB: macchanger.sh
A start job is running for Network Manager.

What can be the problem?

SCRIPT:

#!/bin/sh
### BEGIN INIT INFO
# Provides: macchanger.sh
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Change MAC on every boot
# Description: macchanger.sh
### END INIT INFO
sudo ip link set wlp3s0 down
sudo service network-manager stop
sudo macchanger -r wlp3s0
sudo ip link set wlp3s0 up
sudo service network-manager start
 
Old 09-09-2018, 06:02 AM   #4
lougavulin
Member
 
Registered: Jul 2018
Distribution: Slackware,x86_64,current
Posts: 279

Rep: Reputation: 100Reputation: 100
Are you running an old Ubuntu ? Because since a while, Ubuntu use systemd as init.
 
Old 09-09-2018, 06:45 AM   #5
penguen1
LQ Newbie
 
Registered: Jul 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lougavulin View Post
Are you running an old Ubuntu ? Because since a while, Ubuntu use systemd as init.
No, I am using Debian Testing (XFCE). I am now aware of systemd is being used mostly. Can someone guide me how to remove the commands I have written, and use do the correct script in systemd?
 
Old 09-10-2018, 11:51 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by penguen1 View Post
Can someone guide me how to remove the commands I have written
no you have to do that yourself.

Quote:
and use do the correct script in systemd?
http://forums.debian.net/viewtopic.p...680703#p680705 (yep, it's a double poster)
and
https://wiki.debian.org/systemd
https://wiki.archlinux.org/index.php/Systemd
 
Old 09-11-2018, 03:07 AM   #7
penguen1
LQ Newbie
 
Registered: Jul 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
Thank you, neckbeard.
 
Old 09-13-2018, 11:56 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by penguen1 View Post
Thank you, neckbeard.
riiiight...

whatever mis-step i might be guilty of (you don't say), i did not resort to childish name calling.
all 3 links i gave are (or at least can be) relevant to solving your problem.
did you read what debiman answered?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I Cannot connect after Mac Change with MacChanger imayneed Linux - Software 20 09-05-2017 04:25 PM
LXer: How to change MAC address using macchanger on Kali Linux LXer Syndicated Linux News 0 01-06-2017 06:30 AM
Change mac address for wlan0 without using macchanger software? VolkHe Linux - Hardware 2 09-08-2015 08:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration