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
Using IOzone for Linux disk performance analysis
Viewed 3797 times since Wed, Jul 25, 2018
How to Clear RAM Memory Cache, Buffer and Swap Space on Linux
Viewed 199 times since Mon, Nov 23, 2020
Telnet – Send GET/HEAD HTTP Request
Viewed 719 times since Mon, Feb 18, 2019
logrotate How log rotation works with logrotate
Viewed 1230 times since Sun, Jan 12, 2020
Linux 20 Netstat Commands for Linux Network Management
Viewed 313 times since Mon, Sep 21, 2020
LVM: Reduce SWAP size by shrinking existing Logical Volume
Viewed 1155 times since Sat, Jun 2, 2018
Linux ssh Hide OpenSSH Version Banner
Viewed 1803 times since Wed, Apr 22, 2020
ZPOOL: Remove an existing zpool
Viewed 799 times since Sun, Jun 3, 2018
How to Synchronize Directories Using Lsyncd in Linux
Viewed 1912 times since Wed, Oct 31, 2018
RHCS6: Basic operations on clustered services
Viewed 984 times since Sun, Jun 3, 2018