LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-07-2023, 11:46 PM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 568

Rep: Reputation: 10
Post Find the network card


Hello,
A PC has two network cards, both of which are the same model. How to find out which MAC address belongs to which network card?
It is not possible to open the PC case and there is no active network.

Thank you.
 
Old 11-08-2023, 12:07 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,767

Rep: Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765
Why. If there is no network, why would you care about the MAC addresses?
 
Old 11-08-2023, 05:35 AM   #3
lvm_
Member
 
Registered: Jul 2020
Posts: 984

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
Connect them to each other.
 
Old 11-08-2023, 08:08 AM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,243

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
The command ip -d a will tell you mac address.

Configure one port, and you will see with the IP command eth0 or eth1 assigned; ( or what ever name).

Last edited by camorri; 11-08-2023 at 10:30 AM.
 
1 members found this post helpful.
Old 11-08-2023, 09:45 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
I think the OP wants to match the MAC address with the physical port on the computer. Connecting them together would cause both to be active but you would not know which one was which. About the only thing I can think of at the moment would be to build a loopback plug.
 
1 members found this post helpful.
Old 11-08-2023, 12:23 PM   #6
lvm_
Member
 
Registered: Jul 2020
Posts: 984

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
Quote:
Originally Posted by michaelk View Post
Connecting them together would cause both to be active but you would not know which one was which.
You can determine it by PCI slot number which is programmatically available (actually I suspect that MAC address of a card is visible even if it is not connected, but I am too lazy to check :) If they are both built-in, then yes, bummer.
 
Old 11-08-2023, 01:22 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
I assume built-in but yes if they are PCI devices it should be fairly easy to tell.
 
Old 11-08-2023, 02:25 PM   #8
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,249

Rep: Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323
Is it your "thing" to just make up random questions?

I'm going to answer this one with a question: what do I hope to do with this information?

Last edited by dugan; 11-08-2023 at 02:27 PM.
 
Old 11-08-2023, 02:34 PM   #9
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,767

Rep: Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765
MAC addresses are displayed as ether in the output of
Code:
ip link show
. Figuring out the map from the reported NIC ports to the physical port connections might be interesting, but the easy way is to connect one and detect the link state.
 
1 members found this post helpful.
Old 11-15-2023, 12:23 AM   #10
Jason.nix
Member
 
Registered: Feb 2023
Posts: 568

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by lvm_ View Post
Connect them to each other.
Hello,
Thank you so much for your reply.
Connecting them to each other causes both network cards to be in up mode, not one of them. If only one of them was in up mode, then it would be a good idea. What does this help?
 
Old 11-15-2023, 12:49 AM   #11
Jason.nix
Member
 
Registered: Feb 2023
Posts: 568

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by camorri View Post
The command ip -d a will tell you mac address.

Configure one port, and you will see with the IP command eth0 or eth1 assigned; ( or what ever name).
Hello,
Thank you so much for your reply.
Then eth0 or eth1 is related to which physical card?
 
Old 11-15-2023, 05:22 PM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
See post #9; just connect one and check it.
Then disconnect that one and connect the other & check ....
 
Old 11-21-2023, 11:24 PM   #13
Jason.nix
Member
 
Registered: Feb 2023
Posts: 568

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by chrism01 View Post
See post #9; just connect one and check it.
Then disconnect that one and connect the other & check ....
Hello,
Thank you so much for your reply.
Do you mean I remove one of the network cards? If yes, then I must say that it is not possible to open the case door.
 
Old 11-22-2023, 05:06 AM   #14
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
No. Connect one to your other computer or switch and test each port for an active link using ethtool.
 
Old 11-22-2023, 07:32 AM   #15
LordSweeper
LQ Newbie
 
Registered: Nov 2023
Posts: 2

Rep: Reputation: 0
Hello, I am new here.

Last edited by LordSweeper; 11-24-2023 at 06:19 AM. Reason: Need to edit some spelling mistakes.
 
  


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
How the socket read,write works with the hardware(network card or network card driver)? Yuc Linux - Newbie 1 10-12-2019 01:10 AM
replaced eth0 network card new network card comes up as eth1 glorsplitz Linux - Networking 7 03-26-2009 08:03 PM
Linux and Network card compatbility, will any network card work ? MrMark Linux - Networking 6 02-12-2007 08:17 PM
linux shuts down built in network card then windows tells me network card is unplugge lesmoxhaybaker SUSE / openSUSE 8 08-29-2006 05:10 PM
network card issue (the card itself no network problem) Youri Linux - Hardware 2 01-23-2006 08:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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