LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-28-2012, 08:48 PM   #1
Imprive
Member
 
Registered: Oct 2010
Posts: 33

Rep: Reputation: 0
Startup script to alter IP and MAC address with /dev/random


Hello,
I am trying to create a startup script for a Ubuntu-based OS that will alter my IP and MAC address on startup. I found several tutorials on how to write an init script, but I can't seem to find one that explains how to use /dev/random (random # generator) alongside the MAC and IP change commands.

Can I do this with /dev/random? Or is there a better function that is built into Ubuntu or the linux kernel?

How would I go about doing this? Also, can I implement this BEFORE the networking services run? Or do I need to wait until after then do the normal start/stop commands?

Thanks,
Imprive
 
Old 12-29-2012, 09:01 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
...I found several tutorials on how to write an init script, but I can't seem to find one that explains how to use /dev/random (random # generator) alongside the MAC and IP change commands. ...
Always best to quote your sources so seasoned users can gauge what possible solutions can be presented. What tutorials exactly? URLs!

Are you trying to nullify IP/MAC settings on a cloned image perhaps?

I have never seen this asked before in Years of IT work, IP/MAC+/dev/random

Quite unique, that or I'm quite clueless.
Why is /dev/urandom involved in this process?

Last edited by Habitual; 12-29-2012 at 09:02 AM.
 
Old 12-29-2012, 01:03 PM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,869
Blog Entries: 1

Rep: Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870
First, ask your network-administrator's opinion about your idea.
 
Old 12-29-2012, 09:48 PM   #4
Imprive
Member
 
Registered: Oct 2010
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Habitual View Post
Always best to quote your sources so seasoned users can gauge what possible solutions can be presented. What tutorials exactly? URLs!

Are you trying to nullify IP/MAC settings on a cloned image perhaps?

I have never seen this asked before in Years of IT work, IP/MAC+/dev/random

Quite unique, that or I'm quite clueless.
Why is /dev/urandom involved in this process?
It doesn't have to use /dev/random I just assumed that that was a function I might be able to utilize to randomly change my MAC address and IP address in linux at startup.

I was looking at this thread: http://www.backtrack-linux.org/forum...ad.php?t=38719
and it seemed like something that could be automated at startup so I didn't have to manually type anything in. As for startup script I came a across this link:

http://www.linuxquestions.org/questi...script-376302/

I am just not sure how I would modify it to suit my needs.

I also came across this post about a program called MAC changer: http://www.backtrack-linux.org/forum...ead.php?t=3774

I think this solves the MAC part of it, but I am still curious to see what the full script would look like.

Thanks,
Imprive
 
  


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
Mask/Alter Mac Address from Connections coming through Proxy dboy1612 Linux - Server 3 11-18-2010 12:20 AM
Startup Hang after "Using /etc/random-seed to initialize /dev/urandom" DotMatrix Slackware 5 02-26-2010 12:34 AM
env variable mac address script problem schris403 Programming 7 08-01-2007 03:04 PM
script that can pull ip and mac address off the network thefedexguy Linux - Networking 1 11-29-2005 03:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:31 PM.

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