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
Using etckeeper with git
Viewed 9193 times since Sun, Jun 3, 2018
RHEL: Route network packets to go out via the same interface they came in
Viewed 4483 times since Sat, Jun 2, 2018
Netcat shell zabezpieczony hasłem
Viewed 3081 times since Thu, May 24, 2018
Tropienie pożeracza dysku
Viewed 3109 times since Thu, May 24, 2018
Tilix: Advanced Tiling Terminal Emulator for Power Users
Viewed 8524 times since Thu, Apr 18, 2019
How to disable SSH cipher/ MAC algorithms for Linux and Unix
Viewed 52226 times since Fri, Aug 21, 2020
How to accurately determine when the system was booted
Viewed 3059 times since Wed, Oct 3, 2018
Creating SWAP partition using FDISK & FALLOCATE commands
Viewed 8378 times since Thu, Jan 16, 2020
Linux Proxy Server Settings – Set Proxy For Command Line
Viewed 6910 times since Mon, Feb 18, 2019
How to enable Proxy Settings for Yum Command on RHEL / CentOS Servers
Viewed 14681 times since Thu, Jul 19, 2018