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
RHEL: Forgotten ’root’ password / using single-user to gain access
Viewed 1401 times since Sat, Jun 2, 2018
PROCESSOR AND MEMORY INFORMATION
Viewed 1025 times since Sat, Jun 2, 2018
CentOS / RHEL 7 : Configuring an NFS server and NFS client Linux NFS
Viewed 3747 times since Fri, Feb 21, 2020
Easily Monitor CPU Utilization in Linux Terminal With Stress Terminal UI
Viewed 1018 times since Thu, Apr 18, 2019
RHEL: How to change a USER/GROUP UID/GID and all owned files
Viewed 6073 times since Sat, Jun 2, 2018
Enabling automatic updates in Centos 7 and RHEL 7
Viewed 749 times since Wed, Oct 17, 2018
Extending Linux LVM partitions - scripts
Viewed 3129 times since Sun, May 20, 2018
Linux Network (TCP) Performance Tuning with Sysctl
Viewed 4535 times since Fri, Aug 3, 2018
linux manual tools
Viewed 792 times since Fri, Sep 28, 2018
UUIDs and Linux: Everything you ever need to know [Update]
Viewed 717 times since Tue, Jul 17, 2018