Find the route and source IP for a destination
which ip does my server use for outgoing traffic | ip route get example | find outgoing interface for destination | ip | routing | troubleshootingip route get 1.1.1.1Asks the kernel routing table how a packet to the given address would be sent. The output names the gateway (via), interface (dev) and the source address used (src). Especially useful on servers with multiple IPs, for example to check which address mail or API calls leave the server with.
Note: For IPv6, simply specify an IPv6 address as the destination.
Also searched as
- which ip does my server use for outgoing traffic
- ip route get example
- find outgoing interface for destination