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: Multipathing basics
Viewed 8156 times since Sat, Jun 2, 2018
SSH ProxyCommand example: Going through one host to reach another server
Viewed 12990 times since Tue, Aug 6, 2019
HowTo: Kill TCP Connections in CLOSE_WAIT State
Viewed 14693 times since Thu, Feb 14, 2019
How to accurately determine when the system was booted
Viewed 2065 times since Wed, Oct 3, 2018
RHCS: Configure an active/backup pacemaker cluster
Viewed 8644 times since Sun, Jun 3, 2018
rabbitmq Troubleshooting TLS-enabled Connections
Viewed 2005 times since Sun, Dec 6, 2020
RHEL: Display swap/RAM size
Viewed 2938 times since Sat, Jun 2, 2018
RHCS6: Create a new Logical Volume / Global Filesystem 2 (GFS2)
Viewed 1933 times since Sun, Jun 3, 2018
Index » Community Contributions » System encryption using LUKS and GPG encrypted keys for arch linux
Viewed 2578 times since Fri, Jul 13, 2018
debian How to check Debian CVE status using python script
Viewed 3301 times since Sun, Sep 23, 2018