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
socat: Linux / UNIX TCP Port Forwarder
Viewed 2995 times since Tue, Aug 6, 2019
ubuntu How to Reset Forgotten Passwords in Ubuntu 16.04
Viewed 544 times since Tue, Dec 8, 2020
RHEL: Route network packets to go out via the same interface they came in
Viewed 1683 times since Sat, Jun 2, 2018
Exclude multiple files and directories with rsync
Viewed 1091 times since Wed, Oct 31, 2018
Linux Network (TCP) Performance Tuning with Sysctl
Viewed 7468 times since Fri, Aug 3, 2018
Expand or grow a file system on a Linux VMWare VM without downtime
Viewed 10267 times since Fri, Jul 27, 2018
Linux Screen
Viewed 1135 times since Sat, Jun 2, 2018
LVM basic
Viewed 1142 times since Sat, Jun 2, 2018
Modifying the inode count for an ext2/ext3/ext4 file system
Viewed 8501 times since Fri, Sep 18, 2020
Nagrywanie sesji SSH do pliku
Viewed 1665 times since Thu, May 24, 2018