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
Red Hat 8 How to Set Up Automatic Updates for CentOS 8
Viewed 3950 times since Fri, Sep 25, 2020
RHEL: Building a custom kernel on RHEL 6
Viewed 4282 times since Sat, Jun 2, 2018
RHEL: Adding a boot entry to GRUB/GRUB2 configuration
Viewed 4859 times since Sun, May 27, 2018
Sample logrotate configuration and troubleshooting part 2
Viewed 9635 times since Fri, Nov 30, 2018
Secure Remote Logging to Central Log Server Using RSYSLOG on CentOS 6 / CentOS 7 and stunnel
Viewed 4223 times since Sun, Dec 6, 2020
How to use yum-cron to automatically update RHEL/CentOS Linux 6.x / 7.x
Viewed 5238 times since Tue, Dec 4, 2018
Telnet – Send GET/HEAD HTTP Request
Viewed 3515 times since Mon, Feb 18, 2019
Extending Linux LVM partitions - scripts
Viewed 6748 times since Sun, May 20, 2018
How to find the largest files and directories in Linux?
Viewed 3549 times since Sun, May 20, 2018
chrt command: Set / Manipulate Real Time Attributes of a Linux Process
Viewed 11272 times since Mon, Feb 17, 2020