Here is a small post to help you find the outgoing IP address of you Linux machine.
- To find the outgoing internal IP address only
ip route get 8.8.8.8 | head -1 | gawk '{ print $7 }'
- To find the outgoing internal IP address along with the interface name.
ip route get 8.8.8.8 | head -1 | gawk '{ print $5,$7 }'
- In the case that your machine is connected to the internet, to find the outgoing external IP Address.
curl ifconfig.me
Top comments (1)
Thank you so much.