Linux - How to get IP and MAC address of ethernet adapter in Linux

Linux - How to get IP and MAC address of ethernet adapter in Linux

 
Question : How to get MAC address of ethernet adapter in Linux?
Answer : ifconfig command can be used to obtain MAC address of ethernet adapter in Linux. Search for "HWaddr" value for MAC address for specific ethernet adapter from output of "ifconfig -a". Alternative, "ifconfig <interface>" command can be used to display for specific ethernet adpater.
Example :
root@server # ifconfig <ethX> | grep HWaddr <-- To get MAC add for specific ethernet
root@server # ifconfig -a | grep HWaddr <-- To get MAC add for all ethernet


Question : How to get IP address of ethernet adapter in Linux?
Answer : ifconfig command can be used to obtain IP address and subnet value of network interface in Linux.
Example :
root@server # ifconfig -a <-- To get IP add and subnet of all interface
root@server # ifconfig <ethX> <-- To get IP add and subnet of specific interface
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
stunnel bacula
Viewed 2199 times since Fri, Sep 28, 2018
Exclude multiple files and directories with rsync
Viewed 2693 times since Wed, Oct 31, 2018
stunnel: Authentication
Viewed 9279 times since Fri, Sep 28, 2018
WatchDog watchdog.sh script for checking server running
Viewed 5563 times since Tue, Jul 31, 2018
RHCS6: Quorum disk and heuristics
Viewed 4528 times since Sun, Jun 3, 2018
Open SSL Creating Certificate Signing Request — CSR Generation
Viewed 2026 times since Mon, Feb 18, 2019
Linux – How to check the exit status of several piped commands
Viewed 3092 times since Wed, Jul 25, 2018
Linux An introduction to swap space on Linux systems
Viewed 2582 times since Thu, Jan 23, 2020
HowTo: Find Out Hard Disk Specs / Details on Linux
Viewed 3696 times since Mon, Jan 28, 2019
Securing /tmp and shm partitions
Viewed 3434 times since Fri, May 15, 2020