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
Linux – Securing your important files with XFS extendend attributes
Viewed 7466 times since Wed, Jul 25, 2018
Linux Linux Network Statistics Tools / Commands
Viewed 9053 times since Mon, Sep 21, 2020
RHEL: Reinstalling Boot Loader on the Master Boot Record (MBR)
Viewed 3226 times since Sun, May 27, 2018
List usernames instead of uids with the ps command for long usernames
Viewed 2271 times since Wed, Jul 25, 2018
rabbitmq Troubleshooting TLS-enabled Connections
Viewed 2312 times since Sun, Dec 6, 2020
LVM: Extend SWAP size by growing existing Logical Volume
Viewed 2392 times since Sat, Jun 2, 2018
RHEL: Forgotten ’root’ password / using single-user to gain access
Viewed 7258 times since Sat, Jun 2, 2018
LVM: Mount LVM Partition(s) in Rescue Mode
Viewed 4712 times since Sat, Jun 2, 2018
Moving SSL Certificate from IIS to Apache
Viewed 1903 times since Mon, Feb 18, 2019
RHEL7 slow ssh login
Viewed 4232 times since Tue, Aug 6, 2019