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
HowTo: The Ultimate Logrotate Command Tutorial with 10 Examples
Viewed 5512 times since Fri, Nov 30, 2018
RHEL: Manually encrypting a filesystem with LUKS
Viewed 3972 times since Sun, May 27, 2018
RHEL: XFS basic operations
Viewed 16201 times since Sat, Jun 2, 2018
How to Install and use Lsyncd on CentOS 7 / RHEL 7 rsync
Viewed 4550 times since Wed, Oct 31, 2018
RHEL: Extending a multipath LUN
Viewed 5237 times since Sun, May 27, 2018
LVM: Create a new Logical Volume / Filesystem
Viewed 2196 times since Sat, Jun 2, 2018
tcpdump usage examples
Viewed 2437 times since Fri, Jul 27, 2018
Linux: Disks diagnostic using smartctl
Viewed 15282 times since Wed, Jul 25, 2018
Improve security with polyinstantiation
Viewed 13479 times since Fri, May 15, 2020
ZPOOL: Grow a zpool by adding new device(s)
Viewed 6184 times since Sun, Jun 3, 2018