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
Index » Community Contributions » System encryption using LUKS and GPG encrypted keys for arch linux
Viewed 543 times since Fri, Jul 13, 2018
Create a Linux Swap File
Viewed 598 times since Fri, Jun 8, 2018
HowTo: Send Email from an SMTP Server using the Command Line
Viewed 420 times since Mon, Feb 18, 2019
stunnel Howto A Guide to create SSL access to a HTTP-only webserver with stunnel
Viewed 458 times since Fri, Sep 28, 2018
stunnel: Authentication
Viewed 495 times since Fri, Sep 28, 2018
RHEL7: How to get started with Firewalld.
Viewed 1209 times since Wed, May 22, 2019
ZFS: Verify/change properties of a zfs filesystem
Viewed 634 times since Sun, Jun 3, 2018
Automatic YUM Updates with Yum-cron
Viewed 460 times since Fri, Oct 26, 2018
How To Run Multiple SSH Command On Remote Machine And Exit Safely
Viewed 501 times since Tue, Aug 6, 2019
RHEL: Reserved space on a ext2/ext3/ext4 filesystem
Viewed 2309 times since Sun, May 27, 2018