My IP address on the Internet

0
(0)

Output the global Internet address in the shell, query local IPv4 and IPv6 addresses in the terminal

Determining the global IP with this one is surfing the Internet, this is also possible in the command line, for Windows, Linux and macOS.

Run the following command in the Linux terminal to query the public global IP address:

Determine the local private IP address with the following command:

For Linux operating systems installed in German:

Note: ipconfig is deprecated, for current distributions, such as Ubuntu 18.04 or CentOS 7.2 and Fedora 28, the ip command is applied, this command only returns IPv4 addresses:

The slightly clearer and also more colorful version as follows:

Only IPv6 addresses should be output:

Also, the hostname command can provide useful values:

macOS IP address


macOS returns the IP address from the terminal with the following command.

And the hostname command is also available on macOS:

Find Windows IP address

Windows uses ipconfig to output the IP addresses.

Also only IPv4 addresses can be queried:

To reduce the amount of information that ipconfig generates, command wmic can help.

This query e.g. outputs the IP address of each interface.

View IP addresses in the PowerShell with Get-NetIPAddress, useful also in scripts

Again, only IPv4 addresses can be queried:

By typing Get-NetIPAddress -? all parameters to the cmdlet are output.

View public IP address and local private IP address in powershell

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Reply

Your email address will not be published. Required fields are marked *