Automated Script to change MAC (Physical address) - How to?

Booting, installing, newbie
Post Reply
Message
Author
User avatar
lickthefrog2
Posts: 57
Joined: Wed 22 Nov 2006, 18:30

Automated Script to change MAC (Physical address) - How to?

#1 Post by lickthefrog2 »

Hi,

I want to spoof (temporarily change) a MAC/Physical address on a computer.

I know how to do this thanks to this forum:

Code: Select all

ifconfig ethX down

Code: Select all

ifconfig ethX hw ether XX:XX:XX:XX:XX:XX
Then I have to go through the Network Setup Wizard to get the dhcp to recognize.

So because it's a shared computer and other users have no to little expertise with computing (and definitely not Linux), I want to write a script and put a nice button on the desktop that handles everything with a single click.

I think I can figure out how to use Rox to write a shell script to do the ifconfig thing, but what about the Network Setup part that I'm relying on buttons for? What is the script to tell the computer to try again to connect with the newly spoofed MAC address?

Thanks and if I'm using incorrect terminology, please correct me.

- lickthefrog2
Last edited by lickthefrog2 on Thu 22 Feb 2007, 22:01, edited 1 time in total.

User avatar
lickthefrog2
Posts: 57
Joined: Wed 22 Nov 2006, 18:30

#2 Post by lickthefrog2 »

I did find this: http://www.murga-linux.com/puppy/viewto ... 76&t=15003

And I'm trying to learn...

- lickthefrog2

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#3 Post by HairyWill »

Assuming that all you are using the wizard for is to get an IP address this should do it.

Code: Select all

rm /etc/dhcpcd/dhcpd-ethX.pid
dhcpcd -d ethX
The first line is necessarry in case the dhcp daemon is already running.[/code]
Last edited by HairyWill on Sun 27 May 2007, 08:16, edited 1 time in total.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
lickthefrog2
Posts: 57
Joined: Wed 22 Nov 2006, 18:30

#4 Post by lickthefrog2 »

Thanks for the reply HairyWill.

I started with what you wrote and then poked around the forum for more advice because I still wasn't getting it. But thanks to you and others (specifically marksouth2000 from this post), I now have following script that seems to be working:

Code: Select all

#!/bin/sh
ifconfig eth1 down
ifconfig eth1 hw ether XX:XX:XX:XX:XX:XX
if [ -e /etc/dhcpc/*.pid ]; then
   rm /etc/dhcpc/*.pid
fi
dhcpcd -t 10 eth1
Thanks...

Post Reply