Difference between revisions of "Find Your Gateway IP"

From Amahi Wiki
Jump to: navigation, search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
If you have ever had to go to your router, you should know the address. Its what you type in your browser to reach it (ie http://192.168.1.1/) and, if not, you can find it with the following steps:
+
It's important for you to know the internal IP address of your default gateway, which is normally your router's LAN IP address.
  
* <b><u>If Windows OS</u>:</b><br /><br />
+
If you have ever had to access your router to configure it, you should know the address. It's what you type in your browser address bar to reach the configuration interface (example: http://192.168.1.1/) and, if not, you can find it with the following steps:
 +
 
 +
* <b><u>Windows</u>:</b><br /><br />
 
** Click <b>Start</b> > <b>All Programs</b> > <b>Accessories</b> > <b>Command Prompt</b>.<br /><br />
 
** Click <b>Start</b> > <b>All Programs</b> > <b>Accessories</b> > <b>Command Prompt</b>.<br /><br />
** When Command Prompt is open, type the following command: <code>ipconfig</code><br /><br />
+
** When Command Prompt is open, type the following command: <code>ipconfig | findstr /i "Gateway"</code> (You can copy & paste it in the command prompt; just right-click anywhere in the command prompt window and select ''Paste''.)<br /><br />
** You should see something like this:
+
** You should see something like this:<br /><code>C:\Documents and Settings\administrator>ipconfig | findstr /i "Gateway"<br />      Default Gateway . . . . . . . . . : 192.168.1.1</code><br /><br />
 
+
** In this example, your default gateway (router) IP address is <b>192.168.1.1</b>.
    C:\Users\Username>ipconfig
 
 
 
    Windows IP Configuration
 
 
 
 
 
    LAN adapter Network Connection:
 
 
 
      Connection-specific DNS Suffix  . :
 
      Link-local IPv6 Address . . . . . : fe88::7d0d:8844:62d7:3155%10
 
      IPv4 Address. . . . . . . . . . . : 192.168.1.222
 
      Subnet Mask . . . . . . . . . . . : 255.255.255.0
 
      Default Gateway . . . . . . . . . : 192.168.1.1
 
 
<br />
 
<br />
The bottom line is what you need. In this example, it is <b>192.168.1.1</b>.
 
<br /><br />
 
  
* <b><u>If Linux OS</u>:</b><br /><br />
+
* <b><u>Linux</u>:</b><br /><br />
** Depending on your Linux distrobution, it can be located in the menu items at the top, in this example, we will use Fedora. Click <b>Applications</b> > <b>System Tools</b> > <b>Terminal</b>.<br /><br />
+
** You'll need to open a Terminal. Depending on your Linux distribution, it can be located in the menu items at the top, or at the bottom of your screen. In this example, we will use Fedora. Click <b>Applications</b> > <b>System Tools</b> > <b>Terminal</b>.<br /><br />
 
** When terminal is open, type the following command: <code>ip route | grep default</code><br /><br />
 
** When terminal is open, type the following command: <code>ip route | grep default</code><br /><br />
** The output of this should look something like the following:
+
** The output of this should look something like the following:<br /><code>joe$ ip route | grep default<br />default via 192.168.1.1 dev eth0  proto static</code><br /><br />
 
+
** In this example, again, <b>192.168.1.1</b> is your default gateway (router) IP address.
    default via 192.168.1.1 dev eth0  proto static
 
<br />
 
In this example, again, <b>192.168.1.1</b> is your default gateway IP address.
 
 
<br /><br />
 
<br /><br />
  
* <b><u>If Mac OS</u>:</b><br /><br />
+
* <b><u>Mac OS X</u>:</b><br /><br />
** In Mac OS you will need to open up terminal as well. Do do this, click <b>Finder</b> > <b>Applications</b> > <b>Utilities</b> > <b>Terminal.app</b>.<br /><br />
+
** Open the Terminal application. Do do this, click <b>Finder</b> > <b>Applications</b> > <b>Utilities</b> > <b>Terminal.app</b>.<br /><br />
** When Terminal.app is open, type the following command: <code>ipconfig getpacket en1</code><br /><br />Where <b>en1</b> is the adapter you are connected to, the default for wire (ethernet) is <b>eth0</b>, in my case, im connected through wireless adapter, so the default on my MacBook is en1 (late 2008 model).<br /><br />
+
** When Terminal.app is open, type the following command: <code>netstat -nr | grep default</code><br /><br />
** This will output the following:
+
** This will output the following:<br /><code>joe$ netstat -nr | grep default<br />default            192.168.1.1      UGSc          50      46    en1</code><br /><br />
 
+
** In this example, again, <b>192.168.1.1</b> is your default gateway (router) IP address.
    op = BOOTREPLY
 
    htype = 1
 
    flags = 0
 
    hlen = 6
 
    hops = 0
 
    xid = xxxxxxxxx
 
    secs = 0
 
    ciaddr = 0.0.0.0
 
    yiaddr = 192.168.1.x
 
    siaddr = 0.0.0.0
 
    giaddr = 0.0.0.0
 
    chaddr = 0:00:0:0x:00:0x
 
    sname =
 
    file =
 
    options:
 
    Options count is 7
 
    dhcp_message_type (uint8): ACK 0x5
 
    server_identifier (ip): 192.168.1.1
 
     lease_time (uint32): 0x15180
 
    subnet_mask (ip): 255.255.255.0
 
    router (ip_mult): {192.168.1.1}
 
    domain_name_server (ip_mult): {192.168.1.1}
 
    end (none):[/code]
 
 
 
In this output, the part that shows <code>router (ip_mult): {192.168.1.1}</code> where <b>192.168.1.1</b> is the router IP or gateway IP.
 

Latest revision as of 17:46, 4 March 2011

It's important for you to know the internal IP address of your default gateway, which is normally your router's LAN IP address.

If you have ever had to access your router to configure it, you should know the address. It's what you type in your browser address bar to reach the configuration interface (example: http://192.168.1.1/) and, if not, you can find it with the following steps:

  • Windows:

    • Click Start > All Programs > Accessories > Command Prompt.

    • When Command Prompt is open, type the following command: ipconfig | findstr /i "Gateway" (You can copy & paste it in the command prompt; just right-click anywhere in the command prompt window and select Paste.)

    • You should see something like this:
      C:\Documents and Settings\administrator>ipconfig | findstr /i "Gateway"
      Default Gateway . . . . . . . . . : 192.168.1.1


    • In this example, your default gateway (router) IP address is 192.168.1.1.


  • Linux:

    • You'll need to open a Terminal. Depending on your Linux distribution, it can be located in the menu items at the top, or at the bottom of your screen. In this example, we will use Fedora. Click Applications > System Tools > Terminal.

    • When terminal is open, type the following command: ip route | grep default

    • The output of this should look something like the following:
      joe$ ip route | grep default
      default via 192.168.1.1 dev eth0 proto static


    • In this example, again, 192.168.1.1 is your default gateway (router) IP address.



  • Mac OS X:

    • Open the Terminal application. Do do this, click Finder > Applications > Utilities > Terminal.app.

    • When Terminal.app is open, type the following command: netstat -nr | grep default

    • This will output the following:
      joe$ netstat -nr | grep default
      default 192.168.1.1 UGSc 50 46 en1


    • In this example, again, 192.168.1.1 is your default gateway (router) IP address.