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
List DNS records, nameservers of a domain from command line
Viewed 2679 times since Sun, Sep 30, 2018
Terminal based "The Matrix" like implementation
Viewed 4152 times since Thu, Apr 18, 2019
3 Ways to Check Linux Kernel Version in Command Line
Viewed 12687 times since Fri, Apr 19, 2019
How to accurately determine when the system was booted
Viewed 2883 times since Wed, Oct 3, 2018
How to use yum-cron to automatically update RHEL/CentOS Linux 6.x / 7.x
Viewed 5972 times since Tue, Dec 4, 2018
LVM: Create a new Volume Group
Viewed 2732 times since Sat, Jun 2, 2018
12 Linux Rsync Options in Linux Explained
Viewed 13051 times since Wed, Oct 31, 2018
Easily Find Bugs In Shell Scripts With ShellCheck
Viewed 4186 times since Thu, Apr 18, 2019
Linux nslookup Command Examples for DNS Lookup
Viewed 10029 times since Sat, Sep 29, 2018
Linux RAID Mdadm Cheat Sheet
Viewed 6501 times since Fri, May 15, 2020