LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-17-2017, 02:13 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post Find which NIC plugged.


Hello.
I installed CentOS 7 x64 on a system via 4 NIC, But just one NIC cable is connected. The DHCP server is not enabled too and I want to configure my NIC manually, But how can I find the name of NIC that cable plugged to it?

Thank you.
 
Old 06-17-2017, 04:10 AM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,819

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
You can get the link state for each device node present using the ip command...
Code:
ip link
 
2 members found this post helpful.
Old 06-17-2017, 04:25 AM   #3
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Just to build up on what ferrari correctly advised, I'll post outputs for the ip command so that you see how you will identify the connected NIC.
I have only one NIC but you'll spot the difference easily.

When network cable is connected:
Code:
# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 3c:xx:xx:xx:xx:49 brd ff:ff:ff:ff:ff:ff
When network cable is disconnected:
Code:
# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
    link/ether 3c:xx:xx:xx:xx:49 brd ff:ff:ff:ff:ff:ff
Spot the NO-CARRIER and state DOWN?

Last edited by aragorn2101; 06-17-2017 at 04:28 AM.
 
1 members found this post helpful.
Old 06-17-2017, 06:18 AM   #4
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Thank you so much.
 
  


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 to make detect the plugged number of NIC's on a PC ? aditya.gnu Programming 2 06-24-2010 08:10 AM
How to find the details of NIC karamkumar Ubuntu 5 05-16-2007 11:39 PM
How to detect programatically if a USB device is is plugged-in / plugged out? franc Linux - Software 3 02-01-2007 04:01 AM
Can't find HD, CD or NIC jdtiede Linux - Hardware 5 02-12-2006 11:12 PM
How can i find out what module my NIC is using? naloxone Linux - Networking 2 10-02-2003 12:26 AM

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

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