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
What is OS Watcher Utility and How to use it for Database Troubleshooting ?
Viewed 23306 times since Thu, Jun 21, 2018
high swap space utilization in LINUX
Viewed 4885 times since Fri, Jul 13, 2018
How to Synchronize Directories Using Lsyncd in Linux
Viewed 9949 times since Wed, Oct 31, 2018
Top 4 Reasons for Node Reboot or Node Eviction in Real Application Cluster (RAC) Environment
Viewed 17121 times since Thu, Jun 21, 2018
10 Linux DIG Command Examples for DNS Lookup
Viewed 9486 times since Sun, Sep 30, 2018
How to recover error - Audit error: dispatch err (pipe full) event lost
Viewed 11359 times since Tue, Aug 6, 2019
ubuntu How to reset lost root password on Ubuntu 16.04 Xenial Xerus Linux
Viewed 6739 times since Tue, Dec 8, 2020
Understanding logrotate utility part 1
Viewed 829 times since Fri, Nov 30, 2018
20 Linux Command Tips and Tricks That Will Save You A Lot of Time linux
Viewed 2676 times since Thu, Apr 18, 2019
UUIDs and Linux: Everything you ever need to know [Update]
Viewed 3648 times since Tue, Jul 17, 2018