LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 05-16-2020, 12:11 PM   #1
gw1500se
Member
 
Registered: Mar 2004
Distribution: Mandriva 2010.0
Posts: 250

Rep: Reputation: 31
Given IP Address Get Associated NIC Info


I need to write a script that, given a local IP address on a multi-homed host, will determine which NIC it is using and ultimately whether is it an ethernet or WiFi NIC? Can someone point me in the right direction? TIA.
 
Old 05-16-2020, 01:36 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,730

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
There are many ways and utilities to find the desired information. Which one(s) to use depends on what distribution / version you are currently running.

If you are running a recent distribution with persistent naming just look at the output of the ip command.
 
Old 05-16-2020, 02:08 PM   #3
gw1500se
Member
 
Registered: Mar 2004
Distribution: Mandriva 2010.0
Posts: 250

Original Poster
Rep: Reputation: 31
Thanks for the reply. I don't see how the 'ip' command helps. I can't provide it with an IP address and get the information I want. I know I can write a complicated script that processes the output of 'ifconfig' but I was hoping for something easier.

If it matters my distro is raspbian.
 
  


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 get ip address associated with an interface ro0tless Linux - Networking 4 10-03-2011 12:18 PM
i tried using this code for deleting a user given character from a user given string mecrazyme1234 Linux - Newbie 2 06-04-2011 04:59 PM
i tried using this code for deleting a user given character from a user given string mecrazyme1234 Programming 7 06-04-2011 11:47 AM
how to get the mac address from given ip address sankalpsonu Linux - Networking 3 10-01-2010 08:43 AM
merge files, given its odd and even given timepassman Linux - Software 1 05-08-2008 01:17 AM

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

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