How to Check Your IP address in Windows, Linux and Mac

Check your IP address using commands without need of additional software's.

  • What is an IP address?

  •  Understanding the TCP/IP Protocol

    TCP stands for Transmission Control Protocol, which is the protocol responsible for the reliable transmission of data over networks.

    In particular, TCP checks integrity of transmissions, and provides for re-transmission if packets have not been delivered correctly.

    The IP protocol, on the other hand, deals with the routing of packets (like those sent by TCP).

    IP stands for Internet Protocol, which defines rules that let packets be sent from an origin to a destination computer.

    How to Check Your IP address in Windows, Linux and Mac







  • FOR WINDOWS

  • How to Check your IP address in Windows


    How to Check Your IP address in Windows, Linux and Mac

    • Click on Start  
    • Type 'cmd' in search bar
    • Open the CMD as administrator.
    • Now after opening the cmd software, type 'ifconfig' and hit enter.


    How to Check Your IP address in Windows, Linux and Mac

    Now, you will see your IP address and Mac address and many other information.









  • FOR LINUX


  • How to Check IP address in Linux



    Linux command


    You have multiple ways to get your  IP address. One way is to use the ifconfig command. ifconfig is a command line program that configures network interfaces on Linux.
    You can retrieve your IP address using the ifconfig command coupled with various flags that filter for your private IP address. Run the following command inside your shell:
    $ ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
    
    The above command checks all the active network interfaces, then filters for the TCP/IP interface, and finally filters the output for the local IP address. The final output is your private IP address. This will look similar to 192.168.1.2 or some variant.
    We can filter the ifconfig output using sed instead, which is a utility for parsing and transforming streams of text. Run the following command to get your private IP address:
    $ ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p
    
    In this example, we are filtering ifconfig output to get your IP address under the TCP/IP protocol. 

    1. FOR MAC


    How to Check IP address in Mac OS


    How to Check Your IP address in Windows, Linux and Mac

    The IP address of Mac OS device can be found using terminal command. For this you need to follow the steps mentioned below:

    Launch terminal by pressing Ctrl+ T or clicking on the terminal icon or searching for terminal in the search window shown below and pressing enter.
    Then type the command:
    /shin/ifconfig

    in the newly opened terminal window and press enter.
    Run ifconfig command
    As soon as you will press enter, a lot of information will be displayed on the terminal screen. From the displayed information below, the highlighted rectangle shows the IP address of your device besides the field of inet addr.
    Ifconfig command result
    The ifconfig command works in the same way for finding the IP address of a device using terminal in Linux as ipconfig command works for finding the IP address of a device using command prompt in Windows.

    For any query and suggestions comment below.

    Post a Comment

    0 Comments

    Want your Article to publish here?. Contact us.