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
How To Ping Specific Port Number
Viewed 6235 times since Mon, Jun 1, 2020
ZPOOL: Verify/change properties of a zpool
Viewed 2758 times since Sun, Jun 3, 2018
Inxi – A Powerful Feature-Rich Commandline System Information Tool for Linux
Viewed 19791 times since Sat, Jun 2, 2018
stunnel How To Set Up an SSL Tunnel Using Stunnel on Ubuntu
Viewed 2668 times since Sun, Dec 6, 2020
Linux Network (TCP) Performance Tuning with Sysctl
Viewed 13321 times since Fri, Aug 3, 2018
YUM CRON Enabling automatic updates in Centos 7 and RHEL 7
Viewed 12759 times since Fri, Oct 26, 2018
RHEL: Rename a network interface on RHEL 7
Viewed 11856 times since Sat, Jun 2, 2018
SSH: Execute Remote Command or Script – Linux
Viewed 3123 times since Mon, Feb 18, 2019
Linux - Cannot login from remote console but can access via ssh
Viewed 6239 times since Fri, Jun 8, 2018
How to use yum command on CentOS/RHEL
Viewed 12091 times since Wed, Oct 17, 2018