LinuxQuestions.org
Review your favorite Linux distribution.
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-15-2004, 08:36 AM   #1
shivanu
LQ Newbie
 
Registered: Sep 2004
Posts: 5

Rep: Reputation: 0
Where is the MAC Number stored?


Hello,
I am trying to store the MAC number using a C program. So was wondering where it is stored. Also, though i can see the MAC number on the console by using ifconfig, I cannot store it. Is there a way to store the result of ifconfig or for that matter any system command like that onto a file?

Thanks
Shivanu
 
Old 09-15-2004, 08:40 AM   #2
ElmPie
LQ Newbie
 
Registered: Aug 2003
Distribution: Debian
Posts: 12

Rep: Reputation: 0
Hey,

normally the MAC address is stored in the NIC itself. I guess when your NIC provides functionality to replace this MAC address you can do it.

The brand of your NIC should provide you with these tools.

You can store output from programs like this :

ifconfig > yourdetails.txt


Hope I was of any help.

Ps.: if your NIC supports MAC replacing, what brand and type are you using? Thanks.
 
Old 09-15-2004, 08:51 AM   #3
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Can't help you with your C program, but the output of any command can be redirected to a file or even another program (pipe) using the shells redirection capabilites. i.e. >, >> ,etc...

See: man bash

Jump down to the chapter labeled REDIRECTION. i.e. At the first man prompt (colon), type /REDIRECTION
At the next man prompt, type 'n' (without the quotes) to search for the next occurance of REDIRECTION.
You should arrive at your answer on the second search.
 
Old 09-15-2004, 09:35 AM   #4
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
for redirection in c you might want to have a look at the dup2 and popen calls

Last edited by mirradric; 09-15-2004 at 09:54 AM.
 
Old 09-15-2004, 10:14 AM   #5
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
I found this on a google search.....


http://www.linuxquestions.org/questi...003/03/3/38217
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Preserving number of links with 'cp'. ( preserve number of links ) Devyn Linux - General 7 09-16-2005 10:07 PM
what is a major number and a minor number ? Menestrel Linux - Newbie 2 10-11-2004 07:53 AM
how do you edit your virtual console number? (or VT number 3) jjorloff1 Linux - General 2 04-03-2004 07:21 PM
Where are executables stored ??? SelaAragon Linux - Software 10 03-15-2004 02:38 PM
why there is a need for minor number and major number for monitor/keyboard in pc? tripathi Solaris / OpenSolaris 1 11-07-2003 09:36 AM

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

All times are GMT -5. The time now is 04:49 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