Linux – How to find out the interface inbound traffic is using

linuxlinux-networkingnetworkingroute

For a outgoing packet, by route I can know which interface is using, but for a incoming packet, how to find out which interface is using?

Best Answer

You're looking for the ip route get command. This is the equivalent of the BSD route get.

ip route get 50.232.186.20 for example will display what route will be used to get to that IP. This command does not resolve host names on its own.