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
debian How to Upgrade Debian 8 Jessie to Debian 9 Stretch
Viewed 2401 times since Sun, Sep 23, 2018
How to use yum-cron to automatically update RHEL/CentOS Linux
Viewed 2732 times since Wed, Oct 17, 2018
stunnel Howto A Guide to create SSL access to a HTTP-only webserver with stunnel
Viewed 2780 times since Fri, Sep 28, 2018
RHEL: Extending the maximum inode count on a ext2/ext3/ext4 filesystem
Viewed 3351 times since Sun, May 27, 2018
RHEL: Reinstalling Boot Loader on the Master Boot Record (MBR)
Viewed 3461 times since Sun, May 27, 2018
Lsyncd: live file syncronization across multiple Linux servers
Viewed 7064 times since Wed, Oct 31, 2018
ZFS: Create a new zfs filesystem
Viewed 2664 times since Sun, Jun 3, 2018
Learn Linux System Auditing with Auditd Tool on CentOS/RHEL
Viewed 4422 times since Fri, Apr 5, 2019
Using stunnel and TinyProxy to obfuscate HTTP traffic
Viewed 7062 times since Fri, Sep 28, 2018
10 Linux nslookup Command Examples for DNS Lookup
Viewed 10310 times since Sun, Sep 30, 2018