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
haproxy linux
Viewed 2491 times since Sun, Dec 6, 2020
6 rsync Examples to Exclude Multiple Files and Directories using exclude-from
Viewed 4933 times since Wed, Oct 31, 2018
ZPOOL: Verify/change properties of a zpool
Viewed 2114 times since Sun, Jun 3, 2018
How to configure an SSH proxy server with Squid
Viewed 3099 times since Sun, Dec 6, 2020
Transform XML to CSV Format | Unix String Pattern Manipulation The Ugly Way
Viewed 5512 times since Sun, Jan 9, 2022
Linux - How to monitor CPU usage
Viewed 6472 times since Fri, Jun 8, 2018
CentOS / RHEL : How to move a Volume Group from one system to another
Viewed 3578 times since Mon, Jan 28, 2019
systemd Auto-restart a crashed service in systemd
Viewed 3222 times since Fri, Jan 17, 2020
How to stop and disable auditd on RHEL 7
Viewed 40136 times since Tue, Aug 6, 2019
How to enable automatic security updates on CentOS 7 with yum-cron
Viewed 2489 times since Fri, Oct 26, 2018