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


Article Number: 243
Posted: Fri, Jun 8, 2018 9:47 PM
Last Updated: Fri, Jun 8, 2018 9:47 PM

Online URL: http://kb.ictbanking.net/article.php?id=243