DEV Community

Matthew LaFalce
Matthew LaFalce

Posted on

5 2

How to find outgoing IP addresses on your Linux machine.

Here is a small post to help you find the outgoing IP address of you Linux machine.

  1. To find the outgoing internal IP address only
ip route get 8.8.8.8 | head -1 | gawk '{ print $7 }'
Enter fullscreen mode Exit fullscreen mode
  1. 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 }'
Enter fullscreen mode Exit fullscreen mode
  1. In the case that your machine is connected to the internet, to find the outgoing external IP Address.
curl ifconfig.me
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
ducsiu profile image
Đức

Thank you so much.

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay