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
Extending Linux LVM partitions script
Viewed 6481 times since Wed, Feb 6, 2019
SYS: Configure a local repository. local repo
Viewed 11058 times since Mon, Oct 29, 2018
Linux get the list of FC HBA’s and WWPN
Viewed 3421 times since Tue, May 22, 2018
Jak znaleźć najszybszy publiczny serwer DNS w Polsce?
Viewed 3176 times since Mon, May 21, 2018
LVM basic
Viewed 2288 times since Sat, Jun 2, 2018
RHEL: Building a custom kernel on RHEL 6
Viewed 4225 times since Sat, Jun 2, 2018
chrt command: Set / Manipulate Real Time Attributes of a Linux Process
Viewed 11179 times since Mon, Feb 17, 2020
HowTo: Send Email from an SMTP Server using the Command Line
Viewed 2091 times since Mon, Feb 18, 2019
RHEL: Reserved space on a ext2/ext3/ext4 filesystem
Viewed 4576 times since Sun, May 27, 2018
Install Security Patches or Updates Automatically on CentOS and RHEL
Viewed 1871 times since Fri, Oct 26, 2018