Sunday, May 19, 2024
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 46546  / 1 Year ago, mon, january 9, 2023, 7:36:58

Is there a Linux command that allows me to get the MAC address of my router?


More From » command-line

 Answers
5

I like one-liners:



arping -f -I $(ip route show match 0/0 | awk '{print $5, $3}')


arping shows the MAC associated with the default gateway IP address from the output of ip route show match 0/0, parsed by awk.


[#20664] Tuesday, January 10, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tusmuumu

Total Points: 195
Total Questions: 122
Total Answers: 104

Location: Oman
Member since Tue, Feb 7, 2023
1 Year ago
;