Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find network interface by IP address - Linux/Bash

Tags:

linux

ubuntu

I'm wondering how I can query by IP address using sed, and it will show which interface name that is using it.

For example..

ipconfig -a | grep 10.0.0.10

I would expect it to come back with ETH0

like image 745
TonyW Avatar asked Aug 29 '26 23:08

TonyW


1 Answers

ifconfig | grep -B1 10.0.0.10 | grep -o "^\w*"
like image 179
promaty Avatar answered Aug 31 '26 14:08

promaty



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!