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
Linux An introduction to swap space on Linux systems
Viewed 3020 times since Thu, Jan 23, 2020
RHCS6: Show/Add GFS2/GFS journals
Viewed 13303 times since Sun, Jun 3, 2018
RHEL: Back-up/Replicate a partition table
Viewed 4142 times since Sun, May 27, 2018
Linux - How to get Memory information
Viewed 2465 times since Fri, Jun 8, 2018
awk printf
Viewed 16374 times since Wed, Aug 19, 2020
LVM: Reduce SWAP size by removing a Logical Volume
Viewed 2588 times since Sat, Jun 2, 2018
Oracle Linux 7 – How to audit changes to a trusted file such as /etc/passwd or /etc/shadow
Viewed 3548 times since Wed, Jul 25, 2018
Linux Network (TCP) Performance Tuning with Sysctl
Viewed 12739 times since Fri, Aug 3, 2018
INSTALACJA MIB SNMP W SYSTEMIE CENTOS/RHEL 6
Viewed 13536 times since Fri, Nov 30, 2018
linux manual tools
Viewed 3420 times since Fri, Sep 28, 2018