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 do a Filesystem Resize (ext3/ext4) on Redhat running on VMware
Viewed 11873 times since Wed, Jul 25, 2018
RHEL: Multipathing basics
Viewed 11753 times since Sat, Jun 2, 2018
Jak znaleźć najszybszy publiczny serwer DNS w Polsce?
Viewed 3952 times since Mon, May 21, 2018
LVM: Extend SWAP size by growing existing Logical Volume
Viewed 3371 times since Sat, Jun 2, 2018
Linux - How to monitor CPU usage
Viewed 7314 times since Fri, Jun 8, 2018
ubuntu How to Reset Forgotten Passwords in Ubuntu 16.04
Viewed 4972 times since Tue, Dec 8, 2020
How to use yum command on CentOS/RHEL
Viewed 12457 times since Wed, Oct 17, 2018
RHEL: Enabling standard ftp/telnet
Viewed 4571 times since Sun, May 27, 2018
LVM: Extend an existing Logical Volume / Filesystem
Viewed 3481 times since Sat, Jun 2, 2018
Linux - How to perform I/O performance test with dd command
Viewed 7058 times since Fri, Jun 8, 2018