Black to Blog

How to Find Your IP Address | A Guide for Different Devices

How to Find Your IP Address  | A Guide for Different Devices

Your IP (Internet Protocol) address acts like a digital fingerprint for your device on the internet. It helps route information and identify your device when you connect to a network. But how do you actually find your IP address? This guide will break down the process for various devices:

Finding Your Local IP Address

There are two main ways to find your IP address on a computer:

Windows:

  • Go to Start > Settings > Network & internet.
  • Click on your Wi-Fi connection or Ethernet adapter (depending on how you're connected).
  • Under Properties, look for IPv4 address. This is your local IP address.

macOS:

  1. Click the Apple icon in the top left corner of your screen.
  2. Select System Preferences.
  3. Go to Network.
  4. Click on your Wi-Fi or Ethernet connection (depending on how you're connected).
  5. Click on the Advanced button.
  6. Under TCP/IP, look for IPv4 Address. This is your local IP address.

Linux:

(The process may vary slightly depending on your distribution)

  1. Open a terminal window.
  2. Use the ifconfig command to view network interface details.
  3. Identify your active network interface (e.g., wlan0, eth0).
  4. Look for the line containing inet addr: followed by a string of numbers (e.g., inet addr:192.168.1.100). This is your local IP address.

Finding Your Public IP Address

This section uses an external script (find_ip.sh) to retrieve your public IP address. Please refer to the script for details.

Understanding Public vs. Local IP Addresses

It's important to note the difference between your public IP address and your local IP address:

  • Public IP Address: This address is assigned by your internet service provider (ISP) and identifies your entire network to the internet.
#!/bin/bash
 
# Get the public IP address using curl
public_ip=$(curl -s https://ipcheck.vn/api/myip)
 
# Print the public IP address
echo "Your Public IP Address: $public_ip"

[Run the script: ./find_ip.sh] (Replace with the actual command to run your script)

  • Local IP Address: This address is assigned by your router and identifies your device on your local network.

Additional Notes

  • You can find various online services to check your public IP address. However, using a script ensures the information is always up-to-date within this guide.